Completed
Push — master ( 906125...5fd544 )
by BENOIT
01:10
created

NegatedExpression::getValues()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
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
     * @var Expression
10
     */
11
    private $expression;
12
13
    /**
14
     * NegatedExpression constructor.
15
     * @param Expression $expression
16
     */
17
    protected function __construct(Expression $expression)
18
    {
19
        $this->expression = $expression;
20
    }
21
22
    /**
23
     * @inheritDoc
24
     */
25
    public function __toString(): string
26
    {
27
        return sprintf('NOT %s', $this->expression);
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    public function getValues(): array
34
    {
35
        return $this->expression->getValues();
36
    }
37
}
38