Repository navigation
[v6] #507 - CSV readers: the error output of a line that cannot be read has its line number and values - #508
Draft
njoubert-cleverage wants to merge 1 commit into
Draft
njoubert-cleverage wants to merge 1 commit into
njoubert-cleverage wants to merge 1 commit into
Conversation
…s its line number and values Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #507 (v6.0):
CsvResource::readLine()throws anInvalidCsvLineException(extendsUnexpectedValueException, so existing catches still work) carrying the values read byfgetcsv()(nullwhen the line cannot be parsed);CsvReaderTask(andInputCsvReaderTask) sets the error output of a line that cannot be read to['csv_file' => <path>, 'csv_line' => <physical line number>, 'csv_values' => <values>], and addscsv_file/csv_lineto the error context before reading the line (they were missing from the logged error);input_csv_readerno longer sends the file path to its error branch).Checked locally: tests with pcov coverage (no risky test), PHPStan, PHP-CS-Fixer and Rector OK. Also run in the demo on the input file of a catalog import (
input_csv_reader,error_strategy: skip, error branch on acsv_writer): the rejects file gets…/catalog_2026-11-24.csv;13;Carrie|Stephen, and the logged error hascsv_fileandcsv_linein its context.Requirements
Breaking changes
The error output of
input_csv_readeron a line that cannot be read is no longer its input (the file path, still available ascsv_file), seeUPGRADE.md.🤖 Generated with Claude Code