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 | 3 | public function assert(Acl $acl, ?RoleInterface $role = null, ?ResourceInterface $resource = null, $privilege = null) |
|
32 | { |
||
33 | /** @var Booking $booking */ |
||
34 | 3 | $booking = $resource->getInstance(); |
|
35 | |||
36 | 3 | if (!$booking->getBookable()) { |
|
37 | return true; |
||
38 | } |
||
39 | |||
40 | 3 | $bookingType = $booking->getBookable()->getBookingType(); |
|
41 | 3 | if ($bookingType === BookingTypeType::SELF_APPROVED) { |
|
42 | 1 | return true; |
|
43 | } |
||
44 | |||
45 | 2 | return $acl->reject('the booking type for this booking is not self 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.