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 ( 490a5c...0322d9 )
by Leonardo
03:15
created

ApplicationStateHooks   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 11
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 5 1
A addComponent() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLAPI\GraphQLAPI\Hooks;
6
7
use PoP\Engine\Hooks\AbstractHookSet;
8
use PoP\ComponentModel\ModelInstance\ModelInstance;
9
10
class ApplicationStateHooks extends AbstractHookSet
11
{
12
    protected function init()
13
    {
14
        $this->hooksAPI->addFilter(
15
            ModelInstance::HOOK_COMPONENTSFROMVARS_RESULT,
16
            [$this, 'addComponent']
17
        );
18
    }
19
    /**
20
     * Admin and non-admin have different schemas
21
     */
22
    public function addComponent(array $components): array
23
    {
24
        $components[] = $this->translationAPI->__('is admin:', 'graphql-api') . \is_admin();
25
        return $components;
26
    }
27
}
28