1 | <?php |
||
13 | class Filter |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $typeCache = []; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $filters = []; |
||
24 | |||
25 | /** |
||
26 | * Checks wether an path is of the correct type, dir or file |
||
27 | * |
||
28 | * @param string $type |
||
29 | * @param string $path |
||
30 | * |
||
31 | * @return boolean |
||
32 | */ |
||
33 | public function isCorrectType($type, $path) |
||
47 | |||
48 | /** |
||
49 | * Filters a batch of filesystem entries |
||
50 | * |
||
51 | * @param array $contents |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | public function filter(array $contents) |
||
82 | |||
83 | /** |
||
84 | * Adds a filter |
||
85 | * |
||
86 | * @param string $filter |
||
87 | * @param boolean $expected |
||
88 | * @param string $type |
||
89 | */ |
||
90 | public function addFilter($filter, $expected = true, $type = null) |
||
100 | |||
101 | /** |
||
102 | * Ensures an extension |
||
103 | * |
||
104 | * @param string $extension |
||
105 | */ |
||
106 | public function hasExtension($extension) |
||
112 | |||
113 | /** |
||
114 | * Blocks by extension |
||
115 | * |
||
116 | * @param string $extension |
||
117 | */ |
||
118 | public function blockExtension($extension) |
||
124 | |||
125 | /** |
||
126 | * Blocks hidden files |
||
127 | * |
||
128 | * @param string $type |
||
129 | */ |
||
130 | public function blockHidden($type = null) |
||
136 | |||
137 | /** |
||
138 | * Allows only hidden files |
||
139 | * |
||
140 | * @param string $type |
||
141 | */ |
||
142 | public function isHidden($type = null) |
||
148 | } |
||
149 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.