GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d245d8...82e8c7 )
by Leonardo
10:28
created

EditingPersistedQuerySchemaConfiguratorExecuter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 18
ccs 0
cts 7
cp 0
rs 10
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCustomPostID() 0 8 3
A getSchemaConfigurator() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\SchemaConfiguratorExecuters;
6
7
use GraphQLAPI\GraphQLAPI\General\EndpointHelpers;
8
use GraphQLAPI\GraphQLAPI\General\RequestParams;
9
use GraphQLAPI\GraphQLAPI\SchemaConfigurators\SchemaConfiguratorInterface;
10
use GraphQLAPI\GraphQLAPI\SchemaConfigurators\PersistedQuerySchemaConfigurator;
11
12
class EditingPersistedQuerySchemaConfiguratorExecuter extends AbstractSchemaConfiguratorExecuter
13
{
14
    /**
15
     * Initialize the configuration if editing a persisted query
16
     */
17
    protected function getCustomPostID(): ?int
18
    {
19
        if (EndpointHelpers::isRequestingAdminGraphQLEndpoint()) {
20
            if ($customPostID = $_REQUEST[RequestParams::PERSISTED_QUERY_ID]) {
21
                return (int)$customPostID;
22
            }
23
        }
24
        return null;
25
    }
26
27
    protected function getSchemaConfigurator(): SchemaConfiguratorInterface
28
    {
29
        return new PersistedQuerySchemaConfigurator();
30
    }
31
}
32