1 | <?php |
||
16 | class ConfigReader |
||
17 | { |
||
18 | /** @var ConfigValidator */ |
||
19 | private $validator; |
||
20 | |||
21 | const SCHEMA_LOCATION = __DIR__ . '/../../../phpdeps.xsd'; |
||
22 | |||
23 | public function __construct(ConfigValidator $validator) |
||
27 | |||
28 | /** |
||
29 | * @param string $filePath Path to XML config file |
||
30 | * |
||
31 | * @throws InvalidSchema |
||
32 | * @throws InvalidConfig |
||
33 | * |
||
34 | * @return Config |
||
35 | */ |
||
36 | public function readConfig($filePath) |
||
54 | |||
55 | /** |
||
56 | * @param DOMDocument $document |
||
57 | * |
||
58 | * @throws InvalidSchema |
||
59 | */ |
||
60 | private function validateSchema(DOMDocument $document) |
||
68 | |||
69 | /** |
||
70 | * @param DOMDocument $document |
||
71 | * @param string $dir Absolute path to relative directory |
||
72 | * |
||
73 | * @return Module[] |
||
74 | */ |
||
75 | private function readModules(DOMDocument $document, $dir) |
||
89 | |||
90 | /** |
||
91 | * @param DOMDocument $document |
||
92 | * @param string $dir Absolute path to relative directory |
||
93 | * |
||
94 | * @return ModuleDetector[] |
||
95 | */ |
||
96 | private function readModuleDetectors(DOMDocument $document, $dir) |
||
109 | |||
110 | /** |
||
111 | * @param string $path |
||
112 | * @param string $dir Absolute path to relative directory |
||
113 | * |
||
114 | * @return string |
||
115 | * |
||
116 | * @see https://github.com/sebastianbergmann/phpunit/blob/976b986778e2962577440b93d481e67576124e0d/src/Util/Configuration.php#L1156 |
||
117 | */ |
||
118 | private function toAbsolutePath($path, $dir) |
||
144 | } |
||
145 |