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/composer.json
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

64 lines
1.9 KiB
JSON

{
"name": "symfony/form",
"type": "library",
"description": "Symfony Form Component",
"keywords": [],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"require": {
"php": ">=5.5.9",
"symfony/event-dispatcher": "~2.8|~3.0",
"symfony/intl": "^2.8.18|^3.2.5",
"symfony/options-resolver": "~2.8|~3.0",
"symfony/polyfill-mbstring": "~1.0",
"symfony/property-access": "~2.8|~3.0"
},
"require-dev": {
"doctrine/collections": "~1.0",
"symfony/validator": "^2.8.18|^3.2.5",
"symfony/dependency-injection": "~3.3",
"symfony/config": "~2.7|~3.0",
"symfony/http-foundation": "~2.8|~3.0",
"symfony/http-kernel": "~2.8|~3.0",
"symfony/security-csrf": "~2.8|~3.0",
"symfony/translation": "~2.8|~3.0",
"symfony/var-dumper": "~3.3"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/dependency-injection": "<3.3",
"symfony/doctrine-bridge": "<2.7",
"symfony/framework-bundle": "<2.7",
"symfony/twig-bridge": "<2.7",
"symfony/var-dumper": "<3.3"
},
"suggest": {
"symfony/validator": "For form validation.",
"symfony/security-csrf": "For protecting forms against CSRF attacks.",
"symfony/twig-bridge": "For templating with Twig.",
"symfony/framework-bundle": "For templating with PHP."
},
"autoload": {
"psr-4": { "Symfony\\Component\\Form\\": "" },
"exclude-from-classmap": [
"/Tests/"
]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "3.3-dev"
}
}
}