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

Type   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 18
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSpecFor() 0 8 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Immutable;
5
6
use Innmind\Immutable\{
7
    Specification\PrimitiveType,
8
    Specification\ClassType
9
};
10
11
trait Type
12
{
13
    /**
14
     * Build the approprivate specification for the given type
15
     *
16
     * @param string $type
17
     *
18
     * @return SpecificationInterface
19
     */
20 54
    private function getSpecFor(string $type): SpecificationInterface
21
    {
22 54
        if (function_exists('is_' . $type)) {
23 53
            return new PrimitiveType($type);
24
        }
25
26 6
        return new ClassType($type);
27
    }
28
}
29