1 | <?php |
||
14 | class SysVQueue implements Queue |
||
15 | { |
||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $key; |
||
20 | |||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | private $serialize; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | private $perms = 0666; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | private $itemMaxLength = 8192; |
||
35 | |||
36 | /** |
||
37 | * @var resource |
||
38 | */ |
||
39 | private $queue; |
||
40 | |||
41 | 33 | public function __construct($key, $serialize = null, $perms = null) |
|
50 | |||
51 | 1 | public function setItemMaxLength($length) |
|
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 25 | public function push($item, $eta = null) |
|
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 21 | public function pop() |
|
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | 7 | public function count() |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | 3 | public function clear() |
|
107 | |||
108 | 32 | private function getQueue() |
|
120 | |||
121 | 6 | private static function getErrorMessage($errorCode) |
|
134 | } |
||
135 |
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.