HandlerNotFoundException::notFound()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * GpsLab component.
6
 *
7
 * @author    Peter Gribanov <[email protected]>
8
 * @copyright Copyright (c) 2011, Peter Gribanov
9
 * @license   http://opensource.org/licenses/MIT
10
 */
11
12
namespace GpsLab\Component\Command\Exception;
13
14
use GpsLab\Component\Command\Command;
15
16
final class HandlerNotFoundException extends \RuntimeException
17
{
18
    /**
19
     * @param Command $command
20
     *
21
     * @return self
22
     */
23 1
    public static function notFound(Command $command): self
24
    {
25 1
        $parts = explode('\\', get_class($command));
26
27 1
        return new self(sprintf('Not found handler for command "%s".', end($parts)));
28
    }
29
}
30