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.
Completed
Push — develop ( 33e0d8...37d09b )
by Baptiste
02:56 queued 50s
created

BooleanPrimitive::toPrimitive()   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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Innmind\Immutable;
4
5
use Innmind\Immutable\Exception\TypeException;
6
7
class BooleanPrimitive implements PrimitiveInterface
8
{
9
    private $value;
10
11 2
    public function __construct($value)
12
    {
13 2
        if (!is_bool($value)) {
14 1
            throw new TypeException('Value must be a boolean');
15
        }
16
17 1
        $this->value = (bool) $value;
18 1
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 1
    public function toPrimitive()
24
    {
25 1
        return $this->value;
26
    }
27
}
28