Passed
Pull Request — master (#9)
by Quang
02:11
created

UpdateSchemaLockCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\Lumen\GraphQL\Commands;
4
5
use Digia\Lumen\GraphQL\Helpers\JsonEncoder;
6
use Digia\Lumen\GraphQL\GraphQLService;
7
use Digia\Lumen\GraphQL\LockFile;
8
use Illuminate\Console\Command;
9
use Jalle19\Laravel\LostInterfaces\Console\Command as CommandInterface;
10
11
/**
12
 * Class UpdateSchemaLockCommand
13
 * @package Digia\Lumen\GraphQL\Commands
14
 */
15
class UpdateSchemaLockCommand extends Command implements CommandInterface
16
{
17
18
    /**
19
     * @var string
20
     */
21
    protected $signature = 'graphql:schema:lock:update';
22
23
    /**
24
     * @var string
25
     */
26
    protected $description = 'Updates the schema.lock file';
27
28
    /**
29
     * @var GraphQLService
30
     */
31
    private $graphQlService;
32
33
    /**
34
     * UpdateSchemaLockCommand constructor.
35
     *
36
     * @param GraphQLService $graphQlService
37
     */
38
    public function __construct(GraphQLService $graphQlService)
39
    {
40
        parent::__construct();
41
42
        $this->graphQlService = $graphQlService;
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48
    public function handle()
49
    {
50
        $response = $this->graphQlService->getIntrospectionQueryResponse();
0 ignored issues
show
Bug introduced by
The method getIntrospectionQueryResponse() does not exist on Digia\Lumen\GraphQL\GraphQLService. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

50
        /** @scrutinizer ignore-call */ 
51
        $response = $this->graphQlService->getIntrospectionQueryResponse();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
51
52
        file_put_contents(LockFile::getAbsolutePath(), JsonEncoder::encode($response));
53
    }
54
}
55