We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 5 |
Paths | 10 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
19 | 2 | public static function parse(SplFileInfo $file, ContainerBuilder $container) |
|
20 | { |
||
21 | 2 | $typesConfig = []; |
|
22 | |||
23 | try { |
||
24 | 2 | $xml = XmlUtils::loadFile($file->getRealPath()); |
|
25 | 1 | foreach ($xml->documentElement->childNodes as $node) { |
|
26 | 1 | if (!$node instanceof \DOMElement) { |
|
27 | 1 | continue; |
|
28 | } |
||
29 | 1 | $values = XmlUtils::convertDomElementToArray($node); |
|
30 | 1 | if (is_array($values)) { |
|
31 | 1 | $typesConfig = array_merge($typesConfig, $values); |
|
32 | } |
||
33 | } |
||
34 | 1 | $container->addResource(new FileResource($file->getRealPath())); |
|
35 | 1 | } catch (\InvalidArgumentException $e) { |
|
36 | 1 | throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e); |
|
37 | } |
||
38 | |||
39 | 1 | return $typesConfig; |
|
40 | } |
||
41 | } |
||
42 |