CommandException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A invalidCommand() 0 12 2
1
<?php
2
3
namespace Equip\Console\Exception;
4
5
use DomainException;
6
use Symfony\Component\Console\Command\Command;
7
8
class CommandException extends DomainException
9
{
10
    /**
11
     * @param string|object $spec
12
     *
13
     * @return static
14
     */
15
    public static function invalidCommand($spec)
16
    {
17
        if (is_object($spec)) {
18
            $spec = get_class($spec);
19
        }
20
21
        return new static(sprintf(
22
            'Command class `%s` must extend `%s`',
23
            $spec,
24
            Command::class
25
        ));
26
    }
27
}
28