| 1 | <?php |
||
| 15 | class FilteredContainer implements ContainerInterface |
||
| 16 | { |
||
| 17 | /** @var FilteredContainerInterface */ |
||
| 18 | private $container; |
||
| 19 | /** @var ItemInterface[] */ |
||
| 20 | private $items; |
||
| 21 | |||
| 22 | public function __construct(FilteredContainerInterface $container) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return ItemInterface[] |
||
| 29 | */ |
||
| 30 | public function getItems(): array |
||
| 39 | |||
| 40 | public function get(string $name): ItemInterface |
||
| 44 | } |
||
| 45 |
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.