| 1 | <?php |
||
| 14 | class MongoQueue implements Queue |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var \MongoClient |
||
| 18 | */ |
||
| 19 | private $mongoClient; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $dbName; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private $collName; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var \MongoCollection |
||
| 33 | */ |
||
| 34 | private $coll; |
||
| 35 | |||
| 36 | 15 | public function __construct(\MongoClient $mongoClient, $dbName, $collName) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | 14 | public function push($item, $eta = null) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | 12 | public function pop() |
|
| 74 | |||
| 75 | /** |
||
| 76 | * {@inheritdoc} |
||
| 77 | */ |
||
| 78 | 1 | public function count() |
|
| 82 | |||
| 83 | /** |
||
| 84 | * {@inheritdoc} |
||
| 85 | */ |
||
| 86 | 1 | public function clear() |
|
| 90 | |||
| 91 | 14 | protected function getCollection() |
|
| 102 | } |
||
| 103 |
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.