UnexpectedAssociationValue   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Exception;
6
7
use Doctrine\ORM\Cache\Exception\CacheException;
8
use LogicException;
9
use function sprintf;
10
11
final class UnexpectedAssociationValue extends LogicException implements CacheException
12
{
13
    public static function create(
14
        string $class,
15
        string $association,
16
        string $given,
17
        string $expected
18
    ) : self {
19
        return new self(sprintf(
20
            'Found entity of type %s on association %s#%s, but expecting %s',
21
            $given,
22
            $class,
23
            $association,
24
            $expected
25
        ));
26
    }
27
}
28