MissingHandlerException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forCommand() 0 7 1
A getCommandName() 0 4 1
1
<?php
2
3
namespace League\Tactician\Exception;
4
5
/**
6
 * No handler could be found for the given command.
7
 */
8
class MissingHandlerException extends \OutOfBoundsException implements Exception
9
{
10
    /**
11
     * @var string
12
     */
13
    private $commandName;
14
15
    /**
16
     * @param string $commandName
17
     *
18
     * @return static
19
     */
20 3
    public static function forCommand($commandName)
21
    {
22 3
        $exception = new static('Missing handler for command ' . $commandName);
23 3
        $exception->commandName = $commandName;
24
25 3
        return $exception;
26
    }
27
28
    /**
29
     * @return string
30
     */
31 1
    public function getCommandName()
32
    {
33 1
        return $this->commandName;
34
    }
35
}
36