Symfony 7.3 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 7.1, follow the 7.2 upgrade guide first.
-
Omitting parameter types in callables configured via
Command::setCode
method is deprecatedBefore
$command->setCode(function ($input, $output) { // ... });
After
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; $command->setCode(function (InputInterface $input, OutputInterface $output) { // ... });
-
Deprecate methods
Command::getDefaultName()
andCommand::getDefaultDescription()
in favor of the#[AsCommand]
attribute
- Not setting the
framework.property_info.with_constructor_extractor
option explicitly is deprecated because its default value will change in version 8.0 - Deprecate the
--show-arguments
option of thecontainer:debug
command, as arguments are now always shown
- Deprecate the
CompiledClassMetadataFactory
andCompiledClassMetadataCacheWarmer
classes
-
Deprecate defining custom constraints not supporting named arguments
Before:
use Symfony\Component\Validator\Constraint; class CustomConstraint extends Constraint { public function __construct(array $options) { // ... } }
After:
use Symfony\Component\Validator\Attribute\HasNamedArguments; use Symfony\Component\Validator\Constraint; class CustomConstraint extends Constraint { #[HasNamedArguments] public function __construct($option1, $option2, $groups, $payload) { // ... } }
-
Deprecate passing an array of options to the constructors of the constraint classes, pass each option as a dedicated argument instead
Before:
new NotNull([ 'groups' => ['foo', 'bar'], 'message' => 'a custom constraint violation message', ])
After:
new NotNull( groups: ['foo', 'bar'], message: 'a custom constraint violation message', )
- Deprecate constructing a
CollectionType
instance as a list that is not an array - Deprecate the third
$asList
argument ofTypeFactoryTrait::iterable()
, useTypeFactoryTrait::list()
instead
- Deprecate
ResourceCaster::castCurl()
,ResourceCaster::castGd()
andResourceCaster::castOpensslX509()
- Mark all casters as
@internal