MissingSignatureException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromMissingSignature() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManager\Signature\Exception;
6
7
use ReflectionClass;
8
use UnexpectedValueException;
9
use function count;
10
use function sprintf;
11
12
/**
13
 * Exception for no found signatures
14
 */
15
class MissingSignatureException extends UnexpectedValueException implements ExceptionInterface
16
{
17
    /** @param mixed[] $parameters */
18
    public static function fromMissingSignature(ReflectionClass $class, array $parameters, string $expected) : self
19 1
    {
20
        return new self(sprintf(
21 1
            'No signature found for class "%s", expected signature "%s" for %d parameters',
22 1
            $class->getName(),
23 1
            $expected,
24 1
            count($parameters)
25 1
        ));
26
    }
27
}
28