1 | <?php |
||
20 | class DefaultFileLocator implements FileLocatorInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $paths = []; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $prefixes = []; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $separator; |
||
36 | |||
37 | /** |
||
38 | * Constructor. |
||
39 | * |
||
40 | * @param array $prefixes |
||
41 | * @param string $separator |
||
42 | */ |
||
43 | public function __construct(array $prefixes, $separator = '.') |
||
52 | |||
53 | /** |
||
54 | * Adds Namespace Prefixes. |
||
55 | * |
||
56 | * @param array $prefixes |
||
57 | */ |
||
58 | public function addNamespacePrefixes(array $prefixes) |
||
63 | |||
64 | /** |
||
65 | * @return array |
||
66 | */ |
||
67 | public function prefixes() |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function paths() |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function getAllClassNames($extension) |
||
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | public function findMappingFile($className, $extension) |
||
141 | } |
||
142 |
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.