| Conditions | 3 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 1 | public function __invoke($collection, $values) |
|
| 18 | { |
||
| 19 | 1 | $collection = clone $collection; |
|
| 20 | |||
| 21 | 1 | if (!is_array($values)) { |
|
| 22 | 1 | $values = iterator_to_array($values); |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | $current = $collection->getArrayCopy(); |
|
| 26 | |||
| 27 | 1 | if ($this->isAssoc($current)) { |
|
| 28 | 1 | $values = array_diff_assoc($current, $values); |
|
| 29 | } else { |
||
| 30 | 1 | $values = array_diff($current, $values); |
|
| 31 | } |
||
| 32 | |||
| 33 | 1 | $collection->exchangeArray($values); |
|
| 34 | |||
| 35 | 1 | return $collection; |
|
| 36 | } |
||
| 37 | |||
| 51 |