| 1 | <?php |
||
| 22 | final class MiddlewareHandler implements Handler |
||
| 23 | { |
||
| 24 | private $middleware; |
||
| 25 | private $handler; |
||
| 26 | private $connection; |
||
| 27 | private $packer; |
||
| 28 | |||
| 29 | 2 | public function __construct(Middleware $middleware, Handler $handler) |
|
| 34 | |||
| 35 | 52 | public static function create(Handler $handler, array $middlewares) : Handler |
|
| 50 | |||
| 51 | 2 | public function getConnection() : Connection |
|
| 55 | |||
| 56 | public function getPacker() : Packer |
||
| 60 | |||
| 61 | 2 | public function handle(Request $request) : Response |
|
| 65 | } |
||
| 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.