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
Pull Request — master (#328)
by Martin
01:35
created

PsrContainerAwareRouter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 36
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A get() 0 6 1
A accepts() 0 4 1
1
<?php
2
3
namespace Bernard\Router;
4
5
use Psr\Container\ContainerInterface;
6
7
/**
8
 * @package Bernard\Router
9
 */
10
class PsrContainerAwareRouter extends SimpleRouter
11
{
12
    /**
13
     * @var ContainerInterface
14
     */
15
    private $container;
16
17
    /**
18
     * @param ContainerInterface $container
19
     * @param array              $receivers
20
     */
21
    public function __construct(ContainerInterface $container, array $receivers = [])
22
    {
23
        $this->container = $container;
24
25
        parent::__construct($receivers);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function get($name)
32
    {
33
        $serviceId = parent::get($name);
34
35
        return $this->container->get($serviceId);
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    protected function accepts($receiver)
42
    {
43
        return $this->container->has($receiver);
44
    }
45
}
46