CommonList::setSeparator()   A
last analyzed

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 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BfwSql\Queries\Parts;
4
5
class CommonList extends AbstractList
6
{
7
    /**
8
     * Setter accessor to property separator
9
     * Because if a common list, the separator can be different for all case.
10
     * 
11
     * @param string $separator The new separator to use
12
     * 
13
     * @return $this
14
     */
15
    public function setSeparator(string $separator): self
16
    {
17
        $this->separator = $separator;
18
        return $this;
19
    }
20
    
21
    /**
22
     * Magic method __invoke, used when the user call object like a function
23
     * @link http://php.net/manual/en/language.oop5.magic.php#object.invoke
24
     * 
25
     * @param string $expr The new expression to add into the list
26
     * 
27
     * @return void
28
     */
29
    public function __invoke(string $expr)
30
    {
31
        $this->invokeCheckIsDisabled();
32
        
33
        $this->list[] = $expr;
34
    }
35
}
36