Symfony 8.1 is a minor release. According to the Symfony release process, there should be no significant
backward compatibility breaks. Minor backward compatibility breaks are prefixed in this document with
[BC BREAK], make sure your code is compatible with these entries before upgrading.
Read more about this in the Symfony documentation.
If you're upgrading from a version below 8.0, follow the 8.0 upgrade guide first.
- [BC BREAK] Add
objectsupport to input options and arguments' default by changing the$defaulttype tomixedinInputArgument,InputOption,#[Argument]and#[Option]
- Deprecate configuring options
alias,parent,synthetic,file,arguments,properties,configuratororcallswhen usingfrom_callable - Deprecate default index/priority methods when defining tagged locators/iterators; use the
#[AsTaggedItem]attribute instead
- Deprecate setting an
$aliasMapinRegisterMappingsPass. Namespace aliases are no longer supported in Doctrine.
- Deprecate setting the
framework.profiler.collect_serializer_dataconfig option - Deprecate parameters
router.request_context.schemeandrouter.request_context.host; use therouter.request_context.base_urlparameter or theframework.router.default_uriconfig option instead
-
Deprecate passing a non-flat list of attributes to
Controller::setController() -
Deprecate the
Symfony\Component\HttpKernel\DependencyInjection\Extensionclass, use the parentSymfony\Component\DependencyInjection\Extension\Extensionclass instead:- use Symfony\Component\HttpKernel\DependencyInjection\Extension; + use Symfony\Component\DependencyInjection\Extension\Extension; class ExampleExtension extends Extension { // ... }
-
Deprecate passing a
ControllerArgumentsEventto theViewEventconstructor; pass aControllerArgumentsMetadatainstead
- Add
getParentRoleNames()method toRoleHierarchyInterface - Make
RoleHierarchyInterface::getReachableRoleNames()return roles as both keys and values - Deprecate
SameOriginCsrfTokenManager::onKernelResponse(),SameOriginCsrfTokenManager::clearCookies()andSameOriginCsrfTokenManager::persistStrategy(); this logic is now handled automatically bySameOriginCsrfListener
- Deprecate datetime constructor as a fallback, in version 9.0 a
Symfony\Component\Serializer\Exception\NotNormalizableValueExceptionwill be thrown when a date could not be parsed using the default format
- Add argument
$formattoUlid::isValid()