This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Form
Fabien Potencier d1da474f8d feature #21690 [Form] allow form types + form type extensions + form type guessers to be private services (hhamon)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form] allow form types + form type extensions + form type guessers to be private services

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

This pull request is about making internal form services (aka form types, form type extensions and form type guessers) private. They used to be public until Symfony 3.2 for one valid reason: lazyness. However, Symfony 3.3 now comes with built-in mechanism to support effective lazy loading of private services with service locators and proxies.

This PR makes the `DependencyInjectionExtension` class of the `Form` component leverage these new DI component mechanisms. Form types, form type extensions and form type guessers can now be declared private as a best practice. We decided to make these services private as of Symfony 3.3 and of course it would break BC. But this PR introduces a BC layer using a Symfony trick to keep internal form services public. The service container currently has a known issue where private services are not really private if they're referenced by at least two other services in the container. We use this trick to maintain the legacy services public even though the new API relies on private ones. This trick is done thanks to the `deprecated.form.registry` and `deprecated.form.registry.csrf` fake services that will be removed in Symfony 4.0.

Commits
-------

600e75ce88 [Form] use new service locator in DependencyInjectionExtension class, so that form types can be made private at some point.
2017-02-28 12:26:30 -08:00
..
ChoiceList Merge branch '3.1' into 3.2 2017-01-02 15:57:35 +01:00
DependencyInjection [Form] use new service locator in DependencyInjectionExtension class, so that form types can be made private at some point. 2017-02-28 10:16:52 +01:00
Exception [Form] removed deprecated features 2015-10-01 16:20:48 +02:00
Extension [Form] use new service locator in DependencyInjectionExtension class, so that form types can be made private at some point. 2017-02-28 10:16:52 +01:00
Guess fixed @return when returning this or static 2016-12-27 08:23:47 +01:00
Resources Merge branch '2.3' into 2.7 2016-02-22 17:12:29 +01:00
Test Further refactorings to PHPUnit namespaces 2017-02-21 09:32:25 +01:00
Tests [Form] use new service locator in DependencyInjectionExtension class, so that form types can be made private at some point. 2017-02-28 10:16:52 +01:00
Util Merge branch '2.8' into 3.1 2016-11-25 13:27:14 +01:00
.gitignore
AbstractExtension.php [Form] removed deprecated FormType::getName() 2015-10-01 16:20:48 +02:00
AbstractRendererEngine.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
AbstractType.php Merge branch '2.7' into 2.8 2016-06-29 07:29:29 +02:00
AbstractTypeExtension.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
Button.php fixed @return when returning this or static 2016-12-27 08:23:47 +01:00
ButtonBuilder.php Merge branch '2.8' into 3.1 2016-12-27 11:43:25 +01:00
ButtonTypeInterface.php
CallbackTransformer.php Replace is_callable checks with type hints 2015-10-05 16:57:27 +02:00
CHANGELOG.md [FrameworkBundle][Form] Move FormPass to the Form component 2017-01-24 16:36:06 +01:00
ClickableInterface.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
composer.json feature #21690 [Form] allow form types + form type extensions + form type guessers to be private services (hhamon) 2017-02-28 12:26:30 -08:00
DataMapperInterface.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
DataTransformerInterface.php Fix copy-paste in PHPDoc comment text 2016-03-24 10:50:31 +01:00
Form.php Merge branch '3.1' into 3.2 2016-12-27 11:44:30 +01:00
FormBuilder.php Merge branch '2.7' into 2.8 2016-12-27 11:39:57 +01:00
FormBuilderInterface.php Merge branch '2.8' into 3.1 2016-12-27 11:43:25 +01:00
FormConfigBuilder.php fixed @return when returning this or static 2016-12-27 08:23:47 +01:00
FormConfigBuilderInterface.php Fixed @return self with $this 2017-01-02 16:57:42 +01:00
FormConfigInterface.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
FormError.php Conditionally add options to unserialize in PHP 7.0+. 2016-12-29 19:41:55 +01:00
FormErrorIterator.php removed @since 2016-07-04 07:27:33 +02:00
FormEvent.php
FormEvents.php move event listener method type hint docs to @Event annotations default value. makes it easily parsable by PhpStorm plugin 2016-05-03 20:48:46 +02:00
FormExtensionInterface.php [2.3][Form] Cleanup & fix phpdocs 2014-07-09 12:39:32 +02:00
FormFactory.php [Form] Removed unused ResolvedTypeFactory in FormFactory constructor 2017-01-10 21:49:17 +01:00
FormFactoryBuilder.php [Form] Removed unused ResolvedTypeFactory in FormFactory constructor 2017-01-10 21:49:17 +01:00
FormFactoryBuilderInterface.php fixed @return when returning this or static 2016-12-27 08:23:47 +01:00
FormFactoryInterface.php [3.0] Clean Form, Validator, DowCrawler and some more 2015-10-02 19:05:43 +02:00
FormInterface.php Merge branch '3.1' into 3.2 2016-12-27 11:44:30 +01:00
FormRegistry.php Merge branch '2.8' into 3.0 2016-06-29 07:40:00 +02:00
FormRegistryInterface.php [Form] remove validation of FormRegistry::getType as FormRegistry::hasType does not validate either 2015-10-22 02:46:43 +02:00
FormRenderer.php Merge branch '2.8' into 3.0 2016-06-28 18:26:27 +02:00
FormRendererEngineInterface.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
FormRendererInterface.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
Forms.php Merge branch '2.8' into 3.0 2016-06-29 07:40:00 +02:00
FormTypeExtensionInterface.php Merge branch '2.8' into 3.0 2016-06-29 07:40:00 +02:00
FormTypeGuesserChain.php [Form] Change FormTypeGuesserChain to accept Traversable 2016-09-24 18:09:44 +02:00
FormTypeGuesserInterface.php DX: replace @link with @see annotation 2016-11-13 18:41:36 +01:00
FormTypeInterface.php Merge branch '2.7' into 2.8 2016-06-29 07:29:29 +02:00
FormView.php fixed @return when returning this or static 2016-12-27 08:23:47 +01:00
LICENSE updated LICENSE year 2017-01-02 12:30:00 -08:00
NativeRequestHandler.php [form] lazy trans post_max_size_message. 2016-09-06 16:01:53 +01:00
phpunit.xml.dist Add missing exclusions from phpunit.xml.dist 2015-11-18 09:19:46 +01:00
PreloadedExtension.php Merge branch '2.8' into 3.1 2016-09-14 13:33:02 -07:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00
RequestHandlerInterface.php removed dots at the end of @param and @return 2016-06-28 08:24:06 +02:00
ResolvedFormType.php Merge branch '2.8' into 3.0 2016-06-29 07:40:00 +02:00
ResolvedFormTypeFactory.php
ResolvedFormTypeFactoryInterface.php [Form] fix and unify phpdoc 2013-10-31 15:15:49 +01:00
ResolvedFormTypeInterface.php Merge branch '2.8' into 3.1 2016-12-29 22:40:29 +01:00
ReversedTransformer.php [2.3] CS And DocBlock Fixes 2014-12-22 16:58:09 +01:00
SubmitButton.php fixed @return when returning this or static 2016-12-27 08:23:47 +01:00
SubmitButtonBuilder.php [Form] fix and unify phpdoc 2013-10-31 15:15:49 +01:00
SubmitButtonTypeInterface.php

Form Component

The Form component allows you to easily create, process and reuse HTML forms.

Resources