| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public static function create(Handler $handler, array $middlewares) : Handler |
||
| 36 | { |
||
| 37 | if (!$middlewares) { |
||
|
|
|||
| 38 | return $handler; |
||
| 39 | } |
||
| 40 | |||
| 41 | $middleware = \end($middlewares); |
||
| 42 | |||
| 43 | while ($middleware) { |
||
| 44 | $handler = new self($middleware, $handler); |
||
| 45 | $middleware = \prev($middlewares); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $handler; |
||
| 49 | } |
||
| 66 |
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.