Container   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 23
ccs 0
cts 5
cp 0
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 3 1
A has() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/boot project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Boot\Service;
10
11
use Auryn\Injector;
12
use Psr\Container\ContainerInterface;
13
14
final class Container implements ContainerInterface
15
{
16
    private Injector $injector;
17
18
    public function __construct(Injector $injector)
19
    {
20
        $this->injector = $injector;
21
    }
22
23
    /**
24
     * @return object
25
     */
26
    public function get(string $fqcn)
27
    {
28
        return $this->injector->make($fqcn);
29
    }
30
31
    /**
32
     * @return boolean
33
     */
34
    public function has(string $fqcn): bool
35
    {
36
        return class_exists($fqcn);
37
    }
38
}
39