UnexpectedAssociationValue::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 4
dl 0
loc 12
ccs 0
cts 12
cp 0
crap 2
rs 10
c 0
b 0
f 0
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