Passed
Pull Request — master (#74)
by Rustam
02:43
created

ProxyServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug;
6
7
use Psr\Container\ContainerInterface;
8
use Yiisoft\Di\Container;
9
use Yiisoft\Di\Support\ServiceProvider;
10
use Yiisoft\Yii\Debug\Proxy\ContainerProxy;
11
use Yiisoft\Yii\Debug\Proxy\ContainerProxyConfig;
12
13
final class ProxyServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * @psalm-suppress InaccessibleMethod
17
     */
18 1
    public function register(Container $container): void
19
    {
20 1
        $container->set(
21 1
            ContainerInterface::class,
22 1
            static function (ContainerInterface $container) {
23 1
                return new ContainerProxy($container, $container->get(ContainerProxyConfig::class));
24 1
            }
25
        );
26 1
    }
27
}
28