1 | <?php |
||
22 | abstract class AbstractAnnotationDriver implements DriverInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var Reader |
||
26 | */ |
||
27 | protected $reader; |
||
28 | |||
29 | /** |
||
30 | * The paths where to look for mapping files. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $paths = []; |
||
35 | |||
36 | /** |
||
37 | * The paths excluded from path where to look for mapping files. |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $excludePaths = []; |
||
42 | |||
43 | /** |
||
44 | * The file extension of mapping documents. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $fileExtension = '.php'; |
||
49 | |||
50 | /** |
||
51 | * @var array|null |
||
52 | */ |
||
53 | protected $classNames; |
||
54 | |||
55 | /** |
||
56 | * AbstractAnnotationDriver constructor. |
||
57 | * |
||
58 | * @param Reader $reader |
||
59 | * @param array $paths |
||
60 | */ |
||
61 | public function __construct(Reader $reader, array $paths = array()) |
||
66 | |||
67 | /** |
||
68 | * @param array $paths |
||
69 | */ |
||
70 | public function addPaths(array $paths) |
||
74 | |||
75 | /** |
||
76 | * @param array $paths |
||
77 | */ |
||
78 | public function addExcludePaths(array $paths) |
||
82 | |||
83 | /** |
||
84 | * @return array |
||
85 | */ |
||
86 | public function excludePaths() |
||
90 | |||
91 | /** |
||
92 | * @param string $fileExtension |
||
93 | */ |
||
94 | public function setFileExtension($fileExtension) |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | public function getAllClassNames() |
||
155 | } |
||
156 |
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.