Completed
Branch releases/v0.2.2 (1aa4be)
by Luke
03:21 queued 01:01
created
src/CSVelte/Flavor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      */
205 205
     public function __set($attr, $val)
206 206
     {
207
-        throw new ImmutableException('Cannot change attributes on an immutable object: ' . self::class . '::$' . $attr);
207
+        throw new ImmutableException('Cannot change attributes on an immutable object: '.self::class.'::$'.$attr);
208 208
     }
209 209
 
210 210
     /**
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     protected function assertValidAttribute($attr)
271 271
     {
272 272
         if (!property_exists(self::class, $attr)) {
273
-            throw new InvalidArgumentException('Unknown attribute: ' . $attr);
273
+            throw new InvalidArgumentException('Unknown attribute: '.$attr);
274 274
         }
275 275
     }
276 276
 }
Please login to merge, or discard this patch.
src/CSVelte/Traits/IsReadable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
             }
61 61
             $buffer .= $byte;
62 62
             // Break when a new line is found or the max length - 1 is reached
63
-            if (array_reduce($eol, function ($carry, $eol) use ($buffer) {
63
+            if (array_reduce($eol, function($carry, $eol) use ($buffer) {
64 64
                 if (!$carry) {
65 65
                     $eollen = 0 - strlen($eol);
66 66
 
Please login to merge, or discard this patch.
src/CSVelte/Collection/TabularCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
             return static::factory($values);
63 63
         }
64 64
         if ($throw) {
65
-            throw new OutOfBoundsException(__CLASS__ . " could not find column: " . $column);
65
+            throw new OutOfBoundsException(__CLASS__." could not find column: ".$column);
66 66
         }
67 67
         return false;
68 68
     }
Please login to merge, or discard this patch.
src/CSVelte/Reader/FilteredIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/CSVelte/IO/StreamResource.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/CSVelte/IO/BufferStream.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/CSVelte/Collection.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
             }
371 371
             $i++;
372 372
         }
373
-        throw new OutOfBoundsException('Collection data does not contain a key at given position: ' . $pos);
373
+        throw new OutOfBoundsException('Collection data does not contain a key at given position: '.$pos);
374 374
     }
375 375
 
376 376
     /**
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
             return $this->data[$key];
576 576
         }
577 577
         if ($throwExc) {
578
-            throw new OutOfBoundsException('Collection data does not contain value for given key: ' . $key);
578
+            throw new OutOfBoundsException('Collection data does not contain value for given key: '.$key);
579 579
         }
580 580
         
581 581
         return $default;
@@ -928,11 +928,11 @@  discard block
 block discarded – undo
928 928
     public function duplicates()
929 929
     {
930 930
         $dups = [];
931
-        $this->walk(function ($val, $key) use (&$dups) {
931
+        $this->walk(function($val, $key) use (&$dups) {
932 932
             $dups[$val][] = $key;
933 933
         });
934 934
 
935
-        return (new self($dups))->filter(function ($val) {
935
+        return (new self($dups))->filter(function($val) {
936 936
             return count($val) > 1;
937 937
         });
938 938
     }
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
     public function pairs($alt = false)
963 963
     {
964 964
         return new self(array_map(
965
-            function ($key, $val) use ($alt) {
965
+            function($key, $val) use ($alt) {
966 966
                 if ($alt) {
967 967
                     return [$key => $val];
968 968
                 }
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
         if (false !== ($condRet = $this->if2DMapInternalMethod(__METHOD__))) {
1049 1049
             return $condRet;
1050 1050
         }
1051
-        $strvals = $this->map(function ($val) {
1051
+        $strvals = $this->map(function($val) {
1052 1052
             return (string) $val;
1053 1053
         });
1054 1054
         $this->assertNumericValues();
@@ -1171,9 +1171,9 @@  discard block
 block discarded – undo
1171 1171
     {
1172 1172
         $this->assertIsTabular();
1173 1173
 
1174
-        return $this->sort(function ($a, $b) use ($key, $cmp) {
1174
+        return $this->sort(function($a, $b) use ($key, $cmp) {
1175 1175
             if (!isset($a[$key]) || !isset($b[$key])) {
1176
-                throw new RuntimeException('Cannot order collection by non-existant key: ' . $key);
1176
+                throw new RuntimeException('Cannot order collection by non-existant key: '.$key);
1177 1177
             }
1178 1178
             if (is_null($cmp)) {
1179 1179
                 return strcasecmp($a[$key], $b[$key]);
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
      */
1208 1208
     public function is2D()
1209 1209
     {
1210
-        return !$this->contains(function ($val) {
1210
+        return !$this->contains(function($val) {
1211 1211
             return !is_array($val);
1212 1212
         });
1213 1213
     }
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
             // look through each item in the collection and if an array, grab its keys
1227 1227
             // and throw them in an array to be analyzed later...
1228 1228
             $test = [];
1229
-            $this->walk(function ($val, $key) use (&$test) {
1229
+            $this->walk(function($val, $key) use (&$test) {
1230 1230
                 if (is_array($val)) {
1231 1231
                     $test[$key] = array_keys($val);
1232 1232
 
@@ -1298,7 +1298,7 @@  discard block
 block discarded – undo
1298 1298
             if (count($method) == 2) {
1299 1299
                 $method = $method[1];
1300 1300
 
1301
-                return $this->map(function ($val) use ($method) {
1301
+                return $this->map(function($val) use ($method) {
1302 1302
                     return (new self($val))->$method();
1303 1303
                 });
1304 1304
             }
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
 
1333 1333
     protected function assertNumericValues()
1334 1334
     {
1335
-        if ($this->contains(function ($val) {
1335
+        if ($this->contains(function($val) {
1336 1336
             return !is_numeric($val);
1337 1337
         })) {
1338 1338
             // can't average non-numeric data
@@ -1348,6 +1348,6 @@  discard block
 block discarded – undo
1348 1348
         if (is_null($data) || is_array($data) || $data instanceof Iterator) {
1349 1349
             return;
1350 1350
         }
1351
-        throw new InvalidArgumentException('Invalid type for collection data: ' . gettype($data));
1351
+        throw new InvalidArgumentException('Invalid type for collection data: '.gettype($data));
1352 1352
     }
1353 1353
 }
Please login to merge, or discard this patch.