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.

getIndividualControlEntriesFromDirective()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

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