d54a1223f7
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Routing] Construct Route annotations using named arguments
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | N/A
| License | MIT
| Doc PR | Not needed
This PR proposes to bump the `doctrine/annotations` library to 1.12 to gain access to its emulation layer for named arguments. Furthermore, constructing a `Route` annotation the old way by passing an array of parameters is deprecated.
### Reasons for this change
The constructors of our annotation classes have become unnecessarily complicated because we have to support two ways of calling them:
* An array of parameters, passed as first argument, because that's the default behavior `doctrine/annotations`.
* A set of named arguments because that's how PHP 8 attributes work.
Since we can now tell the Doctrine annotation reader to use named arguments as well, we can simplify the constructors of our annotations significantly.
### Drawback
After this change, there is no easy way anymore to construct instances of the `Route` annotation class directly on PHP 7. The PR has been built under the assumption that instances of this class are usually created using either Doctrine annotations or a PHP 8 attribute. Thus, most applications should be unaffected by this change.
Commits
-------
29b0f96046
[Routing] Construct Route annotations using named arguments
4.4 KiB
4.4 KiB
UPGRADE FROM 5.2 to 5.3
Asset
- Deprecated
RemoteJsonManifestVersionStrategy
, useJsonManifestVersionStrategy
instead
DoctrineBridge
- Remove
UuidV*Generator
classes
DomCrawler
- Deprecated the
parents()
method, useancestors()
instead
Form
- Changed
$forms
parameter type of theDataMapperInterface::mapDataToForms()
method fromiterable
to\Traversable
- Changed
$forms
parameter type of theDataMapperInterface::mapFormsToData()
method fromiterable
to\Traversable
- Deprecated passing an array as the second argument of the
DataMapper::mapDataToForms()
method, pass\Traversable
instead - Deprecated passing an array as the first argument of the
DataMapper::mapFormsToData()
method, pass\Traversable
instead - Deprecated passing an array as the second argument of the
CheckboxListMapper::mapDataToForms()
method, pass\Traversable
instead - Deprecated passing an array as the first argument of the
CheckboxListMapper::mapFormsToData()
method, pass\Traversable
instead - Deprecated passing an array as the second argument of the
RadioListMapper::mapDataToForms()
method, pass\Traversable
instead - Deprecated passing an array as the first argument of the
RadioListMapper::mapFormsToData()
method, pass\Traversable
instead - Dependency on
symfony/intl
was removed. Installsymfony/intl
if you are usingLocaleType
,CountryType
,CurrencyType
,LanguageType
orTimezoneType
FrameworkBundle
- Deprecate the
session.storage
alias andsession.storage.*
services, use thesession.storage.factory
alias andsession.storage.factory.*
services instead - Deprecate the
framework.session.storage_id
configuration option, use theframework.session.storage_factory_id
configuration option instead - Deprecate the
session
service and theSessionInterface
alias, use the\Symfony\Component\HttpFoundation\Request::getSession()
or the new\Symfony\Component\HttpFoundation\RequestStack::getSession()
methods instead
HttpFoundation
- Deprecate the
NamespacedAttributeBag
class
HttpKernel
- Marked the class
Symfony\Component\HttpKernel\EventListener\DebugHandlersListener
as internal
Messenger
- Deprecated the
prefetch_count
parameter in the AMQP bridge, it has no effect and will be removed in Symfony 6.0
Notifier
- Changed the return type of
AbstractTransportFactory::getEndpoint()
from?string
tostring
- Changed the signature of
Dsn::__construct()
to accept a singlestring $dsn
argument - Removed the
Dsn::fromString()
method
PhpunitBridge
- Deprecated the
SetUpTearDownTrait
trait, use original methods with "void" return typehint
PropertyInfo
- Deprecated the
Type::getCollectionKeyType()
andType::getCollectionValueType()
methods, useType::getCollectionKeyTypes()
andType::getCollectionValueTypes()
instead
Routing
- Deprecated creating instances of the
Route
annotation class by passing an array of parameters, use named arguments instead
Security
- Deprecate all classes in the
Core\Encoder\
sub-namespace, use thePasswordHasher
component instead - Deprecated voters that do not return a valid decision when calling the
vote
method
SecurityBundle
- Deprecate
UserPasswordEncoderCommand
class and the correspondinguser:encode-password
command, useUserPasswordHashCommand
anduser:hash-password
instead - Deprecate the
security.encoder_factory.generic
service, thesecurity.encoder_factory
andSymfony\Component\Security\Core\Encoder\EncoderFactoryInterface
aliases, usesecurity.password_hasher_factory
andSymfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface
instead - Deprecate the
security.user_password_encoder.generic
service, thesecurity.password_encoder
and theSymfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface
aliases, usesecurity.user_password_hasher
,security.password_hasher
andSymfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface
instead
Serializer
- Deprecated
ArrayDenormalizer::setSerializer()
, callsetDenormalizer()
instead
Uid
- Replaced
UuidV1::getTime()
,UuidV6::getTime()
andUlid::getTime()
byUuidV1::getDateTime()
,UuidV6::getDateTime()
andUlid::getDateTime()
Workflow
- Deprecate
InvalidTokenConfigurationException