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

getCustomPostID()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 3
eloc 4
c 2
b 0
f 0
nc 3
nop 0
dl 0
loc 8
ccs 0
cts 5
cp 0
crap 12
rs 10
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