Skip to content

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

Closed

Description

@njoubert-cleverage

Description

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.)

Reproduction

For instance:

transformers:
    hash:
        algo: md5
        raw_output: 'yes'   # TypeError in hash() during the transformation, instead of an option error
array_filter:
    condition:
        empty: name         # foreach() on a string when the condition is checked (instead of `empty: { name: ~ }`)

Tested on main (d2c921a), PHP 8.5, Symfony 7.4: all these values are accepted by the options resolver.

Proposed fix

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.

Activity

  1. added a commit that references this issue on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions