| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 2 | public function assert(Acl $acl, ?RoleInterface $role = null, ?ResourceInterface $resource = null, $privilege = null) |
|
| 32 | { |
||
| 33 | 2 | if ($resource === null) { |
|
| 34 | return false; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** @var Bookable $bookable */ |
||
| 38 | 2 | $bookable = $resource->getInstance(); |
|
|
|
|||
| 39 | |||
| 40 | 2 | $bookingType = $bookable->getBookingType(); |
|
| 41 | 2 | if ($bookingType === BookingTypeType::ADMIN_APPROVED) { |
|
| 42 | 1 | return true; |
|
| 43 | } |
||
| 44 | |||
| 45 | 1 | return $acl->reject('the booking type for this bookable is not admin approved, but : ' . $bookingType); |
|
| 46 | } |
||
| 48 |
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.