Completed
Pull Request — master (#9)
by Adam
02:30
created

CommandException::invalidCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Equip\Queue\Exception;
4
5
use Exception;
6
7
class CommandException extends Exception
8
{
9
    const INVALID = 1000;
10
11
    /**
12
     * @param string $name
13
     *
14
     * @return static
15
     */
16 2
    public static function invalidCommand($name)
17
    {
18 2
        return new static(
19 2
            sprintf('The command for `%s` is invalid.', $name),
20
            static::INVALID
21 2
        );
22
    }
23
}
24