DirectoryException::invalidEntry()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 8
cts 8
cp 1
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 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