NotInstantiableClassException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 4
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Definitions\Exception;
6
7
use Exception;
8
9
/**
10
 * `NotInstantiableClassException` is thrown when a class can not be instantiated for whatever reason.
11
 */
12
final class NotInstantiableClassException extends NotInstantiableException
13
{
14 9
    public function __construct(string $class, string $message = null, int $code = 0, Exception $previous = null)
15
    {
16 9
        if ($message === null) {
17 8
            $message = "Can not instantiate $class.";
18
        }
19 9
        parent::__construct($message, $code, $previous);
20
    }
21
}
22