diff --git a/docs/9.0/reader/index.md b/docs/9.0/reader/index.md index 5537d9af..af9b0b9c 100644 --- a/docs/9.0/reader/index.md +++ b/docs/9.0/reader/index.md @@ -39,8 +39,8 @@ The returned records are normalized using the following rules: - Empty records are skipped if present. - The document BOM sequence is skipped if present. - If a header record was provided, the number of fields is normalized to the number of fields contained in that record: - - Extra fields are truncated. - - Missing fields are added with a `null` value. + - Extra fields are truncated. + - Missing fields are added with a `null` value. - Field values are formatter if formatters are provided **Since version 9.11** ```php diff --git a/docs/9.0/reader/tabular-data-reader.md b/docs/9.0/reader/tabular-data-reader.md index 5cedd606..60021ced 100644 --- a/docs/9.0/reader/tabular-data-reader.md +++ b/docs/9.0/reader/tabular-data-reader.md @@ -29,11 +29,9 @@ $records = Reader::createFromPath('/path/to/file.csv') ->filter(fn (array $record): bool => false !== filter_var($record[2] ?? '', FILTER_VALIDATE_EMAIL)) ->select(1, 4, 5) ->slice(3, 5) - ->getRecords(); - -foreach ($record as $record) { - //do something meaningful with the found records -} + ->each(function (array $record) { + //do something meaningful with the found records + }); ``` Once you created a `TabularDataReader` implementing instance, here we are using the `Reader` you will @@ -107,7 +105,7 @@ var_dump([...$records][0]); // ] ``` -
+ diff --git a/src/TabularDataReader.php b/src/TabularDataReader.php index fc2981e5..78d65d00 100644 --- a/src/TabularDataReader.php +++ b/src/TabularDataReader.php @@ -57,7 +57,7 @@ public function count(): int; * filled with null values while extra record fields are strip from * the returned object. * - * @return Iterator