Repository navigation
#365 - array_element / array_last without warning, documentation gaps - #366
Merged
Merged
Conversation
…ut warning; documentation gaps (advanced_stat_counter rate, CSV headers: [], ConditionTrait accessor, rules ParsedExpression) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…a path (null), instead of a PHP warning and a TypeError Co-Authored-By: Claude Opus 5.5 (1M context) <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 #365.
ArrayElementTransformer(array_element):nullwhen the index is outside the array, at either end. After the end, there is no more "Undefined array key" PHP warning (an exception in debug mode,nullin production); before the start (negative index), the first element is no longer returned (whatarray_slice()gives).ArrayLastTransformer(array_last):nullfor an empty array, without warning.InputCsvReaderTask(input_csv_reader): an input that is not a path (e.g.null) throws an explicitUnexpectedValueException("The input of the input_csv_reader task must be the path of the file to read, "null" given."), instead of an "Undefined array key "file_path"" PHP warning followed by aTypeError(dirname()).n/a items/sofadvanced_stat_counter,headers: []ofcsv_reader/input_csv_reader(UnexpectedValueException), optional$accessorofConditionTrait,ParsedExpressionaccepted by theconditionofrules.ArrayElementTransformerTest,ArrayLastTransformerTest,CsvReaderTaskTest(they fail with the PHP warnings without the fix,failOnWarning).Requirements
Breaking changes
Behaviour change, to be mentioned in the
UPGRADE.mdsection of the release: in debug mode,array_element/array_lastoutside the array returnnullinstead of failing; a negativeindexofarray_elementbefore the start of the array returnsnullinstead of the first element.🤖 Generated with Claude Code