Failed Conditions
Push — master ( 97035c...8e1da1 )
by Denis
02:24
created

Alias   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 57.14%

Importance

Changes 0
Metric Value
dl 0
loc 54
ccs 8
cts 14
cp 0.5714
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 5 1
A getExpr() 0 3 1
A __construct() 0 4 1
A getName() 0 3 1
A setExpr() 0 5 1
1
<?php declare(strict_types = 1);
2
3
namespace Artprima\QueryFilterBundle\QueryFilter\Config;
4
5
/**
6
 * Class Alias
7
 *
8
 * @author Denis Voytyuk <[email protected]>
9
 *
10
 * @package Artprima\QueryFilterBundle\QueryFilter\Config
11
 */
12
class Alias
13
{
14
    /**
15
     * @var string alias name, eg.: fullname
16
     */
17
    private $name;
18
19
    /**
20
     * @var string expression, eg.: concat(concat(concat(concat(p.firstname, ' '), p.middlename), ' '), p.lastname)
21
     */
22
    private $expr;
23
24 1
    public function __construct(string $name = null, string $expr = null)
25
    {
26 1
        $this->name = $name;
27 1
        $this->expr = $expr;
28 1
    }
29
30
    /**
31
     * @return string
32
     */
33 1
    public function getName(): string
34
    {
35 1
        return $this->name;
36
    }
37
38
    /**
39
     * @param string $name
40
     * @return Alias
41
     */
42
    public function setName(string $name): Alias
43
    {
44
        $this->name = $name;
45
46
        return $this;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 1
    public function getExpr(): string
53
    {
54 1
        return $this->expr;
55
    }
56
57
    /**
58
     * @param string $expr
59
     * @return Alias
60
     */
61
    public function setExpr(string $expr): Alias
62
    {
63
        $this->expr = $expr;
64
65
        return $this;
66
    }
67
}
68