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

MethodDoesNotExist   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A on() 0 6 1
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