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.

AbstractIndividualControlGraphQLQueryConfigurator   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 38
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 7

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getIndividualControlEntriesFromDirective() 0 9 4
A getIndividualControlEntriesFromField() 0 10 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\SchemaConfigurators;
6
7
abstract class AbstractIndividualControlGraphQLQueryConfigurator extends AbstractGraphQLQueryConfigurator
8
{
9
    /**
10
     * Create a service configuration entry comprising a field and its value,
11
     * adding an individual schema mode for access control.
12
     * It returns a single array (or null)
13
     *
14
     * @param mixed|null $value
15
     * @return array<array> The list of entries, where an entry is an array
16
     */
17
    protected function getIndividualControlEntriesFromField(string $selectedField, $value, ?string $schemaMode): array
18
    {
19
        $entriesFromField = $this->getEntriesFromField($selectedField, $value);
20
        // Attach the schemaMode to all elements in the array
21
        if (!is_null($schemaMode)) {
22
            foreach ($entriesFromField as &$entryFromField) {
23
                $entryFromField[] = $schemaMode;
24
            }
25
        }
26
        return $entriesFromField;
27
    }
28
    /**
29
     * Create the service configuration entries comprising a directive and its value,
30
     * adding an individual schema mode for access control.
31
     * It returns an array of arrays (or null)
32
     *
33
     * @param mixed $value
34
     * @return array<array> The list of entries, where an entry is an array
35
     */
36
    protected function getIndividualControlEntriesFromDirective(string $selectedDirective, $value, ?string $schemaMode): ?array
37
    {
38
        $entriesForDirective = $this->getEntriesFromDirective($selectedDirective, $value);
39
        if (!is_null($entriesForDirective) && !is_null($schemaMode)) {
40
            foreach ($entriesForDirective as &$entry) {
41
                $entry[] = $schemaMode;
42
            }
43
        }
44
        return $entriesForDirective;
45
    }
46
}
47