#229 - StatCounterTask and AdvancedStatCounterTask pass their input to their output - #231
Merged
Merged
Conversation
…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>
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 #229.
StatCounterTaskandAdvancedStatCounterTaskdo not pass their input to their outputs:StatCounterTasknever sets an output: the next tasks receivenullon every execution;AdvancedStatCounterTaskoutputsnullwhen statistics are logged, and is skipped the rest of the time: placed in the middle of a branch, it sendsnullevery 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
LoggerTaskandDebugTask, which pass their input.This PR:
$state->setOutput($state->getInput())), andAdvancedStatCounterTaskis no longer skipped: logging (or not) the statistics does not change the flow, as forLoggerTask.stat_counter_task.md,advanced_stat_counter_task.md), add tests.The new regression tests fail on
mainand pass with this fix. PHPUnit, PHPStan, PHP-CS-Fixer and Rector pass.Requirements
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 anullevery N executions (AdvancedStatCounterTask). Configurations using the counters as the last task of a branch, as documented, are not affected.🤖 Generated with Claude Code