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
Push — master ( 4b9dd3...0fc96b )
by Jérémiah
19:14
created

ValidateCommand::getRequestExecutor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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\Request\Executor as RequestExecutor;
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
    /** @var RequestExecutor */
18
    private $requestExecutor;
19
20 2
    public function __construct(RequestExecutor $requestExecutor)
21
    {
22 2
        parent::__construct();
23 2
        $this->requestExecutor = $requestExecutor;
24 2
    }
25
26 1
    public function setRequestExecutor(RequestExecutor $requestExecutor): void
27
    {
28 1
        $this->requestExecutor = $requestExecutor;
29 1
    }
30
31 2
    public function getRequestExecutor(): RequestExecutor
32
    {
33 2
        return $this->requestExecutor;
34
    }
35
36 2
    protected function configure(): void
37
    {
38
        $this
39 2
            ->setName('graphql:validate')
40 2
            ->setDescription('Validate schema')
41 2
            ->addOption(
42 2
                'schema',
43 2
                null,
44 2
                InputOption::VALUE_OPTIONAL,
45 2
                'The schema name to validate.'
46
            )
47
        ;
48 2
    }
49
50 2
    protected function execute(InputInterface $input, OutputInterface $output): void
51
    {
52 2
        Warning::suppress(true);
53
54 2
        $schemaName = $input->getOption('schema');
55 2
        $schema = $this->getRequestExecutor()->getSchema($schemaName);
56
57
        try {
58 2
            $schema->assertValid();
59 1
        } 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...
60 1
            $output->writeln('<comment>'.$e->getMessage().'</comment>');
61
62 1
            return;
63
        }
64 1
        $output->writeln('<info>No error</info>');
65 1
    }
66
}
67