Passed
Pull Request — main (#493)
by
unknown
16:26 queued 01:27
created

InvalidTruncFieldException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A forNonLiteralNode() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Exception;
6
7
use Doctrine\DBAL\Types\ConversionException;
8
use MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\DateTrunc;
9
10
/**
11
 * @since 3.7
12
 *
13
 * @author Jan Klan <[email protected]>
14
 */
15
class InvalidTruncFieldException extends ConversionException
16
{
17
    public static function forNonLiteralNode(string $nodeClass, string $functionName): self
18
    {
19
        return new self(\sprintf(
20
            'The date_trunc field parameter for %s must be a string literal, got %s',
21
            $functionName,
22
            $nodeClass
23
        ));
24
    }
25
}
26