Conditions | 4 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.3731 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 1 | public function assert(Acl $acl, ?RoleInterface $role = null, ?ResourceInterface $resource = null, $privilege = null) |
|
33 | 1 | { |
|
34 | /** @var Booking $booking */ |
||
35 | $booking = $resource->getInstance(); |
||
36 | |||
37 | 1 | $bookable = $booking->getBookable(); |
|
38 | 1 | if (!$bookable) { |
|
39 | 1 | return false; |
|
40 | } |
||
41 | |||
42 | $bookingType = $bookable->getBookingType(); |
||
43 | if ($booking->getStatus() === BookingStatusType::APPLICATION && in_array($bookingType, [BookingTypeType::APPLICATION, BookingTypeType::ADMIN_APPROVED], true)) { |
||
44 | return true; |
||
45 | } |
||
46 | |||
47 | return $acl->reject('you cannot delete a processed application'); |
||
48 | } |
||
50 |
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.