CommandClassNotFound::tryingToConfigure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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