Failed Conditions
Pull Request — master (#6743)
by Grégoire
11:31
created

UnrecognizedIdentifierFields   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromClassAndFieldNames() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Exception;
6
7
use function implode;
8
use function sprintf;
9
10
final class UnrecognizedIdentifierFields extends \LogicException implements ManagerException
11
{
12
    /**
13
     * @param string[] $fieldNames
14
     */
15 2
    public static function fromClassAndFieldNames(string $className, array $fieldNames) : self
16
    {
17 2
        return new self(sprintf(
18 2
            'Unrecognized identifier fields: "%s" are not present on class "%s".',
19 2
            implode("', '", $fieldNames),
20 2
            $className
21
        ));
22
    }
23
}
24