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.

PostProcessor::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace crojasaragonez\LightService;
6
7
class PostProcessor
8
{
9
    private $organizer;
10
    private $action;
11 9
    public function __construct(Organizer $organizer, Action $action)
12
    {
13 9
        $this->organizer = $organizer;
14 9
        $this->action    = $action;
15 9
    }
16
17 9
    public static function validate(Organizer $organizer, Action $action)
18
    {
19 9
        $instance = new self($organizer, $action);
20 9
        if ($action->context[Organizer::SKIP_REMAINING] ?? false) {
21 6
            return;
22
        }
23 9
        $instance->checkPromises();
24
    }
25 9
26 9
    private function checkPromises()
27 3
    {
28
        $missing_keys = ContextHelper::missingKeys($this->action->promises, $this->organizer->context);
29 6
        if ($missing_keys) {
30
            throw new \Exception("promised '$missing_keys' to be in the context during " . get_class($this->action));
31
        }
32
    }
33
}
34