Uh oh!
There was an error while loading. Please reload this page.
Support typed autowiring of two parameters in form handlers - #345
Open
mildabre wants to merge 15 commits into
Open
Support typed autowiring of two parameters in form handlers#345mildabre wants to merge 15 commits into
mildabre wants to merge 15 commits into
Conversation
dgforce-pushed
the
master
branch
5 times, most recently
from
November 29, 2025 15:15
a992748 to
0e1918fComparedgforce-pushed
the
master
branch
3 times, most recently
from
December 27, 2025 00:26
8742d20 to
01f8ed8Comparedgforce-pushed
the
master
branch
4 times, most recently
from
February 11, 2026 03:09
aa035fb to
ae11e90Comparedgforce-pushed
the
master
branch
2 times, most recently
from
May 26, 2026 15:10
2a98f8e to
7fa50baComparedgforce-pushed
the
master
branch
2 times, most recently
from
June 22, 2026 01:24
1e4f482 to
d47a592Comparedgforce-pushed
the
master
branch
5 times, most recently
from
June 29, 2026 18:55
daff738 to
cdaf7deComparedgforce-pushed
the
master
branch
4 times, most recently
from
July 2, 2026 17:00
3cb834e to
2fdc764Comparedgforce-pushed
the
master
branch
2 times, most recently
from
July 14, 2026 02:33
1f03661 to
4570ff0Compare
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 freeto 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.
Purpose
The goal of this PR is to replace the existing hybrid autowiring logic for form handler parameters, which currently autowires by type (for a single parameter) or by position (for two parameters), with fully typed autowiring, where parameter order is irrelevant.
Implementation
The proposed changes introduce a parallel autowiring path that complements the existing logic without modifying it directly.
Unexpected behavior occurs with the following handler method signatures:
In these cases, the provided parameter types consistently result in an Error, and the handler method is never invoked, regardless of the code of the handler itself.
By handling these three parameter combinations within the newly introduced parallel logic path, this change remains 100% backward compatible.
Benefits
Nette developers are accustomed to type-based autowiring through DI, where parameter order doesn't matter. This proposal extends that principle to form handlers in a safe and modern way, aligning with the conventions of contemporary frameworks by enabling full type-based autowiring without relying on parameter sequence.
The proposed solution is currently being discussedon: nette forum