We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 4 |
Paths | 7 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
28 | 3 | public static function parse(SplFileInfo $file, ContainerBuilder $container) |
|
29 | { |
||
30 | 3 | $typesConfig = []; |
|
31 | |||
32 | try { |
||
33 | //@todo fix xml validateSchema |
||
34 | 3 | $xml = XmlUtils::loadFile($file->getRealPath()); |
|
35 | 2 | foreach ($xml->documentElement->childNodes as $node) { |
|
36 | 2 | if (!$node instanceof \DOMElement) { |
|
37 | 2 | continue; |
|
38 | } |
||
39 | 2 | $values = XmlUtils::convertDomElementToArray($node); |
|
40 | 2 | $typesConfig = array_merge($typesConfig, $values); |
|
41 | 2 | } |
|
42 | 2 | $container->addResource(new FileResource($file->getRealPath())); |
|
43 | 3 | } catch (\InvalidArgumentException $e) { |
|
44 | 1 | throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e); |
|
45 | } |
||
46 | |||
47 | 2 | return $typesConfig; |
|
48 | } |
||
49 | } |
||
50 |