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.

ArrayAccessContainerAdapter   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

3 Methods

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