Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
36 | 180 | public function accept() |
|
37 | { |
||
38 | 180 | $item = $this->getInnerIterator()->current(); |
|
39 | |||
40 | // Disclose items not implementing SalesmanIdProviderInterface |
||
41 | 180 | if (!$item instanceOf SalesmanIdProviderInterface) { |
|
42 | 60 | return false; |
|
43 | } |
||
44 | |||
45 | // Cast to array |
||
46 | 120 | $item_salesman_id = $item->getSalesmanId(); |
|
47 | 120 | if (!is_array($item_salesman_id)) { |
|
48 | 120 | $item_salesman_id = array( $item_salesman_id ); |
|
49 | } |
||
50 | |||
51 | // Check intersection |
||
52 | 120 | return !empty(array_intersect($this->salesman_filter, $item_salesman_id)); |
|
53 | } |
||
54 | } |
||
55 |