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 — develop ( ae3fd9...4725ce )
by Baptiste
03:13
created

ConstructorLessInstanciator::getParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Reflection\Instanciator;
5
6
use Innmind\Reflection\{
7
    InstanciatorInterface,
8
    Exception\InstanciationFailedException
9
};
10
use Innmind\Immutable\{
11
    MapInterface,
12
    SetInterface,
13
    Map,
14
    Set
15
};
16
17
final class ConstructorLessInstanciator implements InstanciatorInterface
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22 1
    public function build(string $class, MapInterface $properties)
23
    {
24
        try {
25 1
            $refl = new \ReflectionClass($class);
26
27 1
            return $refl->newInstanceWithoutConstructor();
28
        } catch (\TypeError $e) {
0 ignored issues
show
Bug introduced by
The class TypeError does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
29
            throw new InstanciationFailedException(
30
                sprintf(
31
                    'Class "%s" cannot be instanciated',
32
                    $class
33
                ),
34
                $e->getCode(),
35
                $e
36
            );
37
        }
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43 1
    public function parameters(string $class): SetInterface
44
    {
45 1
        return new Set('string');
46
    }
47
}
48