@@ -239,8 +239,12 @@ |
||
| 239 | 239 | { |
| 240 | 240 | $n = count($this); |
| 241 | 241 | |
| 242 | - if ($n < 2) return 0; |
|
| 243 | - if ($r < 0) return $n - (abs($r) % $n); |
|
| 242 | + if ($n < 2) { |
|
| 243 | + return 0; |
|
| 244 | + } |
|
| 245 | + if ($r < 0) { |
|
| 246 | + return $n - (abs($r) % $n); |
|
| 247 | + } |
|
| 244 | 248 | |
| 245 | 249 | return $r % $n; |
| 246 | 250 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | * Returns the result of associating all keys of a given traversable object |
| 113 | 113 | * or array with their corresponding values, as well as those of this map. |
| 114 | 114 | * |
| 115 | - * @param array|\Traversable $values |
|
| 115 | + * @param Map $values |
|
| 116 | 116 | * |
| 117 | 117 | * @return Map |
| 118 | 118 | */ |
@@ -24,6 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | /** |
| 26 | 26 | * Removes all values from the collection. |
| 27 | + * @return void |
|
| 27 | 28 | */ |
| 28 | 29 | public function clear(); |
| 29 | 30 | |
@@ -678,7 +679,7 @@ discard block |
||
| 678 | 679 | * Returns the result of associating all keys of a given traversable object |
| 679 | 680 | * or array with their corresponding values, as well as those of this map. |
| 680 | 681 | * |
| 681 | - * @param array|Traversable $values |
|
| 682 | + * @param Map $values |
|
| 682 | 683 | * |
| 683 | 684 | * @return Map |
| 684 | 685 | */ |
@@ -1642,6 +1643,7 @@ discard block |
||
| 1642 | 1643 | * @param int $capacity The number of values for which capacity should be |
| 1643 | 1644 | * allocated. Capacity will stay the same if this value |
| 1644 | 1645 | * is less than or equal to the current capacity. |
| 1646 | + * @return void |
|
| 1645 | 1647 | */ |
| 1646 | 1648 | public function allocate(int $capacity); |
| 1647 | 1649 | |
@@ -1650,6 +1652,7 @@ discard block |
||
| 1650 | 1652 | * return value as the new value. |
| 1651 | 1653 | * |
| 1652 | 1654 | * @param callable $callback Accepts the value, returns the new value. |
| 1655 | + * @return void |
|
| 1653 | 1656 | */ |
| 1654 | 1657 | public function apply(callable $callback); |
| 1655 | 1658 | |
@@ -1721,6 +1724,7 @@ discard block |
||
| 1721 | 1724 | * @param mixed ...$values |
| 1722 | 1725 | * |
| 1723 | 1726 | * @throws \OutOfRangeException if the index is not in the range [0, n] |
| 1727 | + * @return void |
|
| 1724 | 1728 | */ |
| 1725 | 1729 | public function insert(int $index, ...$values); |
| 1726 | 1730 | |
@@ -1775,6 +1779,7 @@ discard block |
||
| 1775 | 1779 | * Adds zero or more values to the end of the sequence. |
| 1776 | 1780 | * |
| 1777 | 1781 | * @param mixed ...$values |
| 1782 | + * @return void |
|
| 1778 | 1783 | */ |
| 1779 | 1784 | public function push(...$values); |
| 1780 | 1785 | |
@@ -1804,6 +1809,7 @@ discard block |
||
| 1804 | 1809 | |
| 1805 | 1810 | /** |
| 1806 | 1811 | * Reverses the sequence in-place. |
| 1812 | + * @return void |
|
| 1807 | 1813 | */ |
| 1808 | 1814 | public function reverse(); |
| 1809 | 1815 | |
@@ -1820,6 +1826,7 @@ discard block |
||
| 1820 | 1826 | * positive, or 'pop' and 'unshift' if negative. |
| 1821 | 1827 | * |
| 1822 | 1828 | * @param int $rotations The number of rotations (can be negative). |
| 1829 | + * @return void |
|
| 1823 | 1830 | */ |
| 1824 | 1831 | public function rotate(int $rotations); |
| 1825 | 1832 | |
@@ -1830,6 +1837,7 @@ discard block |
||
| 1830 | 1837 | * @param mixed $value |
| 1831 | 1838 | * |
| 1832 | 1839 | * @throws \OutOfRangeException if the index is not in the range [0, size-1] |
| 1840 | + * @return void |
|
| 1833 | 1841 | */ |
| 1834 | 1842 | public function set(int $index, $value); |
| 1835 | 1843 | |
@@ -1870,6 +1878,7 @@ discard block |
||
| 1870 | 1878 | * |
| 1871 | 1879 | * @param callable|null $comparator Accepts two values to be compared. |
| 1872 | 1880 | * Should return the result of a <=> b. |
| 1881 | + * @return void |
|
| 1873 | 1882 | */ |
| 1874 | 1883 | public function sort(callable $comparator = null); |
| 1875 | 1884 | |
@@ -1895,6 +1904,7 @@ discard block |
||
| 1895 | 1904 | * Adds zero or more values to the front of the sequence. |
| 1896 | 1905 | * |
| 1897 | 1906 | * @param mixed ...$values |
| 1907 | + * @return void |
|
| 1898 | 1908 | */ |
| 1899 | 1909 | public function unshift(...$values); |
| 1900 | 1910 | } |