InvalidSignatureException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
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 18
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromInvalidSignature() 0 14 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 invalid provided signatures
14
 */
15
class InvalidSignatureException extends UnexpectedValueException implements ExceptionInterface
16
{
17
    /** @param mixed[] $parameters */
18
    public static function fromInvalidSignature(
19 1
        ReflectionClass $class,
20
        array $parameters,
21
        string $signature,
22
        string $expected
23
    ) : self {
24
        return new self(sprintf(
25 1
            'Found signature "%s" for class "%s" does not correspond to expected signature "%s" for %d parameters',
26 1
            $signature,
27 1
            $class->getName(),
28 1
            $expected,
29 1
            count($parameters)
30 1
        ));
31
    }
32
}
33