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.

FailoverOnMissContainer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Acclimate\Container\Decorator;
4
5
use Interop\Container\ContainerInterface;
6
use Interop\Container\Exception\NotFoundException;
7
8
/**
9
 * A container decorator that delegates to a designated failover container if the decorated container does not contain
10
 * the requested entry
11
 */
12
class FailoverOnMissContainer extends AbstractContainerDecorator
13
{
14
    /**
15
     * @var ContainerInterface
16
     */
17
    private $failoverContainer;
18
19
    /**
20
     * @param ContainerInterface $container         The container being decorated
21
     * @param ContainerInterface $failoverContainer The container to act as a failover
22
     */
23 1
    public function __construct(ContainerInterface $container, ContainerInterface $failoverContainer)
24
    {
25 1
        parent::__construct($container);
26 1
        $this->failoverContainer = $failoverContainer;
27 1
    }
28
29 1
    public function get($id)
30
    {
31
        try {
32 1
            return $this->container->get($id);
33 1
        } catch (NotFoundException $e) {
34 1
            return $this->failoverContainer->get($id);
35
        }
36
    }
37
}
38