GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( fa1ad4...6edbd7 )
by Márk
06:40
created

ContainerRouter::get()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 10
cp 0
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 4
nop 1
crap 12
1
<?php
2
3
namespace Bernard\Router;
4
use Psr\Container\ContainerExceptionInterface;
5
use Psr\Container\ContainerInterface;
6
use Psr\Container\NotFoundExceptionInterface;
7
8
/**
9
 * PSR-11 container router implementation.
10
 */
11
final class ContainerRouter extends SimpleRouter
12
{
13
    private $container;
14
15
    /**
16
     * @param ContainerInterface $container
17
     * @param array              $receivers
18
     */
19
    public function __construct(ContainerInterface $container, array $receivers = [])
20
    {
21
        $this->container = $container;
22
23
        parent::__construct($receivers);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    protected function get($name)
30
    {
31
        $serviceId = parent::get($name);
32
        $serviceId = $serviceId ?: '';
33
34
        try {
35
            return $this->container->get($serviceId);
36
        } catch (NotFoundExceptionInterface $e) {
37
            return null;
38
        }
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    protected function accepts($receiver)
45
    {
46
        return $this->container->has($receiver);
47
    }
48
}
49