CommonList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setSeparator() 0 4 1
A __invoke() 0 5 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->invokeCheckIsDisabled();
32
        
33
        $this->list[] = $expr;
34
    }
35
}
36