@@ -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 |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * also optionally throw an OutOfBoundsException if no value is found. |
284 | 284 | * |
285 | 285 | * @param mixed $index The index of the data you want to get |
286 | - * @param mixed $default The default value to return if none available |
|
286 | + * @param null|integer $default The default value to return if none available |
|
287 | 287 | * @param bool $throw True if you want an exception to be thrown if no data found at $index |
288 | 288 | * |
289 | 289 | * @throws OutOfBoundsException If $throw is true and $index isn't found |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | * |
563 | 563 | * @param array $items Any number of arguments will be pushed onto the |
564 | 564 | * |
565 | - * @return mixed The first item in this collection |
|
565 | + * @return AbstractCollection The first item in this collection |
|
566 | 566 | */ |
567 | 567 | public function push(...$items) |
568 | 568 | { |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | * |
577 | 577 | * Returns a new collection with $items added. |
578 | 578 | * |
579 | - * @return mixed The first item in this collection |
|
579 | + * @return AbstractCollection The first item in this collection |
|
580 | 580 | */ |
581 | 581 | public function unshift(...$items) |
582 | 582 | { |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | /** |
639 | 639 | * Iterate over each item that matches criteria in callback. |
640 | 640 | * |
641 | - * @param Closure|callable $callback A callback to use |
|
641 | + * @param Closure $callback A callback to use |
|
642 | 642 | * @param object $bindTo The object to bind to |
643 | 643 | * |
644 | 644 | * @return AbstractCollection |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | /** |
756 | 756 | * Returns collection in reverse order. |
757 | 757 | * |
758 | - * @param null $preserveKeys True if you want to preserve collection's keys |
|
758 | + * @param boolean $preserveKeys True if you want to preserve collection's keys |
|
759 | 759 | * |
760 | 760 | * @return AbstractCollection This collection in reverse order. |
761 | 761 | */ |
@@ -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; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function writeLine($line, $eol = PHP_EOL) |
37 | 37 | { |
38 | - return $this->write($line . $eol); |
|
38 | + return $this->write($line.$eol); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | abstract public function isWritable(); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | public function __construct($fields) |
62 | 62 | { |
63 | 63 | $this->setFields($fields) |
64 | - ->rewind(); |
|
64 | + ->rewind(); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -242,7 +242,7 @@ |
||
242 | 242 | } elseif ($fields instanceof Iterator) { |
243 | 243 | $fields = iterator_to_array($fields); |
244 | 244 | } else { |
245 | - throw new InvalidArgumentException(__CLASS__ . ' requires an array, got: ' . gettype($fields)); |
|
245 | + throw new InvalidArgumentException(__CLASS__.' requires an array, got: '.gettype($fields)); |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 | $this->fields = collect($fields)->values(); |
@@ -21,7 +21,6 @@ |
||
21 | 21 | if (if $file->hasHeader()) { |
22 | 22 | $header = $file->getHeader() |
23 | 23 | } |
24 | - |
|
25 | 24 | * you can instead simply call $header->getHeader() and handle this exception if |
26 | 25 | * said file has no header |
27 | 26 | * |