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.
Completed
Pull Request — master (#837)
by E
07:31 queued 05:03
created

ParserExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 27
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A loadConfiguration() 0 16 1
A loadServicesFromConfig() 0 7 1
1
<?php declare(strict_types=1);
2
3
namespace ApiGen\Parser\DI;
4
5
use ApiGen\Parser\Broker\Backend;
6
use Nette\DI\Compiler;
7
use Nette\DI\CompilerExtension;
8
use TokenReflection\Broker;
9
10
final class ParserExtension extends CompilerExtension
11
{
12
    public function loadConfiguration(): void
13
    {
14
        $this->loadServicesFromConfig();
15
16
        $containerBuilder = $this->getContainerBuilder();
17
18
        $backend = $containerBuilder->addDefinition($this->prefix('backend'))
19
            ->setClass(Backend::class);
20
21
        $containerBuilder->addDefinition($this->prefix('broker'))
22
            ->setClass(Broker::class)
23
            ->setArguments([
24
                $backend,
25
                Broker::OPTION_DEFAULT & ~(Broker::OPTION_PARSE_FUNCTION_BODY | Broker::OPTION_SAVE_TOKEN_STREAM)
26
            ]);
27
    }
28
29
    private function loadServicesFromConfig(): void
30
    {
31
        Compiler::loadDefinitions(
32
            $this->getContainerBuilder(),
33
            $this->loadFromFile(__DIR__ . '/services.neon')['services']
34
        );
35
    }
36
}
37