-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form][FrameworkBundle] Move FormPass to the Form component #21283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4168a0e
to
123be59
Compare
👍 |
@@ -83,7 +83,9 @@ public function build(ContainerBuilder $container) | |||
if (class_exists(AddConsoleCommandPass::class)) { | |||
$container->addCompilerPass(new AddConsoleCommandPass()); | |||
} | |||
$container->addCompilerPass(new FormPass()); | |||
if (class_exists(FormPass::class)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this going to be very big would it make sense to use a private helper method (which only adds when the class exists)?
$this->addExistingCompilerPass($container, $className, $arguments = array())
.
So you don't end-up with numerous if-statements 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree 👍 let's see if deciders think it's worth it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A simple private method in this class can do the trick isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, method added
2ffe098
to
2c91c6d
Compare
2b57f1b
to
d6ac6f3
Compare
Updated this to make the form extension service id and form type/type_extension/type_guesser tags configurable through the constructor, defaulting to the ones used in the framework. |
d6ac6f3
to
2ba70a8
Compare
2ba70a8
to
e68a6d9
Compare
Thank you @chalasr. |
…onent (chalasr) This PR was merged into the 3.3-dev branch. Discussion ---------- [Form][FrameworkBundle] Move FormPass to the Form component | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a So that anyone using only Form and DI can use it for registering form types/type guessers. Follows #19443, related to #21284 Commits ------- e68a6d9 [FrameworkBundle][Form] Move FormPass to the Form component
Well.. the approach now differs with #20250 (see discussion #20250 (comment), ie. default args vs. required args) Yet im rethinking it.. maybe having defaults in library code is good for convenience any way, and #20250 needs an update. |
So that anyone using only Form and DI can use it for registering form types/type guessers.
Follows #19443, related to #21284