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.
Passed
Push — master ( 6f9d65...c30996 )
by Leonardo
02:49
created

isEnabledByDefault()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 0
cts 7
cp 0
crap 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\ModuleResolvers;
6
7
use GraphQLAPI\GraphQLAPI\Plugin;
8
use GraphQLAPI\GraphQLAPI\ModuleResolvers\ModuleResolverTrait;
9
10
class VersioningFunctionalityModuleResolver extends AbstractFunctionalityModuleResolver
11
{
12
    use ModuleResolverTrait;
13
14
    public const FIELD_DEPRECATION = Plugin::NAMESPACE . '\field-deprecation';
15
16
    public static function getModulesToResolve(): array
17
    {
18
        return [
19
            self::FIELD_DEPRECATION,
20
        ];
21
    }
22
23
    public function getDependedModuleLists(string $module): array
24
    {
25
        switch ($module) {
26
            case self::FIELD_DEPRECATION:
27
                return [
28
                    [
29
                        FunctionalityModuleResolver::SCHEMA_CONFIGURATION,
30
                    ],
31
                ];
32
        }
33
        return parent::getDependedModuleLists($module);
34
    }
35
36
    public function getName(string $module): string
37
    {
38
        $names = [
39
            self::FIELD_DEPRECATION => \__('Field Deprecation', 'graphql-api'),
40
        ];
41
        return $names[$module] ?? $module;
42
    }
43
44
    public function getDescription(string $module): string
45
    {
46
        switch ($module) {
47
            case self::FIELD_DEPRECATION:
48
                return \__('Deprecate fields, and explain how to replace them, through a user interface', 'graphql-api');
49
        }
50
        return parent::getDescription($module);
51
    }
52
53
    public function isEnabledByDefault(string $module): bool
54
    {
55
        switch ($module) {
56
            case self::FIELD_DEPRECATION:
57
                return false;
58
        }
59
        return parent::isEnabledByDefault($module);
60
    }
61
}
62