Test Failed
Pull Request — master (#37)
by Divine Niiquaye
11:41
created

ServiceLocator::getProvidedServices()   B

Complexity

Conditions 9
Paths 2

Size

Total Lines 19
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 9

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 19
ccs 11
cts 11
cp 1
rs 8.0555
cc 9
nc 2
nop 0
crap 9
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of DivineNii opensource projects.
7
 *
8
 * PHP version 7.4 and above required
9
 *
10
 * @author    Divine Niiquaye Ibok <[email protected]>
11
 * @copyright 2021 DivineNii (https://divinenii.com/)
12
 * @license   https://opensource.org/licenses/BSD-3-Clause License
13
 *
14
 * For the full copyright and license information, please view the LICENSE
15
 * file that was distributed with this source code.
16
 */
17
18
namespace Rade\DI\Services;
19
20
use Psr\Container\ContainerExceptionInterface;
21
use Rade\DI\Exceptions\CircularReferenceException;
22
use Symfony\Contracts\Service\{ServiceLocatorTrait, ServiceProviderInterface as ServiceProviderContext};
23
24
/**
25
 * Rade PSR-11 service locator.
26
 *
27
 * @author Divine Niiquaye Ibok <[email protected]>
28
 */
29
class ServiceLocator implements ServiceProviderContext
30
{
31
    use ServiceLocatorTrait;
32
33
    /**
34
     * @param array<int,string> $path
35
     */
36
    private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface
0 ignored issues
show
Unused Code introduced by
The method createCircularReferenceException() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
37 7
    {
38
        return new CircularReferenceException($id, $path);
39 7
    }
40
}
41