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.

ApplicationStateHooks::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 0
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\Hooks;
6
7
use PoP\Hooks\AbstractHookSet;
8
9
class ApplicationStateHooks extends AbstractHookSet
10
{
11
    protected function init()
12
    {
13
        // ----------------------------------------
14
        // Commented, since `is_admin` is added to
15
        // `CacheConfigurationManager.getNamespace()`
16
        // ----------------------------------------
17
        // $this->hooksAPI->addFilter(
18
        //     ModelInstance::HOOK_COMPONENTSFROMVARS_RESULT,
19
        //     [$this, 'addComponent']
20
        // );
21
        // ----------------------------------------
22
    }
23
    /**
24
     * Admin and non-admin have different schemas
25
     *
26
     * @param string[] $components
27
     * @return string[]
28
     */
29
    public function addComponent(array $components): array
30
    {
31
        $components[] = $this->translationAPI->__('is admin:', 'graphql-api') . \is_admin();
32
        return $components;
33
    }
34
}
35