refactor action handler execution #3
Merged
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.
This pull request introduces a refactor of the action handler execution in the form flow system, along with other minor improvements. The refactor simplifies the handling logic by delegating execution responsibilities directly to the
ActionButtonclass, removing redundant methods, and improving code clarity.Action Handler Refactor:
src/Form/Flow/ActionButton.php: AddedisHandledandhandlemethods to execute the action handler directly within theActionButtonclass, marking the button as handled afterward.src/Form/Flow/FormFlow.php: Removed thehandleActionmethod and updated logic to use thehandlemethod ofActionButtonfor action execution. [1] [2]src/Form/Flow/FormFlowInterface.php: Removed thehandleActionmethod declaration as it is no longer needed.Code Enhancements:
src/Form/Flow/FormFlowBuilder.php: Improved thegetInitialStepmethod to handle cases where no initial data is provided, ensuring a default step is returned.src/Form/Flow/ActionButton.php: Introduced a new propertyhandledto track whether the handler has been executed.Documentation Updates:
CHANGELOG.md: Added a changelog documenting breaking changes, fixes, and additions, including the refactor of action handler execution.