Container::has()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 1
cp 0
crap 2
rs 10
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