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 ( 83a8a5...99aee4 )
by Matthew
01:34
created

DefineExpHandler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A evaluate() 0 4 1
A __construct() 0 3 1
A handles() 0 3 1
1
<?php
2
3
namespace Sphpeme\ExpHandler;
4
5
6
7
use Sphpeme\Env;
8
use Sphpeme\Evaluator;
9
use Sphpeme\Symbol;
10
11
class DefineExpHandler implements ExpHandler
12
{
13
    private $defineSymbol;
14
15
    public function __construct()
16
    {
17
        $this->defineSymbol = Symbol::make('define');
18
    }
19
20
    public function evaluate($exp, Env $env, Evaluator $evaluate)
21
    {
22
        [$_, $symbol, $exp] = $exp;
23
        $env->$symbol = $evaluate($exp, $env);
24
    }
25
26
    public function handles($exp): bool
27
    {
28
        return $exp[0] === $this->defineSymbol;
29
    }
30
}