| @@ -91,7 +91,7 @@ | ||
| 91 | 91 | * | 
| 92 | 92 | * @param string $data The data to check | 
| 93 | 93 | * | 
| 94 | - * @return bool | |
| 94 | + * @return integer | |
| 95 | 95 | */ | 
| 96 | 96 | protected function isQuoted($data) | 
| 97 | 97 |      { | 
| @@ -19,17 +19,17 @@ | ||
| 19 | 19 | |
| 20 | 20 | class SniffQuoteStyle extends AbstractSniffer | 
| 21 | 21 |  { | 
| 22 | - /** | |
| 23 | - * Guess quoting style | |
| 24 | - * | |
| 25 | - * The quoting style refers to which types of columns are quoted within a csv dataset. The dialect class defines | |
| 26 | - * four possible quoting styles; all, none, minimal, or non-numeric. This class attempts to determine which of those | |
| 27 | - * four it is by analyzing the content within each quoted value. | |
| 28 | - * | |
| 29 | - * @param string $data The data to analyze | |
| 30 | - * | |
| 31 | - * @return int | |
| 32 | - */ | |
| 22 | + /** | |
| 23 | + * Guess quoting style | |
| 24 | + * | |
| 25 | + * The quoting style refers to which types of columns are quoted within a csv dataset. The dialect class defines | |
| 26 | + * four possible quoting styles; all, none, minimal, or non-numeric. This class attempts to determine which of those | |
| 27 | + * four it is by analyzing the content within each quoted value. | |
| 28 | + * | |
| 29 | + * @param string $data The data to analyze | |
| 30 | + * | |
| 31 | + * @return int | |
| 32 | + */ | |
| 33 | 33 | public function sniff($data) | 
| 34 | 34 |      { | 
| 35 | 35 | $styles = collect([ | 
| @@ -64,7 +64,7 @@ | ||
| 64 | 64 |          if (is_null($eol)) { | 
| 65 | 65 | $eol = "\r\n|\r|\n"; | 
| 66 | 66 | } | 
| 67 | -        return preg_replace_callback('/([\'"])(.*)\1/imsU', function ($matches) use ($delim, $eol) { | |
| 67 | +        return preg_replace_callback('/([\'"])(.*)\1/imsU', function($matches) use ($delim, $eol) { | |
| 68 | 68 |              $ret = preg_replace("/({$eol})/", static::PLACEHOLDER_NEWLINE, $matches[0]); | 
| 69 | 69 |              if (!is_null($delim)) { | 
| 70 | 70 | $ret = str_replace($delim, static::PLACEHOLDER_DELIM, $ret); | 
| @@ -18,19 +18,19 @@ | ||
| 18 | 18 | |
| 19 | 19 | class SniffHeaderByDataType extends AbstractSniffer | 
| 20 | 20 |  { | 
| 21 | - /** | |
| 22 | - * Guess whether there is a header row | |
| 23 | - * | |
| 24 | - * Guesses whether the data has a header row by comparing the data types of the first row with the types of | |
| 25 | - * corresponding columns in other rows. | |
| 26 | - * | |
| 27 | - * @note Unlike the original version of this method, this one will be used to ALSO determine HOW MANY header rows | |
| 28 | - * there likely are. So, compare the header to rows at the END of the sample. | |
| 29 | - * | |
| 30 | - * @param string $data The data to analyze | |
| 31 | - * | |
| 32 | - * @return bool | |
| 33 | - */ | |
| 21 | + /** | |
| 22 | + * Guess whether there is a header row | |
| 23 | + * | |
| 24 | + * Guesses whether the data has a header row by comparing the data types of the first row with the types of | |
| 25 | + * corresponding columns in other rows. | |
| 26 | + * | |
| 27 | + * @note Unlike the original version of this method, this one will be used to ALSO determine HOW MANY header rows | |
| 28 | + * there likely are. So, compare the header to rows at the END of the sample. | |
| 29 | + * | |
| 30 | + * @param string $data The data to analyze | |
| 31 | + * | |
| 32 | + * @return bool | |
| 33 | + */ | |
| 34 | 34 | public function sniff($data) | 
| 35 | 35 |      { | 
| 36 | 36 |          $delimiter = $this->getOption('delimiter'); | 
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | return s($this->replaceQuotedSpecialChars($line, $delimiter)); | 
| 41 | 41 | }); | 
| 42 | 42 | $header = collect($lines->shift()->split($delimiter)) | 
| 43 | -            ->map(function($val){ return $this->unQuote($val); }) | |
| 43 | +            ->map(function($val) { return $this->unQuote($val); }) | |
| 44 | 44 |              ->map(function($val) { | 
| 45 | 45 | return [ | 
| 46 | 46 | 'type' => $this->getType($val), | 
| @@ -142,7 +142,7 @@ | ||
| 142 | 142 | $d = $this->getDialect(); | 
| 143 | 143 | $fields = collect(s($line) | 
| 144 | 144 | ->trimRight($d->getLineTerminator()) | 
| 145 | - ->split($d->getDelimiter() . "(?=([^\"]*\"[^\"]*\")*[^\"]*$)")); | |
| 145 | + ->split($d->getDelimiter()."(?=([^\"]*\"[^\"]*\")*[^\"]*$)")); | |
| 146 | 146 |          if (!is_null($this->header)) { | 
| 147 | 147 | $fields = $fields->rekey($this->header); | 
| 148 | 148 | } |