Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FrameworkBundle] Deprecated form types as services#18356

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@HeahDude
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets~
LicenseMIT
Doc PR~

These services are needless in regard of#15079.
If they have no dependencies, whatever are the registered extensions,FormTypeInterface instances will be autoloaded by their FQCN.

@HeahDudeHeahDudeforce-pushed thedeprecate-form_types_as_services branch 2 times, most recently from61ca117 to3389574CompareMarch 29, 2016 21:30
@Tobion
Copy link
Contributor

LGTM 👍

@HeahDude
Copy link
ContributorAuthor

Should we add a note in the UPGRADE file ?

@xabbuh
Copy link
Member

@HeahDude I think so.

@HeahDudeHeahDudeforce-pushed thedeprecate-form_types_as_services branch from3389574 toe629d91CompareMarch 30, 2016 07:42
@HeahDude
Copy link
ContributorAuthor

@xabbuh Thanks for the review. Done. is the "before/after" really needed?

After:

```php
$type = '\Symfony\Component\Form\Extension\Core\Type\TextType':
Copy link
Contributor

Choose a reason for hiding this comment

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

Or something like:

useSymfony\Component\Form\Extension\Core\Type\TextType;$type = TextType::class;

HeahDude reacted with confused emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I agree with it in general but I think it feels redundant in short examples such as here or docblocks and is used as is in the core.

I'm fine either way though.

Copy link
Contributor

Choose a reason for hiding this comment

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

The before and after is not the same thing. And I don't see the point of it.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@Tobion agreed, it misses thenew.

Actually we could just remove them, but we have to deprecate them so devs who had the crazy idea to use them as services might be warned to do otherwise.

Telling them to instantiate the class instead can look trivial I agree, but may be needed.
I'm not so sure about both ways.

Waiting for a final call on this, thanks again for the review.

Copy link
Member

Choose a reason for hiding this comment

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

I would simply list the IDs of the deprecated services. Passing them to the form builder should already produce errors as the builder is expecting a string.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Right we should above all avoid to add confusion about that.

So actually it does not really miss thenew even if it's not the "same" thing, it is the way to do it now.

I think we should keep it like this.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Maybe just be more accurate:

You should use the fully-qualified name instead of a form typeinstead of instantiate it.

Copy link
Member

Choose a reason for hiding this comment

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

I think we shouldn't even mention that. Let's keep it simple like this:

3.1:

The ... services are deprecated and will be removed in 4.0.

4.0:

The ... services have been removed.

Copy link
Member

Choose a reason for hiding this comment

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

Because all the other stuff about instantiating form type classes etc. is already handled in the upgrade docs for 2.8 and 3.0.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Good 👍

@HeahDudeHeahDudeforce-pushed thedeprecate-form_types_as_services branch 3 times, most recently froma4f6114 toed11b56CompareMarch 30, 2016 13:44
@HeahDude
Copy link
ContributorAuthor

Ok this one might be ready now.


* As it was never an officially supported feature, the support for absolute
template paths has been deprecated and will be removed in Symfony 4.0.
* The core form types registered as services:
Copy link
Member

Choose a reason for hiding this comment

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

Breaking the sentence in the middle looks weird, what about

The following form types registered as services are deprecated since 3.1 and will be removed in 4.0; use their fully-qualified class name instead:

Copy link
Member

Choose a reason for hiding this comment

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

I am still not convinced that it is necessary to add the "use their fully-qualified class name instead" part here (passing the form type instance retrieved from the container already doesn't work).

I think writing "The following services are deprecated since 3.1 and will be removed in 4.0:" is sufficient.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done. I've first went for@xabbuh suggestion but it was to weird to have just the list.

Since this is the upgrade file and might be relevant to ones getting deprecation notices, so a minimum of "what and what to do instead" makes sense IMHO so I used@fabpot's.

It's now accorded to the framework bundle changelog. Final call ?

@HeahDudeHeahDudeforce-pushed thedeprecate-form_types_as_services branch 2 times, most recently from0f88617 to02d173cCompareMarch 30, 2016 16:38
@xabbuh
Copy link
Member

@HeahDude In the 4.0 upgrade file the same services should be listed to, but they should there be mentioned as being removed.

@HeahDude
Copy link
ContributorAuthor

@xabbuh Ok I was not aware of it, thanks!

@HeahDudeHeahDudeforce-pushed thedeprecate-form_types_as_services branch from02d173c todfe4f53CompareMarch 30, 2016 17:14
@HeahDude
Copy link
ContributorAuthor

Done, feels weird :)

@fabpot
Copy link
Member

Thank you@HeahDude.

@fabpotfabpot merged commitdfe4f53 intosymfony:masterMar 31, 2016
fabpot added a commit that referenced this pull requestMar 31, 2016
…eahDude)This PR was merged into the 3.1-dev branch.Discussion----------[FrameworkBundle] Deprecated form types as services| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets | ~| License       | MIT| Doc PR        | ~These services are needless in regard of#15079.If they have no dependencies, whatever are the registered extensions, `FormTypeInterface` instances will be autoloaded by their FQCN.Commits-------dfe4f53 [FrameworkBundle] Deprecated form types as services
@HeahDudeHeahDude deleted the deprecate-form_types_as_services branchMarch 31, 2016 08:44
@fabpotfabpot mentioned this pull requestMay 13, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

8 participants

@HeahDude@Tobion@xabbuh@fabpot@stloyd@stof@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp