2019-11-10 16:23:41 +00:00
UPGRADE FROM 5.x to 6.0
=======================
2020-12-13 18:17:49 +00:00
Asset
-----
* Removed `RemoteJsonManifestVersionStrategy` , use `JsonManifestVersionStrategy` instead.
2021-03-10 16:10:58 +00:00
DoctrineBridge
--------------
2021-04-01 00:13:11 +01:00
* Remove `UserLoaderInterface::loadUserByUsername()` in favor of `UserLoaderInterface::loadUserByIdentifier()`
2021-09-26 19:23:50 +01:00
* Add argument `$bundleDir` to `AbstractDoctrineExtension::getMappingDriverBundleConfigDefaults()`
* Add argument `$bundleDir` to `AbstractDoctrineExtension::getMappingResourceConfigDirectory()`
2021-03-10 16:10:58 +00:00
2021-04-22 11:08:52 +01:00
Cache
-----
2021-09-09 13:12:16 +01:00
* Remove `DoctrineProvider` and `DoctrineAdapter` because these classes have been added to the `doctrine/cache` package
2021-10-07 11:56:32 +01:00
* `PdoAdapter` does not accept `Doctrine\DBAL\Connection` or DBAL URL. Use the new `DoctrineDbalAdapter` instead
2021-04-22 11:08:52 +01:00
2020-02-25 21:52:48 +00:00
Config
------
* The signature of method `NodeDefinition::setDeprecated()` has been updated to `NodeDefinition::setDeprecation(string $package, string $version, string $message)` .
* The signature of method `BaseNode::setDeprecated()` has been updated to `BaseNode::setDeprecation(string $package, string $version, string $message)` .
* Passing a null message to `BaseNode::setDeprecated()` to un-deprecate a node is not supported anymore.
2020-04-04 20:42:42 +01:00
* Removed `BaseNode::getDeprecationMessage()` , use `BaseNode::getDeprecation()` instead.
2020-02-25 21:52:48 +00:00
2020-01-20 15:05:06 +00:00
Console
-------
* `Command::setHidden()` has a default value (`true`) for `$hidden` parameter
2021-04-03 11:46:30 +01:00
* Remove `Helper::strlen()` , use `Helper::width()` instead.
2021-05-20 07:28:13 +01:00
* Remove `Helper::strlenWithoutDecoration()` , use `Helper::removeDecoration()` instead.
2021-08-18 20:57:09 +01:00
* Remove `HelperSet::setCommand()` and `getCommand()` without replacement
2020-01-20 15:05:06 +00:00
2020-02-18 17:12:00 +00:00
DependencyInjection
-------------------
* The signature of method `Definition::setDeprecated()` has been updated to `Definition::setDeprecation(string $package, string $version, string $message)` .
* The signature of method `Alias::setDeprecated()` has been updated to `Alias::setDeprecation(string $package, string $version, string $message)` .
* The signature of method `DeprecateTrait::deprecate()` has been updated to `DeprecateTrait::deprecation(string $package, string $version, string $message)` .
2020-02-06 20:02:01 +00:00
* Removed the `Psr\Container\ContainerInterface` and `Symfony\Component\DependencyInjection\ContainerInterface` aliases of the `service_container` service,
configure them explicitly instead.
2020-04-04 20:42:42 +01:00
* Removed `Definition::getDeprecationMessage()` , use `Definition::getDeprecation()` instead.
* Removed `Alias::getDeprecationMessage()` , use `Alias::getDeprecation()` instead.
2020-05-13 07:28:35 +01:00
* The `inline()` function from the PHP-DSL has been removed, use `inline_service()` instead.
* The `ref()` function from the PHP-DSL has been removed, use `service()` instead.
2020-06-21 16:48:06 +01:00
* Removed `Definition::setPrivate()` and `Alias::setPrivate()` , use `setPublic()` instead
2020-02-18 17:12:00 +00:00
2021-01-02 16:25:53 +00:00
DomCrawler
----------
* Removed the `parents()` method, use `ancestors()` instead.
2020-01-11 14:48:32 +00:00
Dotenv
------
* Removed argument `$usePutenv` from Dotenv's constructor, use `Dotenv::usePutenv()` instead.
2019-12-13 21:39:36 +00:00
EventDispatcher
---------------
* Removed `LegacyEventDispatcherProxy` . Use the event dispatcher without the proxy.
2021-07-15 17:52:07 +01:00
Finder
------
* Remove `Comparator::setTarget()` and `Comparator::setOperator()`
* The `$target` parameter of `Comparator::__construct()` is now mandatory
2019-07-25 17:09:28 +01:00
Form
----
2021-08-05 08:42:24 +01:00
* `FormErrorIterator::children()` throws an exception if the current element is not iterable.
2020-05-05 16:23:23 +01:00
* The default value of the `rounding_mode` option of the `PercentType` has been changed to `\NumberFormatter::ROUND_HALFUP` .
* The default rounding mode of the `PercentToLocalizedStringTransformer` has been changed to `\NumberFormatter::ROUND_HALFUP` .
2019-07-25 17:09:28 +01:00
* Added the `getIsEmptyCallback()` method to the `FormConfigInterface` .
* Added the `setIsEmptyCallback()` method to the `FormConfigBuilderInterface` .
2019-04-07 21:08:39 +01:00
* Added argument `callable|null $filter` to `ChoiceListFactoryInterface::createListFromChoices()` and `createListFromLoader()` .
2020-04-11 19:06:08 +01:00
* The `Symfony\Component\Form\Extension\Validator\Util\ServerParams` class has been removed, use its parent `Symfony\Component\Form\Util\ServerParams` instead.
2020-05-05 16:23:23 +01:00
* The `NumberToLocalizedStringTransformer::ROUND_*` constants have been removed, use `\NumberFormatter::ROUND_*` instead.
2020-08-27 11:09:23 +01:00
* Removed `PropertyPathMapper` in favor of `DataMapper` and `PropertyPathAccessor` .
2020-12-05 01:31:35 +00:00
* Changed `$forms` parameter type of the `DataMapper::mapDataToForms()` method from `iterable` to `\Traversable` .
* Changed `$forms` parameter type of the `DataMapper::mapFormsToData()` method from `iterable` to `\Traversable` .
* Changed `$checkboxes` parameter type of the `CheckboxListMapper::mapDataToForms()` method from `iterable` to `\Traversable` .
* Changed `$checkboxes` parameter type of the `CheckboxListMapper::mapFormsToData()` method from `iterable` to `\Traversable` .
* Changed `$radios` parameter type of the `RadioListMapper::mapDataToForms()` method from `iterable` to `\Traversable` .
* Changed `$radios` parameter type of the `RadioListMapper::mapFormsToData()` method from `iterable` to `\Traversable` .
2019-07-25 17:09:28 +01:00
2019-11-10 16:23:41 +00:00
FrameworkBundle
---------------
2020-04-20 18:33:00 +01:00
* Remove the `framework.translator.enabled_locales` config option, use `framework.enabled_locales` instead
2021-01-31 19:45:01 +00:00
* Remove the `session.storage` alias and `session.storage.*` services, use the `session.storage.factory` alias and `session.storage.factory.*` services instead
* Remove `framework.session.storage_id` configuration option, use the `framework.session.storage_factory_id` configuration option instead
2020-10-17 22:28:45 +01:00
* Remove the `session` service and the `SessionInterface` alias, use the `\Symfony\Component\HttpFoundation\Request::getSession()` or the new `\Symfony\Component\HttpFoundation\RequestStack::getSession()` methods instead
2019-12-07 15:49:34 +00:00
* `MicroKernelTrait::configureRoutes()` is now always called with a `RoutingConfigurator`
2020-01-11 18:12:40 +00:00
* The "framework.router.utf8" configuration option defaults to `true`
2020-03-28 13:33:33 +00:00
* Removed `session.attribute_bag` service and `session.flash_bag` service.
2021-06-03 16:11:29 +01:00
* The `form.factory` , `form.type.file` , `profiler` , `translator` , `security.csrf.token_manager` , `serializer` ,
2020-05-04 18:01:18 +01:00
`cache_clearer` , `filesystem` and `validator` services are now private.
2020-10-15 20:27:13 +01:00
* Removed the `lock.RESOURCE_NAME` and `lock.RESOURCE_NAME.store` services and the `lock` , `LockInterface` , `lock.store` and `PersistingStoreInterface` aliases, use `lock.RESOURCE_NAME.factory` , `lock.factory` or `LockFactory` instead.
2021-03-04 19:58:08 +00:00
* Remove the `KernelTestCase::$container` property, use `KernelTestCase::getContainer()` instead
2021-04-19 17:33:12 +01:00
* Registered workflow services are now private
2020-04-27 00:21:26 +01:00
* Remove option `--xliff-version` of the `translation:update` command, use e.g. `--output-format=xlf20` instead
* Remove option `--output-format` of the `translation:update` command, use e.g. `--output-format=xlf20` instead
2021-05-12 15:43:49 +01:00
* Remove the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
2021-08-09 09:30:47 +01:00
* Remove `get()` , `has()` , `getDoctrine()` , and `dispatchMessage()` in `AbstractController` , use method/constructor injection instead
2021-09-09 13:12:16 +01:00
* Deprecate the `cache.adapter.doctrine` service: The Doctrine Cache library is deprecated. Either switch to Symfony Cache or use the PSR-6 adapters provided by Doctrine Cache.
2021-11-20 13:33:26 +00:00
* Make the `framework.messenger.reset_on_message` configuration option default to `true`
2021-11-15 21:28:13 +00:00
* In `framework.cache` configuration, using the `cache.adapter.pdo` with a Doctrine DBAL connection is no longer supported, use `cache.adapter.doctrine_dbal` instead.
2019-11-10 16:23:41 +00:00
2019-12-03 06:17:06 +00:00
HttpFoundation
--------------
2021-01-16 10:11:08 +00:00
* Remove the `NamespacedAttributeBag` class
2019-12-03 06:17:06 +00:00
* Removed `Response::create()` , `JsonResponse::create()` ,
2020-11-20 15:42:02 +00:00
`RedirectResponse::create()` , `StreamedResponse::create()` and
`BinaryFileResponse::create()` methods (use `__construct()` instead)
2021-11-20 13:33:26 +00:00
* Not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()` throws an `\InvalidArgumentException` ; wrap your filter in a closure instead
* Not passing a `Closure` together with `FILTER_CALLBACK` to `InputBag::filter()` throws an `\InvalidArgumentException` ; wrap your filter in a closure instead
* Removed the `Request::HEADER_X_FORWARDED_ALL` constant, use either `Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO` or `Request::HEADER_X_FORWARDED_AWS_ELB` or `Request::HEADER_X_FORWARDED_TRAEFIK` constants instead
2021-03-21 23:25:00 +00:00
* Rename `RequestStack::getMasterRequest()` to `getMainRequest()`
2021-11-20 13:33:26 +00:00
* Not passing `FILTER_REQUIRE_ARRAY` or `FILTER_FORCE_ARRAY` flags to `InputBag::filter()` when filtering an array will throw `BadRequestException`
* Retrieving non-scalar values using `InputBag::get()` will throw `BadRequestException` (use `InputBad::all()` instead to retrieve an array)
* Passing non-scalar default value as the second argument `InputBag::get()` will throw `\InvalidArgumentException`
* Passing non-scalar, non-array value as the second argument `InputBag::set()` will throw `\InvalidArgumentException`
* Passing `null` as `$requestIp` to `IpUtils::__checkIp()` , `IpUtils::__checkIp4()` or `IpUtils::__checkIp6()` is not supported anymore.
* Remove the `upload_progress.*` and `url_rewriter.tags` session options
2019-12-03 06:17:06 +00:00
2020-03-29 15:22:37 +01:00
HttpKernel
----------
2021-02-25 16:07:22 +00:00
* Remove `ArgumentInterface`
* Remove `ArgumentMetadata::getAttribute()` , use `getAttributes()` instead
2021-03-10 08:16:48 +00:00
* Make `WarmableInterface::warmUp()` return a list of classes or files to preload on PHP 7.4+
* Remove support for `service:action` syntax to reference controllers. Use `serviceOrFqcn::method` instead.
* Remove support for returning a `ContainerBuilder` from `KernelInterface::registerContainerConfiguration()`
2021-03-21 23:25:00 +00:00
* Rename `HttpKernelInterface::MASTER_REQUEST` to `MAIN_REQUEST`
* Rename `KernelEvent::isMasterRequest()` to `isMainRequest()`
2020-03-29 15:22:37 +01:00
2019-12-23 16:57:23 +00:00
Inflector
---------
* The component has been removed, use `EnglishInflector` from the String component instead.
2020-03-15 22:41:30 +00:00
2020-09-24 19:59:58 +01:00
Lock
----
* Removed the `NotSupportedException` . It shouldn't be thrown anymore.
* Removed the `RetryTillSaveStore` . Logic has been moved in `Lock` and is not needed anymore.
2021-10-06 07:42:50 +01:00
* Removed usage of `PdoStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalStore` instead
* Removed usage of `PostgreSqlStore` with a `Doctrine\DBAL\Connection` or a DBAL url, use the new `DoctrineDbalPostgreSqlStore` instead
2020-09-24 19:59:58 +01:00
2020-03-15 22:41:30 +00:00
Mailer
------
* Removed the `SesApiTransport` class. Use `SesApiAsyncAwsTransport` instead.
* Removed the `SesHttpTransport` class. Use `SesHttpAsyncAwsTransport` instead.
2020-01-21 16:10:46 +00:00
Messenger
---------
* Removed AmqpExt transport. Run `composer require symfony/amqp-messenger` to keep the transport in your application.
* Removed Doctrine transport. Run `composer require symfony/doctrine-messenger` to keep the transport in your application.
* Removed RedisExt transport. Run `composer require symfony/redis-messenger` to keep the transport in your application.
2019-12-10 15:47:33 +00:00
* Use of invalid options in Redis and AMQP connections now throws an error.
2020-03-24 09:55:43 +00:00
* The signature of method `RetryStrategyInterface::isRetryable()` has been updated to `RetryStrategyInterface::isRetryable(Envelope $message, \Throwable $throwable = null)` .
* The signature of method `RetryStrategyInterface::getWaitingTime()` has been updated to `RetryStrategyInterface::getWaitingTime(Envelope $message, \Throwable $throwable = null)` .
2020-12-29 20:57:03 +00:00
* Removed the `prefetch_count` parameter in the AMQP bridge.
2020-12-22 11:01:12 +00:00
* Removed the use of TLS option for Redis Bridge, use `rediss://127.0.0.1` instead of `redis://127.0.0.1?tls=1`
2021-07-16 23:12:09 +01:00
* The `delete_after_ack` config option of the Redis transport now defaults to `true`
2020-01-21 16:10:46 +00:00
2020-06-09 16:20:00 +01:00
Mime
----
* Removed `Address::fromString()` , use `Address::create()` instead
2020-02-16 09:57:23 +00:00
Monolog
-------
* The `$actionLevel` constructor argument of `Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy` has been replaced by the `$inner` one which expects an ActivationStrategyInterface to decorate instead. `Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy` is now final.
* The `$actionLevel` constructor argument of `Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy` has been replaced by the `$inner` one which expects an ActivationStrategyInterface to decorate instead. `Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy` is now final.
2021-10-12 09:54:21 +01:00
* Remove `ResetLoggersWorkerSubscriber` in favor of "reset_on_message" option in messenger configuration
2020-02-16 09:57:23 +00:00
2021-05-20 07:04:24 +01:00
Notifier
--------
* Remove `SlackOptions::channel()` , use `SlackOptions::recipient()` instead.
2020-04-04 20:42:42 +01:00
OptionsResolver
---------------
* The signature of method `OptionsResolver::setDeprecated()` has been updated to `OptionsResolver::setDeprecated(string $option, string $package, string $version, $message)` .
* Removed `OptionsResolverIntrospector::getDeprecationMessage()` , use `OptionsResolverIntrospector::getDeprecation()` instead.
2020-03-11 22:37:55 +00:00
PhpUnitBridge
-------------
* Removed support for `@expectedDeprecation` annotations, use the `ExpectDeprecationTrait::expectDeprecation()` method instead.
2020-12-13 22:45:00 +00:00
* Removed the `SetUpTearDownTrait` trait, use original methods with "void" return typehint.
2020-03-11 22:37:55 +00:00
2019-06-21 16:41:54 +01:00
PropertyAccess
--------------
2021-01-03 11:25:47 +00:00
* Drop support for booleans as the second argument of `PropertyAccessor::__construct()` , pass a combination of bitwise flags instead.
2021-01-03 11:58:52 +00:00
* Dropped support for booleans as the first argument of `PropertyAccessor::__construct()` .
2019-06-21 16:41:54 +01:00
Pass a combination of bitwise flags instead.
PropertyInfo
------------
2021-01-05 14:21:37 +00:00
* Removed the `Type::getCollectionKeyType()` and `Type::getCollectionValueType()` methods, use `Type::getCollectionKeyTypes()` and `Type::getCollectionValueTypes()` instead.
2019-06-21 16:41:54 +01:00
* Dropped the `enable_magic_call_extraction` context option in `ReflectionExtractor::getWriteInfo()` and `ReflectionExtractor::getReadInfo()` in favor of `enable_magic_methods_extraction` .
2019-11-10 16:23:41 +00:00
Routing
-------
* Removed `RouteCollectionBuilder` .
2020-02-05 17:53:43 +00:00
* Added argument `$priority` to `RouteCollection::add()`
2020-02-25 10:55:47 +00:00
* Removed the `RouteCompiler::REGEX_DELIMITER` constant
2021-02-21 10:40:41 +00:00
* Removed the `$data` parameter from the constructor of the `Route` annotation class
2020-02-28 11:18:46 +00:00
Security
--------
2021-08-16 20:47:06 +01:00
* Remove `AuthenticationEvents::AUTHENTICATION_FAILURE` , use the `LoginFailureEvent` instead
2021-08-12 20:41:03 +01:00
* Remove the `$authenticationEntryPoint` argument of `ChannelListener`
* Remove `RetryAuthenticationEntryPoint` , this code was inlined in the `ChannelListener`
* Remove `FormAuthenticationEntryPoint` and `BasicAuthenticationEntryPoint` , the `FormLoginAuthenticator` and `HttpBasicAuthenticator` should be used instead.
2021-08-15 12:02:49 +01:00
* Remove `AbstractRememberMeServices` , `PersistentTokenBasedRememberMeServices` , `RememberMeServicesInterface` ,
`TokenBasedRememberMeServices` , use the remember me handler alternatives instead
2021-08-08 11:41:46 +01:00
* Remove `AnonymousToken`
* Remove `Token::getCredentials()` , tokens should no longer contain credentials (as they represent authenticated sessions)
* Restrict the return type of `Token::getUser()` to `UserInterface` (removing `string|\Stringable` )
2021-08-12 13:48:10 +01:00
* Remove `AuthenticatedVoter::IS_AUTHENTICATED_ANONYMOUSLY` and `AuthenticatedVoter::IS_ANONYMOUS` ,
use `AuthenticatedVoter::PUBLIC_ACCESS` instead.
Before:
```yaml
# config/packages/security.yaml
security:
# ...
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
```
After:
```yaml
# config/packages/security.yaml
security:
# ...
access_control:
- { path: ^/login, roles: PUBLIC_ACCESS }
```
* Remove `AuthenticationTrustResolverInterface::isAnonymous()` and the `is_anonymous()` expression function
as anonymous no longer exists in version 6, use the `isFullFledged()` or the new `isAuthenticated()` instead
if you want to check if the request is (fully) authenticated.
2021-07-03 22:34:24 +01:00
* Remove the 4th and 5th argument of `AuthorizationChecker`
* Remove the 5th argument of `AccessListener`
2021-03-07 13:54:55 +00:00
* Remove class `User` , use `InMemoryUser` or your own implementation instead.
If you are using the `isAccountNonLocked()` , `isAccountNonExpired()` or `isCredentialsNonExpired()` method, consider re-implementing them
in your own user class as they are not part of the `InMemoryUser` API
* Remove class `UserChecker` , use `InMemoryUserChecker` or your own implementation instead
2021-02-16 11:14:29 +00:00
* Remove `UserInterface::getPassword()`
If your `getPassword()` method does not return `null` (i.e. you are using password-based authentication),
you should implement `PasswordAuthenticatedUserInterface` .
Before:
```php
use Symfony\Component\Security\Core\User\UserInterface;
class User implements UserInterface
{
// ...
public function getPassword()
{
return $this->password;
}
}
```
After:
```php
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
// ...
public function getPassword(): ?string
{
return $this->password;
}
}
```
* Remove `UserInterface::getSalt()`
If your `getSalt()` method does not return `null` (i.e. you are using password-based authentication with an old password hash algorithm that requires user-provided salts),
implement `LegacyPasswordAuthenticatedUserInterface` .
Before:
```php
use Symfony\Component\Security\Core\User\UserInterface;
class User implements UserInterface
{
// ...
public function getPassword()
{
return $this->password;
}
public function getSalt()
{
return $this->salt;
}
}
```
After:
```php
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\LegacyPasswordAuthenticatedUserInterface;
class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
{
// ...
public function getPassword(): ?string
{
return $this->password;
}
public function getSalt(): ?string
{
return $this->salt;
}
}
```
2021-03-10 16:10:58 +00:00
* Remove `UserInterface::getUsername()` in favor of `UserInterface::getUserIdentifier()`
* Remove `TokenInterface::getUsername()` in favor of `TokenInterface::getUserIdentifier()`
* Remove `UserProviderInterface::loadUserByUsername()` in favor of `UserProviderInterface::loadUserByIdentifier()`
* Remove `UsernameNotFoundException` in favor of `UserNotFoundException` and `getUsername()` /`setUsername()` in favor of `getUserIdentifier()` /`setUserIdentifier()`
* Remove `PersistentTokenInterface::getUsername()` in favor of `PersistentTokenInterface::getUserIdentifier()`
2021-02-16 11:14:29 +00:00
* Calling `PasswordUpgraderInterface::upgradePassword()` with a `UserInterface` instance that
does not implement `PasswordAuthenticatedUserInterface` now throws a `\TypeError` .
* Calling methods `hashPassword()` , `isPasswordValid()` and `needsRehash()` on `UserPasswordHasherInterface`
with a `UserInterface` instance that does not implement `PasswordAuthenticatedUserInterface` now throws a `\TypeError`
2021-01-05 00:14:26 +00:00
* Drop all classes in the `Core\Encoder\` sub-namespace, use the `PasswordHasher` component instead
2020-10-17 22:28:45 +01:00
* Drop support for `SessionInterface $session` as constructor argument of `SessionTokenStorage` , inject a `\Symfony\Component\HttpFoundation\RequestStack $requestStack` instead
* Drop support for `session` provided by the ServiceLocator injected in `UsageTrackingTokenStorage` , provide a `request_stack` service instead
* Make `SessionTokenStorage` throw a `SessionNotFoundException` when called outside a request context
2020-02-28 11:18:46 +00:00
* Removed `ROLE_PREVIOUS_ADMIN` role in favor of `IS_IMPERSONATOR` attribute
2020-03-22 11:58:26 +00:00
* Removed `LogoutSuccessHandlerInterface` and `LogoutHandlerInterface` , register a listener on the `LogoutEvent` event instead.
* Removed `DefaultLogoutSuccessHandler` in favor of `DefaultLogoutListener` .
2020-05-16 11:36:39 +01:00
* Added a `logout(Request $request, Response $response, TokenInterface $token)` method to the `RememberMeServicesInterface` .
2020-08-25 13:54:02 +01:00
* Removed `setProviderKey()` /`getProviderKey()` in favor of `setFirewallName()/getFirewallName()`
in `PreAuthenticatedToken` , `RememberMeToken` , `SwitchUserToken` , `UsernamePasswordToken` ,
`DefaultAuthenticationSuccessHandler` .
* Removed the `AbstractRememberMeServices::$providerKey` property in favor of `AbstractRememberMeServices::$firewallName`
2020-12-05 20:52:04 +00:00
* `AccessDecisionManager` now throw an exception when a voter does not return a valid decision.
2021-05-09 15:09:05 +01:00
* Remove `AuthenticationManagerInterface` , `AuthenticationProviderManager` , `AnonymousAuthenticationProvider` ,
`AuthenticationProviderInterface` , `DaoAuthenticationProvider` , `LdapBindAuthenticationProvider` ,
`PreAuthenticatedAuthenticationProvider` , `RememberMeAuthenticationProvider` , `UserAuthenticationProvider` and
`AuthenticationFailureEvent` from security-core, use the new authenticator system instead
* Remove `AbstractAuthenticationListener` , `AbstractPreAuthenticatedListener` , `AnonymousAuthenticationListener` ,
`BasicAuthenticationListener` , `RememberMeListener` , `RemoteUserAuthenticationListener` ,
`UsernamePasswordFormAuthenticationListener` , `UsernamePasswordJsonAuthenticationListener` and `X509AuthenticationListener`
from security-http, use the new authenticator system instead
* Remove the Guard component, use the new authenticator system instead
2021-08-19 17:26:41 +01:00
* Remove `TokenInterface:isAuthenticated()` and `setAuthenticated()` ,
return `null` from `getUser()` instead when a token is not authenticated
2021-07-10 17:27:35 +01:00
* Remove `DeauthenticatedEvent` , use `TokenDeauthenticatedEvent` instead
2021-07-30 10:37:32 +01:00
* Remove `CookieClearingLogoutHandler` , `SessionLogoutHandler` and `CsrfTokenClearingLogoutHandler` .
Use `CookieClearingLogoutListener` , `SessionLogoutListener` and `CsrfTokenClearingLogoutListener` instead
2021-07-19 20:09:16 +01:00
* Remove `AuthenticatorInterface::createAuthenticatedToken()` , use `AuthenticatorInterface::createToken()` instead
2021-08-15 11:52:32 +01:00
* Remove `PassportInterface` , `UserPassportInterface` and `PassportTrait` , use `Passport` instead.
2021-07-19 20:09:16 +01:00
Also, the return type declaration of `AuthenticatorInterface::authenticate()` was changed to `Passport`
Before:
```php
class MyAuthenticator implements AuthenticatorInterface
{
public function authenticate(Request $request): PassportInterface
{
}
}
```
After:
```php
class MyAuthenticator implements AuthenticatorInterface
{
public function authenticate(Request $request): Passport
{
}
}
```
2021-07-18 13:14:41 +01:00
* `AccessDecisionManager` does not accept strings as strategy anymore,
pass an instance of `AccessDecisionStrategyInterface` instead
2021-12-02 09:40:44 +00:00
* Removed the `$credentials` argument of `PreAuthenticatedToken` ,
`SwitchUserToken` and `UsernamePasswordToken` :
Before:
```php
$token = new UsernamePasswordToken($user, $credentials, $firewallName, $roles);
$token = new PreAuthenticatedToken($user, $credentials, $firewallName, $roles);
$token = new SwitchUserToken($user, $credentials, $firewallName, $roles, $originalToken);
```
After:
```php
$token = new UsernamePasswordToken($user, $firewallName, $roles);
$token = new PreAuthenticatedToken($user, $firewallName, $roles);
$token = new SwitchUserToken($user, $firewallName, $roles, $originalToken);
```
2020-04-21 07:45:37 +01:00
2021-01-05 00:14:26 +00:00
SecurityBundle
--------------
2020-11-09 10:13:07 +00:00
* Remove `FirewallConfig::getListeners()` , use `FirewallConfig::getAuthenticators()` instead
2021-08-12 20:41:03 +01:00
* Remove `security.authentication.basic_entry_point` and `security.authentication.retry_entry_point` services,
the logic is moved into the `HttpBasicAuthenticator` and `ChannelListener` respectively
2021-06-20 13:15:35 +01:00
* Remove `SecurityFactoryInterface` and `SecurityExtension::addSecurityListenerFactory()` in favor of
`AuthenticatorFactoryInterface` and `SecurityExtension::addAuthenticatorFactory()`
* Add `AuthenticatorFactoryInterface::getPriority()` which replaces `SecurityFactoryInterface::getPosition()` .
Previous positions are mapped to the following priorities:
| Position | Constant | Priority |
| ----------- | ----------------------------------------------------- | -------- |
| pre_auth | `RemoteUserFactory::PRIORITY` /`X509Factory::PRIORITY` | -10 |
| form | `FormLoginFactory::PRIORITY` | -30 |
| http | `HttpBasicFactory::PRIORITY` | -50 |
| remember_me | `RememberMeFactory::PRIORITY` | -60 |
| anonymous | n/a | -70 |
* Remove passing an array of arrays as 1st argument to `MainConfiguration` , pass a sorted flat array of
factories instead.
2021-07-03 22:34:24 +01:00
* Remove the `always_authenticate_before_granting` option
2021-01-05 00:14:26 +00:00
* Remove the `UserPasswordEncoderCommand` class and the corresponding `user:encode-password` command,
use `UserPasswordHashCommand` and `user:hash-password` instead
* Remove the `security.encoder_factory.generic` service, the `security.encoder_factory` and `Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface` aliases,
use `security.password_hasher_factory` and `Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface` instead
* Remove the `security.user_password_encoder.generic` service, the `security.password_encoder` and the `Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface` aliases,
use `security.user_password_hasher` , `security.password_hasher` and `Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface` instead
2021-04-16 17:30:15 +01:00
* The `security.authorization_checker` and `security.token_storage` services are now private
2021-05-09 15:09:05 +01:00
* Not setting the `enable_authenticator_manager` option to `true` now throws an exception
* Remove the `security.authentication.provider.*` services, use the new authenticator system instead
* Remove the `security.authentication.listener.*` services, use the new authenticator system instead
* Remove the Guard component integration, use the new authenticator system instead
2021-10-29 17:27:24 +01:00
* Remove the default provider for custom_authenticators when there is more than one registered provider
2021-01-05 00:14:26 +00:00
2020-12-19 16:23:05 +00:00
Serializer
----------
* Removed `ArrayDenormalizer::setSerializer()` , call `setDenormalizer()` instead.
* `ArrayDenormalizer` does not implement `SerializerAwareInterface` anymore.
2021-04-05 15:40:33 +01:00
* The annotation classes cannot be constructed by passing an array of parameters as first argument anymore, use named arguments instead
2020-12-19 16:23:05 +00:00
2020-06-24 15:32:54 +01:00
TwigBundle
----------
* The `twig` service is now private.
2020-05-15 09:30:39 +01:00
Validator
---------
* Removed the `allowEmptyString` option from the `Length` constraint.
Before:
```php
use Symfony\Component\Validator\Constraints as Assert;
/**
* @Assert \Length(min=5, allowEmptyString=true)
*/
```
After:
```php
use Symfony\Component\Validator\Constraints as Assert;
/**
* @Assert \AtLeastOneOf({
* @Assert \Blank(),
* @Assert \Length(min=5)
* })
*/
```
2020-09-29 21:47:47 +01:00
* Removed the `NumberConstraintTrait` trait.
2020-12-10 20:03:43 +00:00
* `ValidatorBuilder::enableAnnotationMapping()` does not accept a Doctrine annotation reader anymore.
2020-11-07 19:15:36 +00:00
Before:
```php
$builder->enableAnnotationMapping($reader);
```
After:
```php
2021-11-20 13:33:26 +00:00
$builder
->enableAnnotationMapping()
2020-11-07 19:15:36 +00:00
->setDoctrineAnnotationReader($reader);
```
2020-12-10 20:03:43 +00:00
* `ValidatorBuilder::enableAnnotationMapping()` won't automatically setup a Doctrine annotation reader anymore.
2020-11-07 19:15:36 +00:00
Before:
```php
$builder->enableAnnotationMapping();
```
After:
```php
2021-11-20 13:33:26 +00:00
$builder
->enableAnnotationMapping()
2020-11-07 19:15:36 +00:00
->addDefaultDoctrineAnnotationReader();
```
2021-02-15 14:46:52 +00:00
Workflow
--------
* Remove `InvalidTokenConfigurationException`
2020-04-21 07:45:37 +01:00
Yaml
----
2019-12-04 11:12:45 +00:00
* Added support for parsing numbers prefixed with `0o` as octal numbers.
* Removed support for parsing numbers starting with `0` as octal numbers. They will be parsed as strings. Prefix numbers with `0o`
so that they are parsed as octal numbers.
Before:
```yaml
Yaml::parse('072');
```
After:
```yaml
Yaml::parse('0o72');
```
2020-04-21 07:45:37 +01:00
* Removed support for using the `!php/object` and `!php/const` tags without a value.