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.

ContainerException   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B fromPrevious() 0 13 5
1
<?php
2
3
namespace Acclimate\Container\Exception;
4
5
use Interop\Container\Exception\ContainerException as InteropContainerException;
6
7
/**
8
 * An error occurred when trying to retrieve an entry from the container
9
 */
10
class ContainerException extends \RuntimeException implements InteropContainerException
11
{
12
    /**
13
     * @var string The message template. Allowed variables are {error} and {id}
14
     */
15
    protected static $template = 'An {error} occurred when attempting to retrieve the "{id}" entry from the container.';
16
17
    /**
18
     * Creates a ContainerException by using the information from the previous exception
19
     *
20
     * @param string|mixed $id
21
     * @param \Exception $prev
22
     *
23
     * @return ContainerException
24
     */
25 4
    public static function fromPrevious($id, \Exception $prev = null)
26
    {
27 4
        $message = strtr(static::$template, array(
28 4
            '{id}'    => (is_string($id) || method_exists($id, '__toString')) ? $id : '?',
29 4
            '{error}' => $prev ? get_class($prev) : 'error',
30 4
        ));
31
32 4
        if ($prev) {
33 1
            $message .= ' Message: ' . $prev->getMessage();
34 1
        }
35
36 4
        return new static($message, 0, $prev);
37
    }
38
}
39