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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 25
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 3
A toPrimitive() 0 4 1
A __toString() 0 4 1
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