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 | 2 | public static function parse(SplFileInfo $file, ContainerBuilder $container) |
|
| 29 | { |
||
| 30 | 2 | $typesConfig = []; |
|
| 31 | |||
| 32 | try { |
||
| 33 | //@todo fix xml validateSchema |
||
| 34 | 2 | $xml = XmlUtils::loadFile($file->getRealPath()); |
|
| 35 | 1 | foreach ($xml->documentElement->childNodes as $node) { |
|
| 36 | 1 | if (!$node instanceof \DOMElement) { |
|
| 37 | 1 | continue; |
|
| 38 | } |
||
| 39 | 1 | $values = XmlUtils::convertDomElementToArray($node); |
|
| 40 | 1 | $typesConfig = array_merge($typesConfig, $values); |
|
| 41 | 1 | } |
|
| 42 | 1 | $container->addResource(new FileResource($file->getRealPath())); |
|
| 43 | 2 | } catch (\InvalidArgumentException $e) { |
|
| 44 | 1 | throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e); |
|
| 45 | } |
||
| 46 | |||
| 47 | 1 | return $typesConfig; |
|
| 48 | } |
||
| 49 | } |
||
| 50 |