Completed
Push — 2.x ( be80d1...0b4d06 )
by Aleksei
17s queued 15s
created

UnexpectedOperatorException::sequence()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of Cycle ORM package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\Database\Exception\CompilerException;
13
14
use Cycle\Database\Exception\CompilerException;
15
16
class UnexpectedOperatorException extends CompilerException
17
{
18
    /**
19
     * Exception for the value sequence (IN or NOT IN operator).
20
     *
21
     * @param string $operator User-provided operator.
22
     */
23
    public static function sequence(string $operator): self
24
    {
25
        return new self(
26
            \sprintf(
27
                'Unable to compile query, unexpected operator `%s` provided for a value sequence. %s',
28
                $operator,
29
                'Allowed operators: `IN`, `NOT IN` (or `=`, `!=` as sugar).'
30
            )
31
        );
32
    }
33
}
34