Passed
Push — re-bind ( 579e89...7ba86b )
by Akihito
02:14
created

Rebind::bind()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Di;
6
7
final class Rebind
8
{
9
    /** @var list<list<string>> */
0 ignored issues
show
Bug introduced by
The type Ray\Di\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
    private $reBind = [];
11
12
    public function bind(string $fromInterface, string $toName, string $fromName = '', string $toInterface = ''): void
13
    {
14
        $this->reBind[] = [$fromInterface, $toName, $fromName, $toInterface];
15
    }
16
17
    public function commit(Container $container): void
18
    {
19
        foreach ($this->reBind as [$fromInterface, $toName, $fromName, $toInterface]) {
20
            $container->move($fromInterface, $fromName, $toInterface, $toName);
21
        }
22
23
        $this->reBind = [];
0 ignored issues
show
Documentation Bug introduced by
It seems like array() of type array is incompatible with the declared type Ray\Di\list of property $reBind.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
24
    }
25
}
26