1 | <?php |
||
13 | class Discovery implements DiscoveryInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $namespace; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $directory; |
||
24 | |||
25 | /** |
||
26 | * @var Reflector |
||
27 | */ |
||
28 | private $reflector; |
||
29 | |||
30 | /** |
||
31 | * The Kernel root directory |
||
32 | * @var string |
||
33 | */ |
||
34 | private $rootDir; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | private $tasks = []; |
||
40 | |||
41 | |||
42 | /** |
||
43 | * WorkerDiscovery constructor. |
||
44 | * |
||
45 | * @param $namespace |
||
46 | * The namespace of the workers |
||
47 | * @param $directory |
||
48 | * The directory of the workers |
||
49 | * @param $rootDir |
||
50 | * @param Reflector $reflector |
||
51 | */ |
||
52 | public function __construct($namespace, $directory, $rootDir, Reflector $reflector) |
||
59 | |||
60 | /** |
||
61 | * Returns all the tasks |
||
62 | * @return array |
||
63 | */ |
||
64 | public function getTasks() |
||
72 | |||
73 | /** |
||
74 | * Discovers tasks |
||
75 | */ |
||
76 | private function discoverTaskTypes() |
||
95 | } |
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.