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.

GuzzleContainerAdapter::get()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
c 3
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 3
eloc 7
nc 3
nop 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 Guzzle\Service\Builder\ServiceBuilderInterface as GuzzleContainerInterface;
8
use Guzzle\Service\Exception\ServiceNotFoundException as GuzzleNotFoundException;
9
use Interop\Container\ContainerInterface as AcclimateContainerInterface;
10
11
/**
12
 * @deprecated in v1.1
13
 * An adapter from a Guzzle ServiceBuilder to the standardized ContainerInterface
14
 */
15
class GuzzleContainerAdapter implements AcclimateContainerInterface
16
{
17
    /**
18
     * @var GuzzleContainerInterface A Guzzle ServiceBuilder
19
     */
20
    private $container;
21
22
    /**
23
     * @param GuzzleContainerInterface $container A Guzzle ServiceBuilder
24
     */
25
    public function __construct(GuzzleContainerInterface $container)
26
    {
27
        $this->container = $container;
28
    }
29
30
    public function get($id)
31
    {
32
        try {
33
            return $this->container->get($id);
34
        } catch (GuzzleNotFoundException $prev) {
35
            throw AcclimateNotFoundException::fromPrevious($id, $prev);
36
        } catch (\Exception $prev) {
37
            throw AcclimateContainerException::fromPrevious($id, $prev);
38
        }
39
    }
40
41
    public function has($id)
42
    {
43
        return isset($this->container[$id]);
44
    }
45
}
46