| 1 | <?php |
||
| 11 | class Queue extends SplQueue implements QueueInterface, \JsonSerializable |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Adds multiples objects to the end of the Queue. |
||
| 16 | * @param CollectionInterface|array $items The objects to add to the Queue. The value can be null. |
||
| 17 | * @return $this|Queue |
||
| 18 | */ |
||
| 19 | 1 | public function enqueueMultiple($items) |
|
| 27 | |||
| 28 | public static function fromArray(array $arr) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | 2 | public function toArray() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * {@inheritdoc} |
||
| 61 | */ |
||
| 62 | 2 | public function __toString() |
|
| 66 | |||
| 67 | /** |
||
| 68 | * (PHP 5 >= 5.4.0)<br/> |
||
| 69 | * Specify data which should be serialized to JSON |
||
| 70 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
| 71 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
| 72 | * which is a value of any type other than a resource. |
||
| 73 | */ |
||
| 74 | public function jsonSerialize() |
||
| 78 | } |
||
| 79 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.