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 ( c43051...94ce39 )
by Matthew
37s
created

BoolEnv::isBool()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Sphpeme\Env;
4
5
use Sphpeme\Env\EnvInterface;
6
use Sphpeme\Env\MappedEnvTrait;
7
8
class BoolEnv implements EnvInterface
9
{
10
    use MappedEnvTrait;
11
12
    const MAPPING = [
13
        'boolean?' => 'isBool',
14
        'eqv?' => 'isEqv',
15
        'eq?' => 'isEq',
16
        'equal?' => 'isEqual'
17
    ];
18
19
    /**
20
     * @SuppressWarnings(PHPMD.ShortVariable)
21
     * @param $a
22
     * @param $b
23
     * @return bool
24
     */
25 1
    public function isEqv($a, $b)
26
    {
27
        // todo: follow definition of eqv?
28 1
        return $a == $b;
29
    }
30
31
    /**
32
     * @SuppressWarnings(PHPMD.ShortVariable)
33
     * @param $a
34
     * @param $b
35
     * @return bool
36
     */
37 1
    public function isEq($a, $b)
38
    {
39 1
        return $a === $b;
40
    }
41
42
    /**
43
     * @SuppressWarnings(PHPMD.ShortVariable)
44
     * @param $a
45
     * @param $b
46
     * @return bool
47
     */
48 1
    public function isEqual($a, $b)
49
    {
50 1
        return $a == $b;
51
    }
52
53
    /**
54
     * @param $arg
55
     * @return bool
56
     */
57 1
    public function not($arg): bool
58
    {
59 1
        return !$arg;
60
    }
61
62
    /**
63
     * @param $arg
64
     * @return bool
65
     */
66 1
    public function isBool($arg)
67
    {
68 1
        return \is_bool($arg);
69
    }
70
}
71