1 | <?php |
||
9 | class HandlerAggregate implements \IteratorAggregate |
||
10 | { |
||
11 | protected $handlers = []; |
||
12 | |||
13 | /** |
||
14 | * Adds a handler on the aggregate |
||
15 | * |
||
16 | * @param string $selector |
||
17 | * @param Handler $handler |
||
18 | * @return $this |
||
19 | 2 | */ |
|
20 | public function addHandler($selector, Handler $handler) |
||
26 | |||
27 | /** |
||
28 | * Processes |
||
29 | * @param $files |
||
30 | * @return Collection |
||
31 | 1 | */ |
|
32 | public function process($files) |
||
52 | |||
53 | /** |
||
54 | * Retrieve an external iterator |
||
55 | * |
||
56 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
57 | * @return \Traversable An instance of an object implementing <b>Iterator</b> or |
||
58 | * <b>Traversable</b> |
||
59 | */ |
||
60 | 1 | public function getIterator() |
|
64 | } |
||
65 |
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.