Passed
Pull Request — master (#354)
by Dmitriy
05:37 queued 03:06
created

AfterBuiltHook::unsetInstance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 3
cts 3
cp 1
crap 1
rs 10
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 1
            unset($this->instances[$id]);
0 ignored issues
show
Bug introduced by
The property instances is declared private in Yiisoft\Di\Container and cannot be accessed from this context.
Loading history...
Comprehensibility Best Practice introduced by
The variable $this seems to be never defined.
Loading history...
19 1
        };
20
    }
21
}
22