1 | <?php |
||
20 | class SimpleFileBackend implements StatisticsInterface |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * Get the number of entries |
||
25 | * |
||
26 | * @param Cache $cache |
||
27 | * |
||
28 | * @return int |
||
29 | */ |
||
30 | public function countEntries(Cache $cache) |
||
34 | |||
35 | /** |
||
36 | * Get the size of the cache in byte |
||
37 | * |
||
38 | * @param Cache $cache |
||
39 | * |
||
40 | * @return float |
||
41 | */ |
||
42 | public function getSize(Cache $cache) |
||
50 | |||
51 | /** |
||
52 | * Get the number of tags |
||
53 | * |
||
54 | * @param Cache $cache |
||
55 | * |
||
56 | * @return int |
||
57 | */ |
||
58 | public function countTags(Cache $cache) |
||
62 | |||
63 | /** |
||
64 | * Get the foldersize |
||
65 | * |
||
66 | * @param string $path |
||
67 | * |
||
68 | * @return int |
||
69 | */ |
||
70 | protected function getFolderSize($path) |
||
87 | |||
88 | /** |
||
89 | * Get the cache directory |
||
90 | * |
||
91 | * @param Cache $cache |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | protected function getCacheDirectory(Cache $cache) |
||
100 | |||
101 | /** |
||
102 | * Returns the age of found entries in seconds |
||
103 | * |
||
104 | * @param Cache $cache |
||
105 | * |
||
106 | * @return int|null |
||
107 | */ |
||
108 | public function getAge(Cache $cache) |
||
119 | |||
120 | /** |
||
121 | * Returns the left lifetime of the cache entry |
||
122 | * |
||
123 | * @param Cache $cache |
||
124 | * |
||
125 | * @return int|null |
||
126 | */ |
||
127 | public function getExpires(Cache $cache) |
||
131 | } |
||
132 |
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.