8000 [FrameworkBundle] Deprecated form types as services by HeahDude · Pull Request #18343 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Deprecated form types as services #18343

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
10000
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CHANGELOG

* Added `Controller::json` to simplify creating JSON responses when using the Serializer component
* Deprecated absolute template paths support in the template name parser
* Deprecated services for core form types and core form type extensions without dependencies
Copy link
Member

Choose a reason for hiding this comment

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

this is still wrong for type extensions. Type extensions always need to be registered


3.0.0
-----
Expand Down
31 changes: 31 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,94 +67,123 @@
</service>
<service id="form.type.birthday" class="Symfony\Component\Form\Extension\Core\Type\BirthdayType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.checkbox" class="Symfony\Component\Form\Extension\Core\Type\CheckboxType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.choice" class="Symfony\Component\Form\Extension\Core\Type\ChoiceType">
<tag name="form.type" />
Copy link
Member

Choose a reason for hiding this comment

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

please don't change the order. It makes merging branches harder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

even in master ?

<argument type="service" id="form.choice_list_factory"/>
</service>
<service id="form.type.collection" class="Symfony\Component\Form\Extension\Core\Type\CollectionType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.country" class="Symfony\Component\Form\Extension\Core\Type\CountryType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.date" class="Symfony\Component\Form\Extension\Core\Type\DateType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.datetime" class="Symfony\Component\Form\Extension\Core\Type\DateTimeType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.email" class="Symfony\Component\Form\Extension\Core\Type\EmailType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.file" class="Symfony\Component\Form\Extension\Core\Type\FileType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.hidden" class="Symfony\Component\Form\Extension\Core\Type\HiddenType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.integer" class="Symfony\Component\Form\Extension\Core\Type\IntegerType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.language" class="Symfony\Component\Form\Extension\Core\Type\LanguageType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.locale" class="Symfony\Component\Form\Extension\Core\Type\LocaleType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.money" class="Symfony\Component\Form\Extension\Core\Type\MoneyType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.number" class="Symfony\Component\Form\Extension\Core\Type\NumberType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.password" class="Symfony\Component\Form\Extension\Core\Type\PasswordType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.percent" class="Symfony\Component\Form\Extension\Core\Type\PercentType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.radio" class="Symfony\Component\Form\Extension\Core\Type\RadioType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.range" class="Symfony\Component\Form\Extension\Core\Type\RangeType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.repeated" class="Symfony\Component\Form\Extension\Core\Type\RepeatedType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.search" class="Symfony\Component\Form\Extension\Core\Type\SearchType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.textarea" class="Symfony\Component\Form\Extension\Core\Type\TextareaType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.text" class="Symfony\Component\Form\Extension\Core\Type\TextType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.time" class="Symfony\Component\Form\Extension\Core\Type\TimeType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.timezone" class="Symfony\Component\Form\Extension\Core\Type\TimezoneType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.url" class="Symfony\Component\Form\Extension\Core\Type\UrlType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.button" class="Symfony\Component\Form\Extension\Core\Type\ButtonType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.submit" class="Symfony\Component\Form\Extension\Core\Type\SubmitType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.reset" class="Symfony\Component\Form\Extension\Core\Type\ResetType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
<service id="form.type.currency" class="Symfony\Component\Form\Extension\Core\Type\CurrencyType">
<tag name="form.type" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>

<!-- FormTypeHttpFoundationExtension -->
Expand All @@ -179,9 +208,11 @@
</service>
<service id="form.type_extension.repeated.validator" class="Symfony\Component\Form\Extension\Validator\Type\RepeatedTypeValidatorExtension">
<tag name="form.type_extension" extended-type="Symfony\Component\Form\Extension\Core\Type\RepeatedType" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
Copy link
Member

Choose a reason for hiding this comment

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

type extensions cannot be deprecated (as they would not be registered anymore)

Copy link
Member

Choose a reason for hiding this comment

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

You cannot deprecate these services. If an extension is not registered, it cannot extend the logic of the form type (and there is no way to automatically discover extensions based on the form type class name)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stof I don't think they have to since they don't have strict dependencies.

See https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Validator/ValidatorExtension.php#L54.

Right ?

Copy link
Member

Choose a reason for hiding this comment

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

Please stop linking to form extensions to justify that these services are useless. As I already said many times, form extensions are NOT registered when using the fullstack framework, in favor of lazy-loading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely understood. Sorry for the confusion about this, thanks for clarifying it... again :)

</service>
<service id="form.type_extension.submit.validator" class="Symfony\Component\Form\Extension\Validator\Type\SubmitTypeValidatorExtension">
<tag name="form.type_extension" extended-type="Symfony\Component\Form\Extension\Core\Type\SubmitType" />
<deprecated>The "%service_id%" service is deprecated since Symfony 3.1 and will be removed in 4.0.</deprecated>
</service>
</services>
</container>
0