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