Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function getConfig(\Composer\Package\PackageInterface $package, $configKey) |
||
34 | { |
||
35 | $source = $this->packageInfoResolver->getSourcePath($package) |
||
36 | . DIRECTORY_SEPARATOR |
||
37 | . Config::PACKAGE_CONFIG_FILE; |
||
38 | |||
39 | if (!file_exists($source)) { |
||
40 | return null; |
||
41 | } |
||
42 | |||
43 | $fileContents = $this->configLoader->readToArray($source); |
||
44 | |||
45 | if (!isset($fileContents[$configKey])) { |
||
46 | return null; |
||
47 | } |
||
48 | |||
49 | return $fileContents[$configKey]; |
||
50 | } |
||
52 |