| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 4 | public static function build(): array |
|
| 16 | { |
||
| 17 | return [ |
||
| 18 | 1 | 'name' => 'terminateBooking', |
|
| 19 | 1 | 'type' => Type::nonNull(_types()->getOutput(Booking::class)), |
|
| 20 | 1 | 'description' => 'Terminate a booking', |
|
| 21 | 'args' => [ |
||
| 22 | 1 | 'id' => Type::nonNull(_types()->getId(Booking::class)), |
|
| 23 | 1 | 'comment' => Type::string(), |
|
| 24 | ], |
||
| 25 | 'resolve' => function ($root, array $args, SessionInterface $session): Booking { |
||
|
1 ignored issue
–
show
|
|||
| 26 | /** @var Booking $booking */ |
||
| 27 | 4 | $booking = $args['id']->getEntity(); |
|
| 28 | |||
| 29 | // Check ACL |
||
| 30 | 4 | Helper::throwIfDenied($booking, 'update'); |
|
| 31 | |||
| 32 | 3 | $booking->terminate($args['comment'] ?? null); |
|
| 33 | 3 | _em()->flush(); |
|
| 34 | |||
| 35 | 3 | return $booking; |
|
| 36 | 1 | }, |
|
| 40 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.