Completed
Push — master ( 3fdc21...2574b5 )
by ReliQ
01:51
created

InvalidAssetDirectory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

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