AdapterProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Infrastructure\ObjectStorage;
6
7
use Psr\Container\ContainerInterface;
8
9
class AdapterProvider
10
{
11
    private ContainerInterface $adaptersContainer;
12
13 6
    public function __construct(ContainerInterface $adaptersContainer)
14
    {
15 6
        $this->adaptersContainer = $adaptersContainer;
16 6
    }
17
18 6
    public function __invoke(string $name): ObjectStorageAdapter
19
    {
20 6
       return $this->adaptersContainer->get($name);
21
    }
22
}
23