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
Pull Request — master (#1)
by Matthew
01:35
created

IfSpecialForm   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handles() 0 3 1
A evaluate() 0 9 2
1
<?php
2
3
namespace Sphpeme;
4
5
6
use Sphpeme\Evaluator\SpecialForm;
7
8
class IfSpecialForm implements SpecialForm
9
{
10
    public function evaluate($exp, Env $env, Evaluator $evaluate)
11
    {
12
        [$if, $test, $true, $false] = $exp;
13
14
        return $evaluate(
15
            $evaluate($test, $env)
16
                ? $true
17
                : $false,
18
            $env);
19
    }
20
21
    public function handles($exp): bool
22
    {
23
        return $exp[0] == 'if';
24
    }
25
}