ResultTypeClassDoesNotMatchExpected::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cushon\HealthBundle\QueryBus\ResultAssertion\Exception;
6
7
use Cushon\HealthBundle\Message\Result\HealthCheck;
8
use Cushon\HealthBundle\QueryBus\Exception\QueryBusError;
9
use InvalidArgumentException;
10
11
final class ResultTypeClassDoesNotMatchExpected extends InvalidArgumentException implements AssertionError
12
{
13
    /**
14
     * @param string $classOrInterface
15
     * @return static
16
     */
17
    public static function create(string $classOrInterface): self
18
    {
19
        return new self(sprintf(
20
            'The Result class or interface to test for at runtime must implement %s, received %s',
21
            HealthCheck::class,
22
            $classOrInterface
23
        ));
24
    }
25
}
26