1 | <?php |
||
17 | abstract class AbstractIo implements IoInterface |
||
18 | { |
||
19 | /** |
||
20 | * Socket buffer size |
||
21 | */ |
||
22 | const SOCKET_BUFFER_SIZE = 8192; |
||
23 | |||
24 | /** |
||
25 | * Amount of attempts to set data |
||
26 | */ |
||
27 | const IO_ATTEMPTS = 10; |
||
28 | |||
29 | /** |
||
30 | * Socket |
||
31 | * |
||
32 | * @var SocketInterface |
||
33 | */ |
||
34 | protected $socket; |
||
35 | |||
36 | /** |
||
37 | * AbstractIo constructor. |
||
38 | * |
||
39 | * @param SocketInterface $socket Socket object |
||
40 | */ |
||
41 | 198 | public function __construct(SocketInterface $socket) |
|
45 | |||
46 | /** |
||
47 | * Return last php error message as string |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 3 | protected function getLastPhpErrorMessage() |
|
62 | } |
||
63 |
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.