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

InjectionStrategies::get()   B

Complexity

Conditions 4
Paths 4

Size

Total Lines 23
Code Lines 12

Duplication

Lines 23
Ratio 100 %

Code Coverage

Tests 9
CRAP Score 4.016

Importance

Changes 0
Metric Value
dl 23
loc 23
ccs 9
cts 10
cp 0.9
rs 8.7972
c 0
b 0
f 0
cc 4
eloc 12
nc 4
nop 3
crap 4.016
1
<?php
2
3
namespace Innmind\Reflection\InjectionStrategy;
4
5
use Innmind\Reflection\InjectionStrategyInterface;
6
use Innmind\Immutable\Stream;
7
8
final class InjectionStrategies
9
{
10
    private static $default;
11
12 16
    public static function default(): InjectionStrategyInterface
0 ignored issues
show
Coding Style introduced by
Possible parse error: non-abstract method defined as abstract
Loading history...
13
    {
14 16
        if (self::$default === null) {
15 1
            self::$default = new DelegationStrategy(
16 1
                (new Stream(InjectionStrategyInterface::class))
17 1
                    ->add(new SetterStrategy)
1 ignored issue
show
Documentation introduced by
new \Innmind\Reflection\...rategy\SetterStrategy() is of type object<Innmind\Reflectio...trategy\SetterStrategy>, but the function expects a object<Innmind\Immutable\T>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
18 1
                    ->add(new NamedMethodStrategy)
1 ignored issue
show
Documentation introduced by
new \Innmind\Reflection\...y\NamedMethodStrategy() is of type object<Innmind\Reflectio...gy\NamedMethodStrategy>, but the function expects a object<Innmind\Immutable\T>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
19 1
                    ->add(new ReflectionStrategy)
1 ignored issue
show
Documentation introduced by
new \Innmind\Reflection\...gy\ReflectionStrategy() is of type object<Innmind\Reflectio...egy\ReflectionStrategy>, but the function expects a object<Innmind\Immutable\T>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
20
            );
21
        }
22
23 16
        return self::$default;
24
    }
25
}
26