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 — develop ( c3b70c...588978 )
by Baptiste
05:12
created

Symbol::value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
 * @template T
12
 */
13
final class Symbol
14
{
15
    private $value;
16
17
    /**
18
     * @param T $value
19
     */
20 6
    public function __construct($value)
21
    {
22 6
        if (!\is_int($value) && !\is_string($value)) {
23 1
            throw new InvalidArgumentException(
24 1
                'A Symbol can be composed only of an int or a string'
25
            );
26
        }
27
28 5
        $this->value = $value;
29 5
    }
30
31
    /**
32
     * @return T
33
     */
34 1
    public function value()
35
    {
36 1
        return $this->value;
37
    }
38
39 1
    public function __toString(): string
40
    {
41 1
        return (string) $this->value;
42
    }
43
}
44