Skip to content

#201 - Fix minor defects - #212

Merged
njoubert-cleverage merged 3 commits into
mainfrom
201
Sep 28, 2026
Merged

njoubert-cleverage merged 3 commits into
mainfrom
201

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #201.

Minor defects found while writing the reference documentation (#145), without major functional impact: wrong error messages, dead code, stray namespace, and wrong or @todo docblocks.

Where Problem
TransformerTrait::normalizeTransformers() "Transformer {${$origTransformerCode}} should not have options" uses a variable variable: the transformer name is lost in the message and an Undefined variable PHP warning is raised
TrimTransformer Stray namespace Transformer; line before the real namespace
RulesTransformer::configureOptions() Message "Rules set cannot have more than 2 default rules" while the limit is one default rule
ImplodeTransformer, SprintfTransformer setRequired() + setDefault() on the same option: "required" has no effect (the documentation already lists these options as not required)
ExpressionLanguageMapTransformer::transform() "No expression accepting value '{$value}' in map" interpolates the raw value: for an array input, the message is built with an Array to string conversion warning, for an object without __toString() an Error replaces the expected UnexpectedValueException
ProcessExecutorTask Docblock "Execute one or many processes" while it executes one process per input
FilterTask Docblock "equality is softly checked" while ConditionTrait uses ===
RowAggregatorTask Docblock copied from InputAggregatorTask
ColumnAggregatorTask, DefaultTransformer @todo instead of a description
RecursivePropertySetterTransformer Docblock copied from PropertyAccessorTransformer, misspelled variables ($protertiesToSet…)
DateFormatTransformer Docblock says it accepts a string, while it throws an exception for anything else than a \DateTimeInterface

This PR:

  • fix the messages (TransformerTrait, RulesTransformer, ExpressionLanguageMapTransformer: display the value if scalar or \Stringable, its type otherwise);
  • remove the stray namespace and the useless setRequired() calls;
  • rewrite the docblocks from the reference documentation, rename the misspelled variables;
  • add unit tests for the fixed messages (RulesTransformer, TransformerTrait, ExpressionLanguageMapTransformer).

Not included (behaviour change to discuss separately): the callback#<n> suffix regex of TransformerTrait::getCleanedTransfomerCode() is not anchored, so callback#foo is accepted.

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 describes the right behaviour)
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None. ImplodeTransformer/SprintfTransformer: OptionsResolver::isRequired('separator'|'format') now returns false, which only affects code introspecting the resolver.

🤖 Generated with Claude Code

njoubert-cleverage and others added 3 commits September 28, 2026 12:04
…rait, RulesTransformer and ExpressionLanguageMapTransformer, useless `setRequired()` in ImplodeTransformer and SprintfTransformer, stray namespace in TrimTransformer, wrong or missing docblocks. Add tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ng risky tests when coverage is enabled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 1d202a2 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.

Fix minor defects: wrong error messages, dead options, stray namespace and docblocks

1 participant