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
, useCouchbaseCollectionAdapter
with 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
null
as the allowed variable names toExpressionLanguage::lint()
andParser::lint()
, pass theIGNORE_UNKNOWN_VARIABLES
flag instead to ignore unknown variables during linting
- Deprecate not configuring the
default_protocol
option of theUrlType
, it will default tonull
in 8.0 (the current default is'http'
)
- Mark classes
ConfigBuilderCacheWarmer
,Router
,SerializerCacheWarmer
,TranslationsCacheWarmer
,Translator
andValidatorCacheWarmer
asfinal
- Deprecate the
router.cache_dir
config option, the Router will always use thekernel.build_dir
parameter
- [BC BREAK] Extracted
EmojiTransliterator
to a separatesymfony/emoji
component, the new FQCN isSymfony\Component\Emoji\EmojiTransliterator
. You must install thesymfony/emoji
component if you're using the oldEmojiTransliterator
class in the Intl component.
- Postmark's "406 - Inactive recipient" API error code now results in a
PostmarkDeliveryEvent
instead of throwing aHttpTransportException
-
Deprecate the
Type
class, useSymfony\Component\TypeInfo\Type
class ofsymfony/type-info
component 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
ExpressionCacheWarmer
asfinal
- Mark class
DataCollectorTranslator
asfinal
- Mark class
TemplateCacheWarmer
asfinal
- Deprecate not passing a value for the
requireTld
option to theUrl
constraint (the default value will becometrue
in 8.0) - Deprecate
Bic::INVALID_BANK_CODE_ERROR
- Add method
getEnabledTransition()
toWorkflowInterface
- Add
$nbToken
argument toMarking::mark()
andMarking::unmark()