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.

NullOnMissContainer::get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Acclimate\Container\Decorator;
4
5
use Interop\Container\Exception\NotFoundException;
6
7
/**
8
 * A container decorator that changes the default behavior of throwing an exception when an item doesn't exist in the
9
 * container to instead return NULL
10
 */
11
class NullOnMissContainer extends AbstractContainerDecorator
12
{
13 1
    public function get($id)
14
    {
15
        try {
16 1
            return $this->container->get($id);
17 1
        } catch (NotFoundException $e) {
18 1
            return null;
19
        }
20
    }
21
}
22