Completed
Push — master ( 7e0727...5b2a97 )
by Ross
08:00
created

MethodDoesNotExist::on()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace League\Tactician\Handler\Mapping;
6
7
use BadMethodCallException;
8
use League\Tactician\Exception;
9
10
/**
11
 * Thrown when a specific handler object can not be used on a command object.
12
 *
13
 * The most common reason is the receiving method is missing or incorrectly
14
 * named.
15
 */
16
final class MethodDoesNotExist extends BadMethodCallException implements Exception
17
{
18 2
    public static function on(string $className, string $methodName): self
19
    {
20 2
        return new self(
21 2
            'The handler method ' . $className . ' :: ' . $methodName . ' does not exist. Please check your ' .
22 2
            'Tactician mapping configuration or check verify that ' . $methodName . ' is actually declared in . ' .
23 2
            $className
24
        );
25
    }
26
}
27