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.

PimpleContainerAdapter::has()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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