Passed
Branch master (63685a)
by Felipe
03:15
created

ContainerException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 13
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A createFromThrowable() 0 6 1
1
<?php
2
3
/**
4
 * This file is part of coisa/error-handler.
5
 *
6
 * (c) Felipe Sayão Lobato Abreu <[email protected]>
7
 *
8
 * This source file is subject to the license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
declare(strict_types=1);
13
14
namespace CoiSA\ErrorHandler\Container\Exception;
15
16
use Psr\Container\ContainerExceptionInterface;
17
18
/**
19
 * Class ContainerException
20
 *
21
 * @package CoiSA\ErrorHandler\Container\Exception
22
 */
23
class ContainerException extends \Exception implements ContainerExceptionInterface
24
{
25
    /**
26
     * @param \Throwable $throwable
27
     *
28
     * @return ContainerException
29
     */
30 1
    public static function createFromThrowable(\Throwable $throwable): self
31
    {
32 1
        return new self(
33 1
            $throwable->getMessage(),
34 1
            $throwable->getCode(),
35 1
            $throwable
36
        );
37
    }
38
}
39