@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * @param string $data The data to analyze |
| 154 | 154 | * @param string $lineTerminator The line terminator char/sequence |
| 155 | 155 | * |
| 156 | - * @return array A two-row array containing quotechar, delimchar |
|
| 156 | + * @return string[] A two-row array containing quotechar, delimchar |
|
| 157 | 157 | */ |
| 158 | 158 | protected function sniffQuoteAndDelim($data, $lineTerminator) |
| 159 | 159 | { |
@@ -163,6 +163,8 @@ discard block |
||
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | 165 | * @todo To make this class more oop and test-friendly, implement strategy pattern here with each delim sniffing method implemented in its own strategy class. |
| 166 | + * @param string|false $data |
|
| 167 | + * @param string $lineTerminator |
|
| 166 | 168 | */ |
| 167 | 169 | protected function sniffDelimiter($data, $lineTerminator) |
| 168 | 170 | { |
@@ -177,11 +179,17 @@ discard block |
||
| 177 | 179 | return current($winners); |
| 178 | 180 | } |
| 179 | 181 | |
| 182 | + /** |
|
| 183 | + * @param string $eols |
|
| 184 | + */ |
|
| 180 | 185 | protected function sniffQuotingStyle($delimiter, $eols) |
| 181 | 186 | { |
| 182 | 187 | return Dialect::QUOTE_MINIMAL; |
| 183 | 188 | } |
| 184 | 189 | |
| 190 | + /** |
|
| 191 | + * @param string $eols |
|
| 192 | + */ |
|
| 185 | 193 | protected function sniffHeader($delimiter, $eols) |
| 186 | 194 | { |
| 187 | 195 | return true; |
@@ -13,15 +13,12 @@ |
||
| 13 | 13 | namespace CSVelte; |
| 14 | 14 | |
| 15 | 15 | use CSVelte\Contract\Streamable; |
| 16 | - |
|
| 17 | 16 | use CSVelte\Exception\SnifferException; |
| 18 | 17 | use CSVelte\Sniffer\SniffDelimiterByConsistency; |
| 19 | 18 | use CSVelte\Sniffer\SniffDelimiterByDistribution; |
| 20 | 19 | use CSVelte\Sniffer\SniffLineTerminatorByCount; |
| 21 | 20 | use CSVelte\Sniffer\SniffQuoteAndDelimByAdjacency; |
| 22 | -use Noz\Collection\Collection; |
|
| 23 | 21 | use function Noz\to_array; |
| 24 | -use RuntimeException; |
|
| 25 | 22 | |
| 26 | 23 | use function Noz\collect; |
| 27 | 24 | use function Stringy\create as s; |