@@ -82,7 +82,7 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | public function toArray() |
| 84 | 84 | { |
| 85 | - return array_map(function ($row) { |
|
| 85 | + return array_map(function($row) { |
|
| 86 | 86 | return $row->toArray(); |
| 87 | 87 | }, iterator_to_array($this)); |
| 88 | 88 | } |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | // ok we're opening a new stream resource handle |
| 187 | 187 | $this->setUri($uri) |
| 188 | - ->setMode($mode) |
|
| 189 | - ->setLazy($lazy) |
|
| 190 | - ->setUseIncludePath($use_include_path) |
|
| 191 | - ->setContext($context_options, $context_params); |
|
| 188 | + ->setMode($mode) |
|
| 189 | + ->setLazy($lazy) |
|
| 190 | + ->setUseIncludePath($use_include_path) |
|
| 191 | + ->setContext($context_options, $context_params); |
|
| 192 | 192 | if (!$this->isLazy()) { |
| 193 | 193 | $this->connect(); |
| 194 | 194 | } |
@@ -351,9 +351,9 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | $this->flag = ''; |
| 353 | 353 | $this->setBaseMode($base) |
| 354 | - ->setIsPlus($plus == '+') |
|
| 355 | - ->setIsText($flag == 't') |
|
| 356 | - ->setIsBinary($flag == 'b'); |
|
| 354 | + ->setIsPlus($plus == '+') |
|
| 355 | + ->setIsText($flag == 't') |
|
| 356 | + ->setIsBinary($flag == 'b'); |
|
| 357 | 357 | |
| 358 | 358 | return $this; |
| 359 | 359 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | { |
| 245 | 245 | if (!$this->isConnected()) { |
| 246 | 246 | $e = null; |
| 247 | - $errhandler = function () use (&$e) { |
|
| 247 | + $errhandler = function() use (&$e) { |
|
| 248 | 248 | $e = new IOException(sprintf( |
| 249 | 249 | 'Could not open connection for %s using mode %s', |
| 250 | 250 | $this->getUri(), |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | return $this; |
| 545 | 545 | } |
| 546 | - throw new InvalidArgumentException('Context options must be an array, got: ' . gettype($options)); |
|
| 546 | + throw new InvalidArgumentException('Context options must be an array, got: '.gettype($options)); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | /** |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | |
| 568 | 568 | return $this; |
| 569 | 569 | } |
| 570 | - throw new InvalidArgumentException('Context parameters must be an array, got: ' . gettype($params)); |
|
| 570 | + throw new InvalidArgumentException('Context parameters must be an array, got: '.gettype($params)); |
|
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | /** |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | if (is_null($lazy)) { |
| 897 | 897 | $lazy = true; |
| 898 | 898 | } |
| 899 | - $this->lazy = (bool) $lazy; |
|
| 899 | + $this->lazy = (bool) $lazy; |
|
| 900 | 900 | |
| 901 | 901 | return $this; |
| 902 | 902 | } |
@@ -165,7 +165,7 @@ |
||
| 165 | 165 | $top = substr($this->buffer, 0, $start); |
| 166 | 166 | $data = substr($this->buffer, $start, $length); |
| 167 | 167 | $bottom = substr($this->buffer, $start + $length); |
| 168 | - $this->buffer = $top . $bottom; |
|
| 168 | + $this->buffer = $top.$bottom; |
|
| 169 | 169 | |
| 170 | 170 | return $data; |
| 171 | 171 | } |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * also optionally throw an OutOfBoundsException if no value is found. |
| 283 | 283 | * |
| 284 | 284 | * @param mixed $index The index of the data you want to get |
| 285 | - * @param mixed $default The default value to return if none available |
|
| 285 | + * @param null|integer $default The default value to return if none available |
|
| 286 | 286 | * @param bool $throw True if you want an exception to be thrown if no data found at $index |
| 287 | 287 | * @throws OutOfBoundsException If $throw is true and $index isn't found |
| 288 | 288 | * @return mixed The data found at $index or failing that, the $default |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | * Returns a new collection with $items added. |
| 548 | 548 | * |
| 549 | 549 | * @param array $items Any number of arguments will be pushed onto the |
| 550 | - * @return mixed The first item in this collection |
|
| 550 | + * @return AbstractCollection The first item in this collection |
|
| 551 | 551 | */ |
| 552 | 552 | public function push(...$items) |
| 553 | 553 | { |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | * |
| 561 | 561 | * Returns a new collection with $items added. |
| 562 | 562 | * |
| 563 | - * @return mixed The first item in this collection |
|
| 563 | + * @return AbstractCollection The first item in this collection |
|
| 564 | 564 | */ |
| 565 | 565 | public function unshift(...$items) |
| 566 | 566 | { |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | /** |
| 617 | 617 | * Iterate over each item that matches criteria in callback |
| 618 | 618 | * |
| 619 | - * @param Closure|callable $callback A callback to use |
|
| 619 | + * @param Closure $callback A callback to use |
|
| 620 | 620 | * @param object $bindTo The object to bind to |
| 621 | 621 | * @return AbstractCollection |
| 622 | 622 | */ |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | /** |
| 725 | 725 | * Returns collection in reverse order. |
| 726 | 726 | * |
| 727 | - * @param null $preserveKeys True if you want to preserve collection's keys |
|
| 727 | + * @param boolean $preserveKeys True if you want to preserve collection's keys |
|
| 728 | 728 | * @return AbstractCollection This collection in reverse order. |
| 729 | 729 | */ |
| 730 | 730 | public function reverse($preserveKeys = null) |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | return $this->data[$index]; |
| 298 | 298 | } |
| 299 | 299 | if ($throw) { |
| 300 | - throw new OutOfBoundsException(__CLASS__ . ' could not find value at index ' . $index); |
|
| 300 | + throw new OutOfBoundsException(__CLASS__.' could not find value at index '.$index); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | return $default; |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | unset($this->data[$index]); |
| 339 | 339 | } else { |
| 340 | 340 | if ($throw) { |
| 341 | - throw new OutOfBoundsException('No value found at given index: ' . $index); |
|
| 341 | + throw new OutOfBoundsException('No value found at given index: '.$index); |
|
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | 344 | |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | public function contains($value, $index = null) |
| 495 | 495 | { |
| 496 | - return (bool) $this->first(function ($val, $key) use ($value, $index) { |
|
| 496 | + return (bool) $this->first(function($val, $key) use ($value, $index) { |
|
| 497 | 497 | if (is_callable($value)) { |
| 498 | 498 | $found = $value($val, $key); |
| 499 | 499 | } else { |
@@ -525,11 +525,11 @@ discard block |
||
| 525 | 525 | public function duplicates() |
| 526 | 526 | { |
| 527 | 527 | $dups = []; |
| 528 | - $this->walk(function ($val, $key) use (&$dups) { |
|
| 528 | + $this->walk(function($val, $key) use (&$dups) { |
|
| 529 | 529 | $dups[$val][] = $key; |
| 530 | 530 | }); |
| 531 | 531 | |
| 532 | - return static::factory($dups)->filter(function ($val) { |
|
| 532 | + return static::factory($dups)->filter(function($val) { |
|
| 533 | 533 | return count($val) > 1; |
| 534 | 534 | }); |
| 535 | 535 | } |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | public function pairs() |
| 672 | 672 | { |
| 673 | 673 | return static::factory(array_map( |
| 674 | - function ($key, $val) { |
|
| 674 | + function($key, $val) { |
|
| 675 | 675 | return [$key, $val]; |
| 676 | 676 | }, |
| 677 | 677 | array_keys($this->data), |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | } |
| 881 | 881 | } |
| 882 | 882 | // if row contains an array it isn't tabular |
| 883 | - if (array_reduce($row, function ($carry, $item) { |
|
| 883 | + if (array_reduce($row, function($carry, $item) { |
|
| 884 | 884 | return is_array($item) && $carry; |
| 885 | 885 | }, true)) { |
| 886 | 886 | return false; |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | protected function assertCorrectInputDataType($data) |
| 990 | 990 | { |
| 991 | 991 | if (!$this->isConsistentDataStructure($data)) { |
| 992 | - throw new InvalidArgumentException(__CLASS__ . ' expected traversable data, got: ' . gettype($data)); |
|
| 992 | + throw new InvalidArgumentException(__CLASS__.' expected traversable data, got: '.gettype($data)); |
|
| 993 | 993 | } |
| 994 | 994 | } |
| 995 | 995 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | return call_user_func_array([$column, $method], $args); |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | - throw new BadMethodCallException('Method does not exist: ' . __CLASS__ . "::{$method}()"); |
|
| 43 | + throw new BadMethodCallException('Method does not exist: '.__CLASS__."::{$method}()"); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | return static::factory($values); |
| 77 | 77 | } |
| 78 | 78 | if ($throw) { |
| 79 | - throw new OutOfBoundsException(__CLASS__ . ' could not find column: ' . $column); |
|
| 79 | + throw new OutOfBoundsException(__CLASS__.' could not find column: '.$column); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | return false; |