| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class LimitFilter extends AbstractFilter |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @param array $results |
||
| 17 | * @param null $limitArray |
||
|
|
|||
| 18 | * @return array |
||
| 19 | */ |
||
| 20 | public static function filter(array $results, $limitArray = null) |
||
| 21 | { |
||
| 22 | if (is_array($limitArray) && count($limitArray)) { |
||
| 23 | return self::slice($results, $limitArray); |
||
| 24 | } |
||
| 25 | |||
| 26 | return $results; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param $results |
||
| 31 | * @param $limitArray |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | private static function slice($results, $limitArray) |
||
| 37 | } |
||
| 38 | } |
||
| 39 |