Alias::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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