1 | <?php |
||
13 | class RelativeNamespaceDiscovery extends AbstractClassDiscovery |
||
14 | { |
||
15 | /** |
||
16 | * @var \Composer\Autoload\ClassLoader |
||
17 | */ |
||
18 | protected $classLoader; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $relativeNamespace = ''; |
||
24 | |||
25 | /** |
||
26 | * RelativeNamespaceDiscovery constructor. |
||
27 | * |
||
28 | * @param \Composer\Autoload\ClassLoader $classLoader |
||
29 | */ |
||
30 | public function __construct(ClassLoader $classLoader) |
||
34 | |||
35 | /** |
||
36 | * @param string $relativeNamespace |
||
37 | * |
||
38 | * @return $this |
||
39 | */ |
||
40 | public function setRelativeNamespace($relativeNamespace) |
||
46 | |||
47 | /** |
||
48 | * {@inheritDoc} |
||
49 | */ |
||
50 | public function getClasses() |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function getFile($class) |
||
78 | |||
79 | /** |
||
80 | * @param string|array $directories |
||
81 | * @param string $pattern |
||
82 | * |
||
83 | * @return \Symfony\Component\Finder\Finder |
||
84 | */ |
||
85 | protected function search($directories, $pattern) |
||
94 | |||
95 | /** |
||
96 | * @param string $path |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | protected function convertPathToNamespace($path) |
||
104 | |||
105 | /** |
||
106 | * @param string $namespace |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function convertNamespaceToPath($namespace) |
||
114 | } |
||
115 |
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.