Skip to content

[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

Merged
merged 1 commit into from
Feb 16, 2017

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Jan 13, 2017

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

@dunglas
Copy link
Member

dunglas commented Jan 14, 2017

👍

@@ -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)) {
Copy link
Contributor

@sstok sstok Jan 15, 2017

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 👍

Copy link
Member Author

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

Copy link
Member

@dunglas dunglas Jan 15, 2017

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, method added

@chalasr chalasr force-pushed the form/addformtype-pass branch 2 times, most recently from 2ffe098 to 2c91c6d Compare January 15, 2017 15:47
@nicolas-grekas nicolas-grekas added this to the 3.x milestone Jan 16, 2017
@chalasr chalasr force-pushed the form/addformtype-pass branch 3 times, most recently from 2b57f1b to d6ac6f3 Compare January 24, 2017 15:16
@chalasr
Copy link
Member Author

chalasr commented Jan 24, 2017

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.
This needs a second review :)

@chalasr chalasr force-pushed the form/addformtype-pass branch from d6ac6f3 to 2ba70a8 Compare January 24, 2017 15:35
@chalasr chalasr force-pushed the form/addformtype-pass branch from 2ba70a8 to e68a6d9 Compare January 24, 2017 15:36
@fabpot
Copy link
Member

fabpot commented Feb 16, 2017

Thank you @chalasr.

@fabpot fabpot merged commit e68a6d9 into symfony:master Feb 16, 2017
fabpot added a commit that referenced this pull request Feb 16, 2017
…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
@chalasr chalasr deleted the form/addformtype-pass branch February 16, 2017 14:18
@ro0NL
Copy link
Contributor

ro0NL commented Feb 16, 2017

This needs a second review :)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants