@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | { |
| 362 | 362 | return implode("\n", [ |
| 363 | 363 | static::class, |
| 364 | - ' array-mode:' . (int)$this->is_array, |
|
| 364 | + ' array-mode:' . (int) $this->is_array, |
|
| 365 | 365 | " codes:\n " . implode("\n ", $this->ops) |
| 366 | 366 | ]); |
| 367 | 367 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | private static function evaluate($_seed, $_vars, $_code, $_before, $_after) |
| 392 | 392 | { |
| 393 | - $_old_handler = set_error_handler(function($severity, $message, $file, $line){ |
|
| 393 | + $_old_handler = set_error_handler(function($severity, $message, $file, $line) { |
|
| 394 | 394 | throw new \ErrorException($message, 0, $severity, $file, $line); |
| 395 | 395 | }, E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED); |
| 396 | 396 | try { |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | array_unshift( |
| 420 | 420 | $ops, |
| 421 | 421 | '$_i = 0;', |
| 422 | - 'for (' . implode('; ', $seed). ') {', |
|
| 422 | + 'for (' . implode('; ', $seed) . ') {', |
|
| 423 | 423 | ' $_key = $_i;', |
| 424 | 424 | ' $_ = $_current;', |
| 425 | 425 | ' ++$_i;' |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | private $fn_cnt = 0; |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | - * @return \Spindle\Collection |
|
| 25 | + * @return Collection |
|
| 26 | 26 | */ |
| 27 | 27 | public static function from($iterable, $debug = null) |
| 28 | 28 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param int|string $end |
| 36 | 36 | * @param int $step |
| 37 | 37 | * @param bool $debug |
| 38 | - * @return \Spindle\Collection |
|
| 38 | + * @return Collection |
|
| 39 | 39 | */ |
| 40 | 40 | public static function range($start, $end, $step = 1, $debug = null) |
| 41 | 41 | { |
@@ -81,6 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | 83 | * @param iterable $seed |
| 84 | + * @param string $type |
|
| 84 | 85 | */ |
| 85 | 86 | public function __construct($seed, $debug = null, $type = null) |
| 86 | 87 | { |
@@ -215,6 +216,11 @@ discard block |
||
| 215 | 216 | ]; |
| 216 | 217 | } |
| 217 | 218 | |
| 219 | + /** |
|
| 220 | + * @param string $_code |
|
| 221 | + * @param string $_before |
|
| 222 | + * @param string $_after |
|
| 223 | + */ |
|
| 218 | 224 | private static function evaluate($_seed, $_vars, $_code, $_before, $_after) |
| 219 | 225 | { |
| 220 | 226 | $_old_handler = set_error_handler(function($severity, $message, $file, $line){ |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * @param string|callable $fn '$_carry + $_' |
| 41 | - * @param mixed $initial |
|
| 41 | + * @param integer $initial |
|
| 42 | 42 | * @return mixed |
| 43 | 43 | */ |
| 44 | 44 | public function reduce($fn, $initial = null) |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public function usortStable(callable $cmp) |
| 43 | 43 | { |
| 44 | 44 | $array = $this->map('[$_, $_i]')->toArray(); |
| 45 | - usort($array, static function ($a, $b) use ($cmp) { |
|
| 45 | + usort($array, static function($a, $b) use ($cmp) { |
|
| 46 | 46 | return $cmp($a[0], $b[0]) ?: ($a[1] - $b[1]); |
| 47 | 47 | }); |
| 48 | 48 | $sorted = new $this($array, $this->debug); |