| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2.032 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 71 | 4 | protected function doShift($length = 1) |
|
| 72 | { |
||
| 73 | 4 | $parameters = []; |
|
| 74 | |||
| 75 | 4 | if (0 > $length) { |
|
| 76 | $parameters[] = ['start' => abs($length), 'end' => null]; |
||
| 77 | $parameters[] = ['start' => 0, 'end' => abs($length)]; |
||
| 78 | } else { |
||
| 79 | 4 | $parameters[] = ['start' => -1 * $length, 'end' => null]; |
|
| 80 | 4 | $parameters[] = ['start' => 0, 'end' => $this->datasetCount + $length * -1]; |
|
| 81 | } |
||
| 82 | |||
| 83 | 4 | $this->current = array_merge( |
|
| 84 | 4 | array_slice($this->current, $parameters[0]['start'], $parameters[0]['end']), |
|
| 85 | 4 | array_slice($this->current, $parameters[1]['start'], $parameters[1]['end']) |
|
| 86 | ); |
||
| 89 |