1 | <?php |
||
22 | class SourceManager implements SourceIteratorInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var \ArrayIterator |
||
26 | */ |
||
27 | protected $sources; |
||
28 | |||
29 | /** |
||
30 | * Constructor. |
||
31 | */ |
||
32 | public function __construct() |
||
33 | { |
||
34 | $this->sources = new \ArrayIterator(); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Adding source with his group. |
||
39 | * |
||
40 | * @param string $group |
||
41 | * @param SourceIteratorInterface $source |
||
42 | * @param array $types |
||
43 | */ |
||
44 | public function addSource($group, SourceIteratorInterface $source, array $types = array()) |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function current() |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function next() |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function key() |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function valid() |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function rewind() |
||
99 | } |
||
100 |
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.