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 ( f06828...aea366 )
by Leonardo
08:36
created

OperationalFunctionalityModuleResolver::getSettings()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 12
nc 2
nop 1
dl 0
loc 18
ccs 0
cts 17
cp 0
crap 6
rs 9.8666
c 0
b 0
f 0
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 OperationalFunctionalityModuleResolver extends AbstractFunctionalityModuleResolver
11
{
12
    use ModuleResolverTrait;
13
14
    public const MULTIPLE_QUERY_EXECUTION = Plugin::NAMESPACE . '\multiple-query-execution';
15
    public const REMOVE_IF_NULL_DIRECTIVE = Plugin::NAMESPACE . '\remove-if-null-directive';
16
    public const PROACTIVE_FEEDBACK = Plugin::NAMESPACE . '\proactive-feedback';
17
18
    public static function getModulesToResolve(): array
19
    {
20
        return [
21
            self::MULTIPLE_QUERY_EXECUTION,
22
            self::REMOVE_IF_NULL_DIRECTIVE,
23
            self::PROACTIVE_FEEDBACK,
24
        ];
25
    }
26
27
    /**
28
     * Enable to customize a specific UI for the module
29
     */
30
    public function getModuleSubtype(string $module): ?string
31
    {
32
        return 'pioneering';
33
    }
34
35
    public function getDependedModuleLists(string $module): array
36
    {
37
        switch ($module) {
38
            case self::MULTIPLE_QUERY_EXECUTION:
39
                return [
40
                    [
41
                        EndpointFunctionalityModuleResolver::PERSISTED_QUERIES,
42
                        EndpointFunctionalityModuleResolver::SINGLE_ENDPOINT,
43
                        EndpointFunctionalityModuleResolver::CUSTOM_ENDPOINTS,
44
                    ],
45
                ];
46
            case self::REMOVE_IF_NULL_DIRECTIVE:
47
            case self::PROACTIVE_FEEDBACK:
48
                return [];
49
        }
50
        return parent::getDependedModuleLists($module);
51
    }
52
53
    public function getName(string $module): string
54
    {
55
        $names = [
56
            self::MULTIPLE_QUERY_EXECUTION => \__('Multiple Query Execution', 'graphql-api'),
57
            self::REMOVE_IF_NULL_DIRECTIVE => \__('Remove if Null', 'graphql-api'),
58
            self::PROACTIVE_FEEDBACK => \__('Proactive Feedback', 'graphql-api'),
59
        ];
60
        return $names[$module] ?? $module;
61
    }
62
63
    public function getDescription(string $module): string
64
    {
65
        switch ($module) {
66
            case self::MULTIPLE_QUERY_EXECUTION:
67
                return \__('Execute multiple GraphQL queries in a single operation', 'graphql-api');
68
            case self::REMOVE_IF_NULL_DIRECTIVE:
69
                return \__('Addition of <code>@removeIfNull</code> directive, to remove an output from the response if it is <code>null</code>', 'graphql-api');
70
            case self::PROACTIVE_FEEDBACK:
71
                return \__('Usage of the top-level entry <code>extensions</code> to send deprecations, warnings, logs, notices and traces in the response to the query', 'graphql-api');
72
        }
73
        return parent::getDescription($module);
74
    }
75
76
    public function isEnabledByDefault(string $module): bool
77
    {
78
        switch ($module) {
79
            case self::MULTIPLE_QUERY_EXECUTION:
80
            case self::REMOVE_IF_NULL_DIRECTIVE:
81
                return false;
82
        }
83
        return parent::isEnabledByDefault($module);
84
    }
85
}
86