Completed
Push — 2.0 ( 1160ec...acba87 )
by Vermeulen
05:15
created

CommonList::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
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->list[] = $expr;
32
    }
33
}
34