Passed
Push — master ( 8e9a4b...0b4ca3 )
by Sebastian
03:12
created

ClassNotExistsException::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 14
rs 9.9666
cc 3
nc 2
nop 3
1
<?php
2
/**
3
 * @package Application Utils
4
 * @subpackage ClassFinder
5
 * @see \AppUtils\ClassHelper\ClassNotExistsException
6
 */
7
8
declare(strict_types=1);
9
10
namespace AppUtils\ClassHelper;
11
12
use Throwable;
13
14
/**
15
 * @package Application Utils
16
 * @subpackage ClassFinder
17
 * @author Sebastian Mordziol <[email protected]>
18
 */
19
class ClassNotExistsException extends BaseClassHelperException
20
{
21
    public const ERROR_CODE = 110901;
22
23
    public function __construct(string $class, ?int $code = null, ?Throwable $previous = null)
24
    {
25
        if($code === null || $code === 0) {
26
            $code = self::ERROR_CODE;
27
        }
28
29
        parent::__construct(
30
            'Class does not exist.',
31
            sprintf(
32
                'The class [%s] cannot be auto-loaded.',
33
                $class
34
            ),
35
            $code,
36
            $previous
37
        );
38
    }
39
}
40