Conditions | 5 |
Paths | 5 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function supports($target, string $mode): bool |
||
20 | { |
||
21 | if ($mode === self::MODE_APPLY_FILTER) { |
||
22 | return false; |
||
23 | } |
||
24 | |||
25 | // we can filter a collection |
||
26 | if ($mode === self::MODE_FILTER) { |
||
27 | return is_array($target) || $target instanceof \Traversable; |
||
28 | } |
||
29 | |||
30 | // and we know how to handle arrays and objects |
||
31 | return is_array($target) || is_object($target); |
||
32 | } |
||
33 | |||
62 |