DirectoryException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 20
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A invalidEntry() 0 12 2
1
<?php
2
3
namespace Equip\Exception;
4
5
use Equip\Action;
6
use InvalidArgumentException;
7
8
class DirectoryException extends InvalidArgumentException
9
{
10
    /**
11
     * @param mixed $value
12
     *
13
     * @return static
14
     */
15 1
    public static function invalidEntry($value)
16
    {
17 1
        if (is_object($value)) {
18 1
            $value = get_class($value);
19 1
        }
20
21 1
        return new static(sprintf(
22 1
            'Directory entry `%s` is not an `%s` instance',
23 1
            $value,
24
            Action::class
25 1
        ));
26
    }
27
}
28