InvalidAssetDirectory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A forDirectory() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ReliqArts\Docweaver\Exception\Product;
6
7
use ReliqArts\Docweaver\Contract\Exception;
8
use ReliqArts\Docweaver\Exception\InvalidDirectory;
9
10
final class InvalidAssetDirectory extends InvalidDirectory
11
{
12
    private const CODE = 4003;
13
14
    public static function forDirectory(string $directory, Exception $previous = null): Exception
15
    {
16
        $message = sprintf('Invalid asset directory: `%s`.', $directory);
17
        $self = new self($message, self::CODE, $previous);
18
        $self->directory = $directory;
19
20
        return $self;
21
    }
22
}
23