1 | <?php |
||
29 | class ConfigReader { |
||
30 | |||
31 | /** @var array Associative array ($key => $value) */ |
||
32 | protected $cache = []; |
||
33 | |||
34 | /** |
||
35 | * @var OccRunner $occRunner |
||
36 | */ |
||
37 | protected $occRunner; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | protected $isLoaded = false; |
||
43 | |||
44 | /** |
||
45 | * |
||
46 | * @param OccRunner $occRunner |
||
47 | */ |
||
48 | 1 | public function __construct(OccRunner $occRunner){ |
|
51 | |||
52 | 1 | public function init(){ |
|
55 | |||
56 | /** |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function getIsLoaded(){ |
||
62 | |||
63 | /** |
||
64 | * Get a value from OC config by |
||
65 | * path key1.key2.key3 |
||
66 | * @param string $path |
||
67 | * @return mixed |
||
68 | */ |
||
69 | 1 | public function getByPath($path){ |
|
72 | |||
73 | /** |
||
74 | * Get a value from OC config by keys |
||
75 | * @param array $keys |
||
76 | * @return mixed |
||
77 | */ |
||
78 | 1 | public function get($keys){ |
|
92 | |||
93 | /** |
||
94 | * Get OC Edition |
||
95 | * @return string |
||
96 | * @throws \Symfony\Component\Process\Exception\ProcessFailedException |
||
97 | */ |
||
98 | public function getEdition(){ |
||
102 | |||
103 | /** |
||
104 | * Export OC config as JSON and parse it into the cache |
||
105 | * @throws \Symfony\Component\Process\Exception\ProcessFailedException |
||
106 | * @throws \UnexpectedValueException |
||
107 | */ |
||
108 | 1 | private function load(){ |
|
112 | |||
113 | } |
||
114 |
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.