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.

LaravelContainerAdapter   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 0
cbo 3
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 Acclimate\Container\Exception\ContainerException as AcclimateContainerException;
6
use Acclimate\Container\Exception\NotFoundException as AcclimateNotFoundException;
7
use Illuminate\Container\Container as LaravelContainerInterface;
8
use Interop\Container\ContainerInterface as AcclimateContainerInterface;
9
10
/**
11
 * An adapter from a Laravel Container to the standardized ContainerInterface
12
 */
13
class LaravelContainerAdapter implements AcclimateContainerInterface
14
{
15
    /**
16
     * @var LaravelContainerInterface A Laravel Container
17
     */
18
    private $container;
19
20
    /**
21
     * @param LaravelContainerInterface $container A Laravel Container
22
     */
23 3
    public function __construct(LaravelContainerInterface $container)
24
    {
25 3
        $this->container = $container;
26 3
    }
27
28 3
    public function get($id)
29
    {
30 3
        if ($this->container->bound($id)) {
31
            try {
32 2
                return $this->container->make($id);
33 1
            } catch (\Exception $prev) {
34 1
                throw AcclimateContainerException::fromPrevious($id, $prev);
35
            }
36
        } else {
37 1
            throw AcclimateNotFoundException::fromPrevious($id);
38
        }
39
    }
40
41 2
    public function has($id)
42
    {
43 2
        return $this->container->bound($id);
44
    }
45
}
46