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 (#198)
by Jérémiah
07:36
created

YamlParser   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 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 5
dl 0
loc 26
ccs 8
cts 8
cp 1
rs 10

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;
20
21
class YamlParser implements ParserInterface
22
{
23
    private static $yamlParser;
24
25
    /**
26
     * @param SplFileInfo      $file
27
     * @param ContainerBuilder $container
28
     *
29
     * @return array
30
     */
31 19
    public static function parse(SplFileInfo $file, ContainerBuilder $container)
32
    {
33 19
        if (null === self::$yamlParser) {
34 1
            self::$yamlParser = new Parser();
35
        }
36
37
        try {
38 19
            $typesConfig = self::$yamlParser->parse($file->getContents());
39 18
            $container->addResource(new FileResource($file->getRealPath()));
40 1
        } catch (ParseException $e) {
41 1
            throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $file), 0, $e);
42
        }
43
44 18
        return $typesConfig;
45
    }
46
}
47