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.

ZendDiContainerAdapter::get()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

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