1 | <?php |
||
13 | class GoogleSearchMiddleware implements MiddlewareInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var Room |
||
17 | */ |
||
18 | protected $room; |
||
19 | |||
20 | /** |
||
21 | * PingPongMiddleware constructor. |
||
22 | * @param Room $room |
||
23 | */ |
||
24 | public function __construct(Room $room) |
||
28 | |||
29 | /** |
||
30 | * @param Message $message |
||
31 | * @param \Closure $next |
||
32 | * @return string|null |
||
33 | */ |
||
34 | public function handle(Message $message, \Closure $next) |
||
57 | |||
58 | /** |
||
59 | * @param Message $message |
||
60 | * @return \App\User|null |
||
61 | */ |
||
62 | protected function getUserLogin(Message $message) |
||
76 | } |
||
77 | |||
78 |
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.