@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function offsetGet($offset): int |
| 54 | 54 | { |
| 55 | - return (int)$this->_offsetGet($offset); |
|
| 55 | + return (int) $this->_offsetGet($offset); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function getValueByIndex(int $index): int |
| 21 | 21 | { |
| 22 | - return $this->start + $index * $this->step; |
|
| 22 | + return $this->start+$index*$this->step; |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function getValueByIndex(int $index): float |
| 21 | 21 | { |
| 22 | - return $this->start * ($this->step ** $index); |
|
| 22 | + return $this->start*($this->step ** $index); |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function getValueByIndex(int $index): float |
| 21 | 21 | { |
| 22 | - return $this->start + $index * $this->step; |
|
| 22 | + return $this->start+$index*$this->step; |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function offsetSet($offset, $value): void |
| 67 | 67 | { |
| 68 | - if($offset === null) { |
|
| 68 | + if ($offset === null) { |
|
| 69 | 69 | $this->source[] = $value; |
| 70 | 70 | } else { |
| 71 | 71 | $range = $this->getRange(); |
| 72 | - if(isset($range[$offset])) { |
|
| 72 | + if (isset($range[$offset])) { |
|
| 73 | 73 | $index = $range[$offset]; |
| 74 | 74 | $this->source[$index] = $value; |
| 75 | 75 | } else { |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function offsetUnset($offset): void |
| 85 | 85 | { |
| 86 | 86 | $range = $this->getRange(); |
| 87 | - if(isset($range[$offset])) { |
|
| 87 | + if (isset($range[$offset])) { |
|
| 88 | 88 | $index = $range[$offset]; |
| 89 | 89 | unset($this->source[$index]); |
| 90 | 90 | $this->source = array_values($this->source); |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function getValueByIndex(int $index): int |
| 17 | 17 | { |
| 18 | - return (int)($this->start * ($this->step ** $index)); |
|
| 18 | + return (int) ($this->start*($this->step ** $index)); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function offsetExists($offset): bool |
| 21 | 21 | { |
| 22 | - if(!is_int($offset)) { |
|
| 22 | + if (!is_int($offset)) { |
|
| 23 | 23 | return false; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if(!$this->isInfinite()) { |
|
| 27 | - if($offset >= 0) { |
|
| 26 | + if (!$this->isInfinite()) { |
|
| 27 | + if ($offset >= 0) { |
|
| 28 | 28 | return $offset < count($this); |
| 29 | 29 | } |
| 30 | 30 | return abs($offset) <= count($this); |
@@ -72,21 +72,21 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | protected function _offsetGet($offset): float |
| 74 | 74 | { |
| 75 | - if(!$this->offsetExists($offset)) { |
|
| 75 | + if (!$this->offsetExists($offset)) { |
|
| 76 | 76 | throw new OutOfRangeException(); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** @var int $offset */ |
| 80 | 80 | |
| 81 | - if($this->isInfinite()) { |
|
| 81 | + if ($this->isInfinite()) { |
|
| 82 | 82 | return $this->getValueByIndex($offset); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if($offset < 0) { |
|
| 86 | - $offset = $this->size + ($offset % $this->size); |
|
| 85 | + if ($offset < 0) { |
|
| 86 | + $offset = $this->size+($offset%$this->size); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $offset = ($offset % $this->size); |
|
| 89 | + $offset = ($offset%$this->size); |
|
| 90 | 90 | |
| 91 | 91 | return $this->getValueByIndex($offset); |
| 92 | 92 | } |