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.

ZendServiceManagerContainerAdapter::get()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
cc 3
eloc 7
nc 3
nop 1
crap 3
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 Zend\ServiceManager\Exception\ServiceNotFoundException as ZendNotFoundException;
9
use Zend\ServiceManager\ServiceLocatorInterface;
10
11
/**
12
 * An adapter from a Zend ServiceManager/ServiceLocator to the standardized ContainerInterface
13
 */
14
class ZendServiceManagerContainerAdapter implements AcclimateContainerInterface
15
{
16
    /**
17
     * @var ServiceLocatorInterface A Zend ServiceManager/ServiceLocator
18
     */
19
    private $container;
20
21
    /**
22
     * @param ServiceLocatorInterface $container A Zend ServiceManager/ServiceLocator
23
     */
24 3
    public function __construct(ServiceLocatorInterface $container)
25
    {
26 3
        $this->container = $container;
27 3
    }
28
29 3
    public function get($id)
30
    {
31
        try {
32 3
            return $this->container->get($id);
33 2
        } catch (ZendNotFoundException $prev) {
34 1
            throw AcclimateNotFoundException::fromPrevious($id, $prev);
35 1
        } catch (\Exception $prev) {
36 1
            throw AcclimateContainerException::fromPrevious($id, $prev);
37
        }
38
    }
39
40 2
    public function has($id)
41
    {
42 2
        return $this->container->has($id);
43
    }
44
}
45