Page MenuHomeDevCentral

Move resolve_resource_id into Resources helper class
Changes PlannedPublic

Authored by dereckson on Tue, Nov 4, 02:15.

Details

Reviewers
None
Summary

Recreate the missing or prune get_user_id method

Test Plan
  • browse a regular namespace
  • load a workspace with custom auth method

Diff Detail

Repository
rOBSIDIAN Obsidian Workspaces
Lint
No Lint Coverage
Unit
No Test Coverage
Branch
main
Build Status
Buildable 6143
Build 6427: arc lint + arc unit

Event Timeline

dereckson added inline comments.
workspaces/src/includes/objects/user.php
263

There is an implementation issue for Option::orElse

We should ideally have:

  • Option::or to give a default value
  • Option::orElse to execute a closure in lazy loading

Here, the _from_email will always be executed, to get the default value to pass to orElse

Our code could become:

->orElse(function() use ($expression) {
    return self::get_user_from_email($expression);
})

In Keruald, this None::orElse must method actually match or():

public function orElse (mixed $default) : mixed {
    return $default;
}

It should execute the function, while in Some, the implementation is correct:

public function orElse (callable $callable) : mixed {
    return $callable()
}