Skip to content

#228 - Add missing setAllowedTypes() on several options - #230

Merged
njoubert-cleverage merged 1 commit into
mainfrom
228
Sep 28, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
228

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #228.

Several options have no setAllowedTypes(): a value of the wrong type is accepted when the options are resolved, and fails later (during the execution) with an unclear error, or is silently misused.

Where Option Documented type
HashTransformer raw_output bool
SimpleBatchTask batch_count int|null
ConditionTrait (FilterTask, array_filter, RulesTransformer...) empty, not_empty (the other condition keys are already typed array) array
NormalizerTask, SerializerTask, DeserializerTask context (already typed in DenormalizerTask) array
ObjectUpdaterTask property_path string

(CsvSplitterTask::max_lines, also listed during the documentation review, was fixed in #221.)

This PR:

The new regression tests fail on main and pass with this fix. PHPUnit, PHPStan, PHP-CS-Fixer and Rector pass.

Requirements

  • Documentation updates
    • Reference (already documents these types)
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

Almost none: only values that do not match the documented types are now rejected when the options are resolved. Most of them already failed at execution time; a few may have worked by accident (e.g. batch_count: '10' as a string, or raw_output: 1 in non-strict code), they must now use the documented type.

🤖 Generated with Claude Code

…mer (`raw_output`), SimpleBatchTask (`batch_count`), ConditionTrait (`empty`, `not_empty`), NormalizerTask / SerializerTask / DeserializerTask (`context`) and ObjectUpdaterTask (`property_path`): a wrong type is now reported when the options are resolved. Add tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 4e7b63b into main Sep 28, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing setAllowedTypes() on several options: HashTransformer, SimpleBatchTask, ConditionTrait, serialization tasks, ObjectUpdaterTask

1 participant