@@ -92,7 +92,7 @@ |
||
| 92 | 92 | public function __invoke() |
| 93 | 93 | { |
| 94 | 94 | $list = new LList([ |
| 95 | - 'abc','def','ghi','jkl','mno' |
|
| 95 | + 'abc', 'def', 'ghi', 'jkl', 'mno' |
|
| 96 | 96 | ]); |
| 97 | 97 | $list(); // equivalent to pop() |
| 98 | 98 | $list($val); // equivalent to push() |
@@ -83,16 +83,12 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Invoke sequence. |
| 86 | - |
|
| 87 | 86 | * A sequence is invokable as if it were a function. This allows some pretty useful functionality such as negative |
| 88 | 87 | * indexing, sub-sequence selection, etc. Basically, any way you invoke a sequence, you're going to get back either |
| 89 | 88 | * a single value from the sequence or a subset of it. |
| 90 | - |
|
| 91 | 89 | * @internal param mixed $funk Either a numerical offset (positive or negative), a range string (start:end), or a |
| 92 | 90 | * callback to be used as a filter. |
| 93 | - |
|
| 94 | 91 | * @return mixed |
| 95 | - |
|
| 96 | 92 | * @todo Put all the slice logic into a helper function or several |
| 97 | 93 | */ |
| 98 | 94 | public function __invoke() |
@@ -360,12 +356,12 @@ discard block |
||
| 360 | 356 | * |
| 361 | 357 | * @return Sequence |
| 362 | 358 | */ |
| 363 | - public function prepend($item) |
|
| 364 | - { |
|
| 365 | - $arr = $this->getData(); |
|
| 366 | - array_unshift($arr, $item); |
|
| 367 | - return new static($arr); |
|
| 368 | - } |
|
| 359 | + public function prepend($item) |
|
| 360 | + { |
|
| 361 | + $arr = $this->getData(); |
|
| 362 | + array_unshift($arr, $item); |
|
| 363 | + return new static($arr); |
|
| 364 | + } |
|
| 369 | 365 | |
| 370 | 366 | /** |
| 371 | 367 | * Append item to collection. |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $count = $this->count(); |
| 104 | 104 | if (count($args)) { |
| 105 | 105 | // if there are more args... |
| 106 | - $length = array_shift($args); |
|
| 106 | + $length = array_shift($args); |
|
| 107 | 107 | } |
| 108 | 108 | if (Str::contains($offset, static::SLICE_DELIM)) { |
| 109 | 109 | list($start, $length) = get_range_start_end($offset, $count); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | public function isEmpty(callable $funk = null) |
| 414 | 414 | { |
| 415 | 415 | if (!is_null($funk)) { |
| 416 | - return $this->fold(function ($carry, $val) use ($funk) { |
|
| 416 | + return $this->fold(function($carry, $val) use ($funk) { |
|
| 417 | 417 | return $carry && $funk($val); |
| 418 | 418 | }, true); |
| 419 | 419 | } |