Completed
Push — master ( 748f90...5c1aea )
by Luke
08:07
created
src/CSVelte/Writer.php 1 patch
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * likely buffer the output so that this may be called after writeRows()
91 91
      *
92 92
      * @param \Iterator|array A list of header values
93
-     * @return boolean
93
+     * @return boolean|null
94 94
      * @throws \CSVelte\Exception\WriterException
95 95
      */
96 96
     public function setHeaderRow($headers)
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      * This means taking an array of data, and converting it to a Row object
162 162
      *
163 163
      * @param \Iterator|array of data items
164
-     * @return CSVelte\Table\AbstractRow
164
+     * @return Row
165 165
      * @access protected
166 166
      */
167 167
     protected function prepareRow(Iterator $row)
@@ -189,6 +189,9 @@  discard block
 block discarded – undo
189 189
         return $this->quoteString($data);
190 190
     }
191 191
 
192
+    /**
193
+     * @param string $str
194
+     */
192 195
     protected function quoteString($str)
193 196
     {
194 197
         $flvr = $this->getFlavor();
Please login to merge, or discard this patch.
src/CSVelte/Taster.php 2 patches
Doc Comments   +6 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,6 +165,7 @@  discard block
 block discarded – undo
165 165
      * replaceQuotedSpecialChars method which (at least to me) makes more sense.
166 166
      *
167 167
      * @param string The string to replace quoted strings within
168
+     * @param string $data
168 169
      * @return string The input string with quoted strings removed
169 170
      * @access protected
170 171
      * @todo Replace code that uses this method with the replaceQuotedSpecialChars
@@ -414,7 +415,7 @@  discard block
 block discarded – undo
414 415
      * Determine whether a particular string of data has quotes around it.
415 416
      *
416 417
      * @param string The data to check
417
-     * @return boolean Whether the data is quoted or not
418
+     * @return integer Whether the data is quoted or not
418 419
      * @access protected
419 420
      */
420 421
     protected function isQuoted($data)
@@ -464,6 +465,8 @@  discard block
 block discarded – undo
464 465
      *
465 466
      * @param string The string to do the replacements on
466 467
      * @param string The delimiter character to replace
468
+     * @param string $data
469
+     * @param string $delim
467 470
      * @return string The data with replacements performed
468 471
      * @access protected
469 472
      * @todo I could probably pass in (maybe optionally) the newline character I
@@ -490,6 +493,7 @@  discard block
 block discarded – undo
490 493
      * to be practical.
491 494
      *
492 495
      * @param string The string of data to check the type of
496
+     * @param string $data
493 497
      * @return string One of the TYPE_ string constants above
494 498
      * @access protected
495 499
      * @uses \Carbon\Carbon date/time ilbrary/class
@@ -546,6 +550,7 @@  discard block
 block discarded – undo
546 550
      * @param string $delim The CSV data's delimiting char (can be a variety of chars but)
547 551
      *     typically $eol is either a comma or a tab, sometimes a pipe)
548 552
      * @param string The CSV data's end-of-line char(s) (\n \r or \r\n)
553
+     * @param string $eol
549 554
      * @return boolean True if the data (most likely) contains a header row
550 555
      * @access public
551 556
      * @todo This method needs a total refactor. It's not necessary to loop twice
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -261,20 +261,20 @@
 block discarded – undo
261 261
         throw new TasterException("quoteChar and delimiter cannot be determined", TasterException::ERR_QUOTE_AND_DELIM);
262 262
     }
263 263
 
264
-     /**
265
-      * Take a list of likely delimiter characters and find the one that occurs
266
-      * the most consistent amount of times within the provided data.
267
-      *
268
-      * @param string The character(s) used for newlines
269
-      * @return string One of four Flavor::QUOTING_* constants
270
-      * @see \CSVelte\Flavor for possible quote style constants
271
-      * @access protected
272
-      * @todo Refactor this method--It needs more thorough testing against a wider
273
-      *     variety of CSV data to be sure it works reliably. And I'm sure there
274
-      *     are many performance and logic improvements that could be made. This
275
-      *     is essentially a first draft.
276
-      * @todo Use replaceQuotedSpecialChars rather than removeQuotedStrings
277
-      */
264
+        /**
265
+         * Take a list of likely delimiter characters and find the one that occurs
266
+         * the most consistent amount of times within the provided data.
267
+         *
268
+         * @param string The character(s) used for newlines
269
+         * @return string One of four Flavor::QUOTING_* constants
270
+         * @see \CSVelte\Flavor for possible quote style constants
271
+         * @access protected
272
+         * @todo Refactor this method--It needs more thorough testing against a wider
273
+         *     variety of CSV data to be sure it works reliably. And I'm sure there
274
+         *     are many performance and logic improvements that could be made. This
275
+         *     is essentially a first draft.
276
+         * @todo Use replaceQuotedSpecialChars rather than removeQuotedStrings
277
+         */
278 278
     protected function lickDelimiter($eol = "\n")
279 279
     {
280 280
         $delimiters = array(",", "\t", "|", ":", ";", "/", '\\');
Please login to merge, or discard this patch.
src/CSVelte/Reader.php 2 patches
Doc Comments   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      * accept any string (or any object with a __toString() method), or an
128 128
      * SplFileObject, so long as it represents a file rather than a directory. 
129 129
      *
130
-     * @param \CSVelte\Contract\Readable|object|string|SplFileObject $input See description
130
+     * @param Readable $input See description
131 131
      * @return $this
132 132
      */
133 133
     protected function setSource($input)
@@ -328,6 +328,9 @@  discard block
 block discarded – undo
328 328
      * @todo This actually shouldn't even be necessary. Characters should be read
329 329
      *     in one at a time and a quote that follows another should just be ignored
330 330
      *     deeming this unnecessary.
331
+     * @param string $str
332
+     * @param string $esc
333
+     * @param string $quo
331 334
      */
332 335
     protected function unEscape($str, $esc, $quo)
333 336
     {
@@ -338,6 +341,7 @@  discard block
 block discarded – undo
338 341
      * Parse a line of CSV data into an array of columns
339 342
      *
340 343
      * @param string A line of CSV data to parse
344
+     * @param string $line
341 345
      * @return array An array of columns
342 346
      * @access protected
343 347
      * @internal
@@ -417,7 +421,7 @@  discard block
 block discarded – undo
417 421
     /**
418 422
      * Retrieve header row.
419 423
      *
420
-     * @return CSVelte\Table\HeaderRow|null The header row if there is one
424
+     * @return HeaderRow The header row if there is one
421 425
      */
422 426
     public function header()
423 427
     {
@@ -458,7 +462,7 @@  discard block
 block discarded – undo
458 462
     /**
459 463
      * Returns an iterator with rows from user-supplied filter functions removed
460 464
      *
461
-     * @return CSVelte\Reader\FilteredReader An iterator with filtered rows
465
+     * @return FilteredReader An iterator with filtered rows
462 466
      */
463 467
     public function filter()
464 468
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,8 @@
 block discarded – undo
91 91
     public function __construct($input, $flavor = null)
92 92
     {
93 93
         $this->setSource($input)
94
-             ->setFlavor($flavor)
95
-             ->rewind();
94
+                ->setFlavor($flavor)
95
+                ->rewind();
96 96
     }
97 97
 
98 98
     /**
Please login to merge, or discard this patch.
src/CSVelte/Table/AbstractRow.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
     public function __construct($fields)
57 57
     {
58 58
         $this->setFields($fields)
59
-             ->rewind();
59
+                ->rewind();
60 60
     }
61 61
 
62 62
     protected function setFields($fields)
Please login to merge, or discard this patch.
src/CSVelte/Exception/HeaderException.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 if (if $file->hasHeader()) {
20 20
     $header = $file->getHeader()
21 21
 }
22
-
23 22
  * you can instead simply call $header->getHeader() and handle this exception if
24 23
  * said file has no header
25 24
  *
Please login to merge, or discard this patch.