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

ClassType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A validate() 0 6 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable\Specification;
5
6
use Innmind\Immutable\{
7
    SpecificationInterface,
8
    Exception\InvalidArgumentException
9
};
10
11
class ClassType implements SpecificationInterface
12
{
13
    private $class;
14
15 8
    public function __construct(string $class)
16
    {
17 8
        $this->class = $class;
18 8
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23 7
    public function validate($value)
24
    {
25 7
        if (!$value instanceof $this->class) {
26 1
            throw new InvalidArgumentException;
27
        }
28 6
    }
29
}
30