Symfony 7.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 7.0, follow the 7.0 upgrade guide first.
Bundles
Bridges
Components
- AssetMapper
- Cache
- DependencyInjection
- ExpressionLanguage
- Form
- Intl
- PropertyInfo
- Translation
- Workflow
- Deprecate
ImportMapConfigReader::splitPackageNameAndFilePath(), useImportMapEntry::splitPackageNameAndFilePath()instead
- Deprecate
CouchbaseBucketAdapter, useCouchbaseCollectionAdapterwith Couchbase 3 instead
- [BC BREAK] When used in the
prependExtension()method, theContainerConfigurator::import()method now prepends the configuration instead of appending it
- Deprecated
DoctrineExtractor::getTypes(), useDoctrineExtractor::getType()instead
- Deprecate passing
nullas the allowed variable names toExpressionLanguage::lint()andParser::lint(), pass theIGNORE_UNKNOWN_VARIABLESflag instead to ignore unknown variables during linting
- Deprecate not configuring the
default_protocoloption of theUrlType, it will default tonullin 8.0 (the current default is'http')
- Mark classes
ConfigBuilderCacheWarmer,Router,SerializerCacheWarmer,TranslationsCacheWarmer,TranslatorandValidatorCacheWarmerasfinal - Deprecate the
router.cache_dirconfig option, the Router will always use thekernel.build_dirparameter
- [BC BREAK] Extracted
EmojiTransliteratorto a separatesymfony/emojicomponent, the new FQCN isSymfony\Component\Emoji\EmojiTransliterator. You must install thesymfony/emojicomponent if you're using the oldEmojiTransliteratorclass in the Intl component.
- Postmark's "406 - Inactive recipient" API error code now results in a
PostmarkDeliveryEventinstead of throwing aHttpTransportException
-
Deprecate the
Typeclass, useSymfony\Component\TypeInfo\Typeclass ofsymfony/type-infocomponent insteadBefore
use Symfony\Component\PropertyInfo\Type; // bool $boolType = new Type(LegacyType::BUILTIN_TYPE_BOOL); // bool|null $nullableType = new Type(LegacyType::BUILTIN_TYPE_BOOL, nullable: true); // array<int, string|null> $arrayType = new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_STRING, true)); $arrayType->getBuiltinType(); // returns "array" $arrayType->getCollectionKeyTypes(); // returns an array with an "int" Type instance $arrayType->getCollectionValueTypes()[0]->isNullable(); // returns true
After
use Symfony\Component\TypeInfo\Type; // bool $boolType = Type::bool(); // bool|null $nullableType = Type::nullable(Type::bool()); // array<int, string|null> $arrayType = Type::array(Type::nullable(Type::string()), Type::int()); (string) $arrayType->getBaseType(); // returns "array" $arrayType->getCollectionKeyType(); // returns an "int" Type instance $arrayType->getCollectionValueType()->isNullable(); // returns true
-
Deprecate
PropertyTypeExtractorInterface::getTypes(), usePropertyTypeExtractorInterface::getType()instead
- Deprecate
Extension::addAnnotatedClassesToCompile()and related code infrastructure
- Mark class
ExpressionCacheWarmerasfinal
- Mark class
DataCollectorTranslatorasfinal
- Mark class
TemplateCacheWarmerasfinal
- Deprecate not passing a value for the
requireTldoption to theUrlconstraint (the default value will becometruein 8.0) - Deprecate
Bic::INVALID_BANK_CODE_ERROR
- Add method
getEnabledTransition()toWorkflowInterface - Add
$nbTokenargument toMarking::mark()andMarking::unmark()