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 (#390)
by Jérémiah
18:53
created

ValidateCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 86.96%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 43
ccs 20
cts 23
cp 0.8696
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A configure() 0 13 1
A execute() 0 16 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Command;
6
7
use GraphQL\Error\InvariantViolation;
8
use GraphQL\Error\Warning;
9
use Overblog\GraphQLBundle\Resolver\TypeResolver;
10
use Symfony\Component\Console\Command\Command;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Input\InputOption;
13
use Symfony\Component\Console\Output\OutputInterface;
14
15
final class ValidateCommand extends Command
16
{
17
    use RequestExecutorLazyLoaderTrait;
18
19
    private $typeResolver;
20
21 1
    public function __construct(TypeResolver $typeResolver)
22
    {
23 1
        parent::__construct();
24 1
        $this->typeResolver = $typeResolver;
25 1
    }
26
27 1
    protected function configure(): void
28
    {
29
        $this
30 1
            ->setName('graphql:validate')
31 1
            ->setDescription('Validate schema')
32 1
            ->addOption(
33 1
                'schema',
34 1
                null,
35 1
                InputOption::VALUE_OPTIONAL,
36 1
                'The schema name to validate.'
37
            )
38
        ;
39 1
    }
40
41 1
    protected function execute(InputInterface $input, OutputInterface $output): void
42
    {
43 1
        Warning::suppress(true);
44
45 1
        $schemaName = $input->getOption('schema');
46 1
        $schema = $this->getRequestExecutor()->getSchema($schemaName);
47
48
        try {
49 1
            $schema->assertValid();
50
        } catch (InvariantViolation $e) {
0 ignored issues
show
Bug introduced by
The class GraphQL\Error\InvariantViolation does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
51
            $output->writeln('<comment>'.$e->getMessage().'</comment>');
52
53
            return;
54
        }
55 1
        $output->writeln('<info>No error</info>');
56 1
    }
57
}
58