Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#137)
by Jérémiah
08:18
created

YmlParser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 5
dl 0
loc 26
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 15 3
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Config\Parser;
13
14
use Symfony\Component\Config\Resource\FileResource;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
17
use Symfony\Component\Finder\SplFileInfo;
18
use Symfony\Component\Yaml\Exception\ParseException;
19
use Symfony\Component\Yaml\Parser as YamlParser;
20
21
class YmlParser implements ParserInterface
22
{
23
    private static $yamlParser;
24
25
    /**
26
     * @param SplFileInfo      $file
27
     * @param ContainerBuilder $container
28
     *
29
     * @return array
30
     */
31 72
    public static function parse(SplFileInfo $file, ContainerBuilder $container)
32
    {
33 72
        if (null === self::$yamlParser) {
34 1
            self::$yamlParser = new YamlParser();
35 1
        }
36
37
        try {
38 72
            $typesConfig = self::$yamlParser->parse($file->getContents());
39 71
            $container->addResource(new FileResource($file->getRealPath()));
40 72
        } catch (ParseException $e) {
41 1
            throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $file), 0, $e);
42
        }
43
44 71
        return $typesConfig;
45
    }
46
}
47