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.

SymfonyContainerAdapter   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 6
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 33
ccs 13
cts 13
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A get() 0 12 4
A has() 0 4 1
1
<?php
2
3
namespace Acclimate\Container\Adapter;
4
5
use Acclimate\Container\Exception\ContainerException as AcclimateContainerException;
6
use Acclimate\Container\Exception\NotFoundException as AcclimateNotFoundException;
7
use Interop\Container\ContainerInterface as AcclimateContainerInterface;
8
use Symfony\Component\DependencyInjection\ContainerInterface as SymfonyContainerInterface;
9
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException as SymfonyInvalidArgumentException;
10
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException as SymfonyNotFoundException;
11
12
/**
13
 * An adapter from a Symfony Container to the standardized ContainerInterface
14
 */
15
class SymfonyContainerAdapter implements AcclimateContainerInterface
16
{
17
    /**
18
     * @var SymfonyContainerInterface A Symfony Container
19
     */
20
    private $container;
21
22
    /**
23
     * @param SymfonyContainerInterface $container A Symfony Container
24
     */
25 4
    public function __construct(SymfonyContainerInterface $container)
26
    {
27 4
        $this->container = $container;
28 4
    }
29
30 4
    public function get($id)
31
    {
32
        try {
33 4
            return $this->container->get($id);
34 3
        } catch (SymfonyNotFoundException $prev) {
35 1
            throw AcclimateNotFoundException::fromPrevious($id, $prev);
36 2
        } catch (SymfonyInvalidArgumentException $prev) {
37 1
            throw AcclimateNotFoundException::fromPrevious($id, $prev);
38 1
        } catch (\Exception $prev) {
39 1
            throw AcclimateContainerException::fromPrevious($id, $prev);
40
        }
41
    }
42
43 2
    public function has($id)
44
    {
45 2
        return $this->container->has($id);
46
    }
47
}
48