Completed
Push — master ( ea9893...01c438 )
by Nikola
03:09
created

LoggerComponentNotResolvedException::fromError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MonologFactory\Exception;
6
7
class LoggerComponentNotResolvedException extends \RuntimeException implements ExceptionInterface
8
{
9 3
    public static function fromError(\Throwable $error)
10
    {
11 3
        return new self(
12 3
            sprintf('Logger component could not be resolved. Reason: %s', $error->getMessage()),
13 3
            (int) $error->getCode(),
14 3
            $error
15
        );
16
    }
17
}
18