1 | <?php |
||
16 | class ConfigLocator |
||
17 | { |
||
18 | /** @var Composer */ |
||
19 | private $composer; |
||
20 | |||
21 | /** @var array */ |
||
22 | public $cache = []; |
||
23 | |||
24 | /** |
||
25 | * @param Composer $composer |
||
26 | */ |
||
27 | 20 | public function __construct(Composer $composer) |
|
31 | |||
32 | /** |
||
33 | * @param string $key |
||
34 | * |
||
35 | * @return array |
||
36 | */ |
||
37 | 20 | public function getConfig($key) |
|
43 | |||
44 | /** |
||
45 | * @param string $key |
||
46 | * |
||
47 | * @return string|null mixed |
||
48 | */ |
||
49 | 20 | public function getPath($key) |
|
55 | |||
56 | /** |
||
57 | * Try to locate where is the config for the given key. |
||
58 | * |
||
59 | * @param string $key |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | 20 | public function locate($key) |
|
85 | |||
86 | /** |
||
87 | * Search config in the local root package. |
||
88 | * |
||
89 | * @param string $key |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | 20 | private function locateLocal($key) |
|
118 | |||
119 | /** |
||
120 | * Search config in the global root package. |
||
121 | * |
||
122 | * @param string $key |
||
123 | * |
||
124 | * @return bool |
||
125 | */ |
||
126 | 18 | private function locateGlobal($key) |
|
148 | } |
||
149 |