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 — master ( 3fd0c3...e8feac )
by Baptiste
02:21
created

Symbol::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
cc 3
eloc 5
nc 2
nop 1
crap 3
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable;
5
6
use Innmind\Immutable\Exception\InvalidArgumentException;
7
8
/**
9
 * Think of it as a unique identifier
10
 */
11
class Symbol implements PrimitiveInterface
12
{
13
    private $value;
14
15 4
    public function __construct($value)
16
    {
17 4
        if (!is_int($value) && !is_string($value)) {
18 1
            throw new InvalidArgumentException(
19 1
                'A Symbol can be composed only of an int or a string'
20
            );
21
        }
22
23 3
        $this->value = $value;
24 3
    }
25
26 1
    public function toPrimitive()
27
    {
28 1
        return $this->value;
29
    }
30
31 1
    public function __toString(): string
32
    {
33 1
        return (string) $this->value;
34
    }
35
}
36