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