NegatedExpression::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace BenTools\Where\Expression;
5
6
final class NegatedExpression extends Expression
7
{
8
    /**
9
     * NegatedExpression constructor.
10
     * @param Expression $expression
11
     */
12
    protected function __construct(Expression $expression)
13
    {
14
        $this->expression = $expression;
15
    }
16
17
    /**
18
     * @inheritDoc
19
     */
20
    public function __toString(): string
21
    {
22
        return sprintf('NOT %s', $this->expression);
23
    }
24
25
    /**
26
     * @inheritDoc
27
     */
28
    public function getValues(): array
29
    {
30
        return $this->expression->getValues();
31
    }
32
}
33