| 1 | <?php |
||
| 8 | class CacheDecorator |
||
| 9 | { |
||
| 10 | private $repository; |
||
| 11 | private $cacheRepository; |
||
| 12 | private static $allColumnsHashes = []; // Static is not a good idea |
||
| 13 | |||
| 14 | public function __construct(IRepository $repository, IRepository $cacheRepository) |
||
| 19 | |||
| 20 | private function getHash(string $id, string $class): string |
||
| 24 | |||
| 25 | public function find(string $id, string $class, array $columns = []): ?Storable |
||
| 47 | } |
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.