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.

Organizer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 23
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A reduce() 0 12 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace crojasaragonez\LightService;
6
7
class Organizer
8
{
9
    const SKIP_REMAINING = 'skip_remaining';
10
    const RESERVED_KEYS  = [self::SKIP_REMAINING];
11
12
    public $context;
13 21
    public function __construct(array $context = [])
14
    {
15 21
        $this->context = $context;
16 21
    }
17
18 21
    public function reduce($actions = []) : ?array
19
    {
20 21
        foreach ($actions as $action) {
21 18
            if ($this->context[self::SKIP_REMAINING] ?? false) {
22 6
                continue;
23
            }
24 15
            $instance = new $action($this->context);
25 15
            PreProcessor::validate($this, $instance);
26 9
            $instance->execute();
27 9
            PostProcessor::validate($this, $instance);
28
        }
29 12
        return ContextHelper::removeReservedKeys(Organizer::RESERVED_KEYS, $this->context);
30
    }
31
}
32