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.

ModuleTypeResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 37
dl 0
loc 50
ccs 0
cts 5
cp 0
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getModuleTypesToResolve() 0 14 1
A getName() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\ModuleTypeResolvers;
6
7
use GraphQLAPI\GraphQLAPI\Plugin;
8
use GraphQLAPI\GraphQLAPI\ModuleTypeResolvers\AbstractModuleTypeResolver;
9
10
/**
11
 * All module types used in this plugin. Others can be registered by extensions
12
 */
13
class ModuleTypeResolver extends AbstractModuleTypeResolver
14
{
15
    public const ACCESS_CONTROL = Plugin::NAMESPACE . '\access-control';
16
    public const CLIENT = Plugin::NAMESPACE . '\client';
17
    public const ENDPOINT = Plugin::NAMESPACE . '\endpoint';
18
    public const FUNCTIONALITY = Plugin::NAMESPACE . '\functionality';
19
    public const OPERATIONAL = Plugin::NAMESPACE . '\operational';
20
    public const PERFORMANCE = Plugin::NAMESPACE . '\performance';
21
    public const PLUGIN_MANAGEMENT = Plugin::NAMESPACE . '\plugin-management';
22
    public const SCHEMA_CONFIGURATION = Plugin::NAMESPACE . '\schema-configuration';
23
    public const SCHEMA_TYPE = Plugin::NAMESPACE . '\schema-type';
24
    public const USER_INTERFACE = Plugin::NAMESPACE . '\user-interface';
25
    public const VERSIONING = Plugin::NAMESPACE . '\versioning';
26
27
    /**
28
     * @return string[]
29
     */
30
    public static function getModuleTypesToResolve(): array
31
    {
32
        return [
33
            self::ACCESS_CONTROL,
34
            self::CLIENT,
35
            self::ENDPOINT,
36
            self::FUNCTIONALITY,
37
            self::OPERATIONAL,
38
            self::PERFORMANCE,
39
            self::PLUGIN_MANAGEMENT,
40
            self::SCHEMA_CONFIGURATION,
41
            self::SCHEMA_TYPE,
42
            self::USER_INTERFACE,
43
            self::VERSIONING,
44
        ];
45
    }
46
47
    public function getName(string $moduleType): string
48
    {
49
        $names = [
50
            self::ACCESS_CONTROL => \__('Access Control', 'graphql-api'),
51
            self::CLIENT => \__('Client', 'graphql-api'),
52
            self::ENDPOINT => \__('Endpoint', 'graphql-api'),
53
            self::FUNCTIONALITY => \__('Functionality', 'graphql-api'),
54
            self::OPERATIONAL => \__('Operational', 'graphql-api'),
55
            self::PERFORMANCE => \__('Performance', 'graphql-api'),
56
            self::PLUGIN_MANAGEMENT => \__('Plugin Management', 'graphql-api'),
57
            self::SCHEMA_CONFIGURATION => \__('Schema Configuration', 'graphql-api'),
58
            self::SCHEMA_TYPE => \__('Schema Type', 'graphql-api'),
59
            self::USER_INTERFACE => \__('User Interface', 'graphql-api'),
60
            self::VERSIONING => \__('Versioning', 'graphql-api'),
61
        ];
62
        return $names[$moduleType] ?? '';
63
    }
64
}
65