Passed
Pull Request — master (#354)
by Dmitriy
05:05 queued 02:28
created

AfterBuiltHook   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 10
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A unsetInstance() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Di\Hook;
6
7
use Closure;
8
use Yiisoft\Di\Container;
9
10
final class AfterBuiltHook
11
{
12 1
    public static function unsetInstance(): Closure
13
    {
14 1
        return function (Container $container, string $id) {
15
            /**
16
             * @var $this Container
17
             */
18
            /** @psalm-scope-this Container */
19 1
            unset($this->instances[$id]);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
Bug Best Practice introduced by
The property instances does not exist on Yiisoft\Di\Hook\AfterBuiltHook. Did you maybe forget to declare it?
Loading history...
20 1
        };
21
    }
22
}
23