| Conditions | 2 |
| Paths | 2 |
| Total Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 2 | public function process(ServerRequestInterface $req, RequestHandlerInterface $handler): ResponseInterface |
|
| 44 | {
|
||
| 45 | 2 | $pipe = clone $this; |
|
| 46 | 2 | $pipe->stack[] = $handler instanceof MiddlewareInterface ? $handler : new HandlerMiddleware($handler); |
|
| 47 | 2 | return $pipe->handle($req); |
|
| 48 | } |
||
| 49 | } |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.