CommandClassNotFound   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A tryingToConfigure() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CommandHandling;
4
5
use InvalidArgumentException as InvalidArgument;
6
use function sprintf;
7
8
/**
9
 * Exception to throw when trying to configure a command handler for a class of
10
 * commands that does not exist.
11
 */
12
final class CommandClassNotFound
13
    extends InvalidArgument
14
    implements InvalidBusConfiguration
15
{
16
    public static function tryingToConfigure($class): InvalidBusConfiguration
17
    {
18
        return new self(sprintf(
19
            'Cannot configure non-existing command class `%s`.',
20
            $class
21
        ));
22
    }
23
}
24