Passed
Pull Request — master (#183)
by Luke
03:12
created
src/CSVelte/Sniffer.php 3 patches
Doc Comments   +13 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      * @param string $data The data to analyze
156 156
      * @param string $lineTerminator The line terminator char/sequence
157 157
      *
158
-     * @return array A two-row array containing quotechar, delimchar
158
+     * @return string[] A two-row array containing quotechar, delimchar
159 159
      */
160 160
     protected function sniffQuoteAndDelim($data, $lineTerminator)
161 161
     {
@@ -163,6 +163,10 @@  discard block
 block discarded – undo
163 163
         return $sniffer->sniff($data);
164 164
     }
165 165
 
166
+    /**
167
+     * @param string|false $data
168
+     * @param string $lineTerminator
169
+     */
166 170
     protected function sniffDelimiter($data, $lineTerminator)
167 171
     {
168 172
         $delimiters = $this->getPossibleDelimiters();
@@ -176,12 +180,20 @@  discard block
 block discarded – undo
176 180
         return current($winners);
177 181
     }
178 182
 
183
+    /**
184
+     * @param string|false $data
185
+     * @param string $lineTerminator
186
+     */
179 187
     protected function sniffQuotingStyle($data, $delimiter, $lineTerminator)
180 188
     {
181 189
         $sniffer = new SniffQuoteStyle(compact( 'lineTerminator', 'delimiter'));
182 190
         return $sniffer->sniff($data);
183 191
     }
184 192
 
193
+    /**
194
+     * @param string|false $data
195
+     * @param string $lineTerminator
196
+     */
185 197
     protected function sniffHasHeader($data, $delimiter, $lineTerminator)
186 198
     {
187 199
         $sniffer = new SniffHeaderByDataType(compact(  'lineTerminator', 'delimiter'));
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@  discard block
 block discarded – undo
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;
@@ -21,9 +20,7 @@  discard block
 block discarded – undo
21 20
 use CSVelte\Sniffer\SniffLineTerminatorByCount;
22 21
 use CSVelte\Sniffer\SniffQuoteAndDelimByAdjacency;
23 22
 use CSVelte\Sniffer\SniffQuoteStyle;
24
-use Noz\Collection\Collection;
25 23
 use function Noz\to_array;
26
-use RuntimeException;
27 24
 
28 25
 use function Noz\collect;
29 26
 use function Stringy\create as s;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -178,13 +178,13 @@
 block discarded – undo
178 178
 
179 179
     protected function sniffQuotingStyle($data, $delimiter, $lineTerminator)
180 180
     {
181
-        $sniffer = new SniffQuoteStyle(compact( 'lineTerminator', 'delimiter'));
181
+        $sniffer = new SniffQuoteStyle(compact('lineTerminator', 'delimiter'));
182 182
         return $sniffer->sniff($data);
183 183
     }
184 184
 
185 185
     protected function sniffHasHeader($data, $delimiter, $lineTerminator)
186 186
     {
187
-        $sniffer = new SniffHeaderByDataType(compact(  'lineTerminator', 'delimiter'));
187
+        $sniffer = new SniffHeaderByDataType(compact('lineTerminator', 'delimiter'));
188 188
         return $sniffer->sniff($data);
189 189
     }
190 190
 }
Please login to merge, or discard this patch.