@@ -212,14 +212,14 @@ foreach ($records as $offset => $record) {
212212By default the CSV document normalization removes empty records. But you can control the presence of such records using the following methods:
213213
214214~~~ php
215- Reader::skipEmptyRecord (): self;
216- Reader::preserveEmptyRecord (): self;
217- Reader::isEmptyRecordSkipped (): bool;
215+ Reader::skipEmptyRecords (): self;
216+ Reader::includeEmptyRecords (): self;
217+ Reader::isEmptyRecordsIncluded (): bool;
218218~~~
219219
220- - Calling ` Reader::preserveEmptyRecord ` will ensure empty records are left in the ` Iterator ` returned by ` Reader::getRecords ` ,
221- conversely ` Reader::skipEmptyRecord ` will ensure empty records are skipped.
222- - At any given time you can ask you Reader instance if empty records will be stripped using the ` Reader::isEmptyRecordSkipped ` method.
220+ - Calling ` Reader::includeEmptyRecords ` will ensure empty records are left in the ` Iterator ` returned by ` Reader::getRecords ` ,
221+ conversely ` Reader::skipEmptyRecords ` will ensure empty records are skipped.
222+ - At any given time you can ask you Reader instance if empty records will be stripped or included using the ` Reader::isEmptyRecordsIncluded ` method.
223223- If no header offset is specified, the empty record will be represented by a empty ` array ` , conversely,
224224for consistency, an empty record will be represented by an array filled with ` null ` values as expected from header presence normalization.
225225
@@ -237,15 +237,15 @@ $source = <<<EOF
237237EOF;
238238
239239$reader = Reader::createFromString($source);
240- $reader- >isEmptyRecordSkipped (); // return true;
240+ $reader- >isEmptyRecordsIncluded (); // return true;
241241iterator_to_array($reader, true);
242242// [
243243// 0 => ['parent name', 'child name', 'title'],
244244// 3 => ['parentA', 'childA', 'titleA'],
245245// ];
246246
247- $reader->preserveEmptyRecord ();
248- $reader->isEmptyRecordSkipped (); // return false;
247+ $reader->includeEmptyRecords ();
248+ $reader->isEmptyRecordsIncluded (); // return false;
249249iterator_to_array($reader, true);
250250// [
251251// 0 => ['parent name', 'child name', 'title'],
@@ -262,8 +262,8 @@ iterator_to_array($reader, true);
262262// 3 => ['parent name' => 'parentA', 'child name' => 'childA', 'title' => 'titleA'],
263263// ];
264264
265- $reader->skipEmptyRecord ();
266- $reader->isEmptyRecordSkipped (); // return true ;
265+ $reader->skipEmptyRecords ();
266+ $reader->isEmptyRecordsIncluded (); // return false ;
267267$res = iterator_to_array($reader, true);
268268// [
269269// 3 => ['parent name' => 'parentA', 'child name' => 'childA', 'title' => 'titleA'],
@@ -300,11 +300,11 @@ If empty record are to be preserved, the number of records will be affected.
300300use League\Csv\Reader;
301301
302302$reader = Reader::createFromPath('/path/to/my/file-with-two-empty-records.csv', 'r');
303- $reader->isEmptyRecordSkipped (); //returns true
303+ $reader->isEmptyRecordsIncluded (); //returns false
304304count($records); // returns 2
305305
306- $reader->preserveEmptyRecords ();
307- $reader->isEmptyRecordSkipped (); //returns false
306+ $reader->includeEmptyRecordss ();
307+ $reader->isEmptyRecordsIncluded (); //returns true
308308count($records); // returns 4
309309~~~
310310
0 commit comments