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.

Evaluator   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
A __invoke() 0 16 4
1
<?php
2
3
namespace Sphpeme;
4
5
6
use Sphpeme\ExpHandler\ExpHandler;
7
use Sphpeme\ExpHandler\ScalarHandler;
8
use Sphpeme\ExpHandler\SymbolHandler;
9
10
class Evaluator
11
{
12
    /**
13
     * @var ExpHandler[]
14
     */
15
    private $handlers;
16
17 5
    public function __construct(ExpHandler ...$handlers)
18
    {
19 5
        if (\count($handlers) === 0) {
20
            $handlers = [
21 5
                new SymbolHandler(),
22 5
                new ScalarHandler(),
23
            ];
24
        }
25 5
        $this->handlers = $handlers;
26 5
    }
27
28 2
    public function __invoke($exp, Env\EnvInterface $env)
29
    {
30 2
        foreach ($this->handlers as $handler) {
31 2
            if ($handler->handles($exp)) {
32 2
                return $handler->evaluate($exp, $env, $this);
33
            }
34
        }
35
36 1
        $call = $this($exp[0], $env);
37 1
        $args = [];
38 1
        foreach (\array_slice($exp, 1) as $arg) {
39 1
            $args[] = $this($arg, $env);
40
        }
41
42 1
        return $call(...$args);
43
    }
44
}