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

WhereList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 31
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 2
1
<?php
2
3
namespace BfwSql\Queries\Parts;
4
5
class WhereList extends CommonList
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    protected $partPrefix = 'WHERE';
11
    
12
    /**
13
     * {@inheritdoc}
14
     */
15
    protected $separator = ' AND ';
16
    
17
    /**
18
     * Magic method __invoke, used when the user call object like a function
19
     * @link http://php.net/manual/en/language.oop5.magic.php#object.invoke
20
     * 
21
     * @param string $expr The expression
22
     * @param array|null $preparedParams (default: null) params to use for this
23
     *  expression in case of prepared request.
24
     * 
25
     * @return void
26
     */
27
    public function __invoke(string $expr, $preparedParams = null)
28
    {
29
        parent::__invoke($expr);
30
        
31
        if ($preparedParams !== null) {
32
            $this->querySystem->addPreparedParams($preparedParams);
33
        }
34
    }
35
}
36