Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function assert(Acl $acl, ?RoleInterface $role = null, ?ResourceInterface $resource = null, $privilege = null): bool |
||
22 | { |
||
23 | /** @var HasOwner $object */ |
||
24 | $object = $resource->getInstance(); |
||
|
|||
25 | |||
26 | if (CurrentUser::get() && CurrentUser::get() === $object->getOwner()) { |
||
27 | return true; |
||
28 | } |
||
29 | |||
30 | return $acl->reject('the object does not belong to the user'); |
||
31 | } |
||
38 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.