Skip to content

#229 - StatCounterTask and AdvancedStatCounterTask pass their input to their output - #231

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

njoubert-cleverage merged 1 commit into
mainfrom
229

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #229.

StatCounterTask and AdvancedStatCounterTask do not pass their input to their outputs:

  • StatCounterTask never sets an output: the next tasks receive null on every execution;
  • AdvancedStatCounterTask outputs null when statistics are logged, and is skipped the rest of the time: placed in the middle of a branch, it sends null every N executions and drops the other inputs.

They are therefore documented as "meant to be used as the last task of a branch", and a counter cannot be inserted in a chain to monitor it, unlike LoggerTask and DebugTask, which pass their input.

This PR:

  • Both tasks pass their input to their output on every execution ($state->setOutput($state->getInput())), and AdvancedStatCounterTask is no longer skipped: logging (or not) the statistics does not change the flow, as for LoggerTask.
  • Update the reference documentation (stat_counter_task.md, advanced_stat_counter_task.md), add tests.

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

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

Behaviour change for configurations with a task after a stat counter: it now receives every input instead of null (StatCounterTask), or instead of a null every N executions (AdvancedStatCounterTask). Configurations using the counters as the last task of a branch, as documented, are not affected.

🤖 Generated with Claude Code

…r input to their output on every execution (they used to output `null`, and AdvancedStatCounterTask was skipped when not logging), so they can be placed anywhere in a branch. Update documentation, add tests.

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

StatCounterTask and AdvancedStatCounterTask should pass their input to their outputs

1 participant