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

GroupExpression   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 4 1
A getValues() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace BenTools\Where\Expression;
5
6
final class GroupExpression extends Expression
7
{
8
    /**
9
     * @var Expression
10
     */
11
    private $expression;
12
13
    /**
14
     * GroupExpression 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('(%s)', $this->expression);
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    public function getValues(): array
34
    {
35
        return $this->expression->getValues();
36
    }
37
}
38