| Conditions | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | private function mockHandler(callable $assertion = null): RequestHandlerInterface |
||
| 14 | { |
||
| 15 | return new class($assertion) implements RequestHandlerInterface |
||
| 16 | { |
||
| 17 | /** @var callable */ |
||
| 18 | private $assertion; |
||
| 19 | |||
| 20 | public function __construct(?callable $assertion) |
||
| 21 | { |
||
| 22 | $this->assertion = $assertion ?? function ($request) { |
||
|
|
|||
| 23 | return true; |
||
| 24 | }; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function handle(ServerRequestInterface $request): ResponseInterface |
||
| 28 | { |
||
| 29 | return new Response(($this->assertion)($request) ? 200 : 400); |
||
| 30 | } |
||
| 34 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.