Upgrading symfony/config 6 to 7
Breakingv6.4.49 → v7.4.22Breaking3Security1Platform1Deprecated5New15Changed1Fixed39Other1
Fetching 49 releases from GitHub…48 / 49
BreakingUpgrade verdict
3 breaking changes and a platform requirement change and a security fix.
In plain terms
- Code that was deprecated in earlier versions is gone, so anything still using it will break.
- Methods now declare their return types in code, so subclasses that override them must match.
- Magic methods such as __get and __set now declare return types, so overriding classes must match.
- This version requires PHP 8.2 or newer to run.
Must act Top 5 of 10 that need code or config changes
PHP requirement changed in v7.0.0-BETA1: >=8.1 → >=8.2.
What you must change
Breaking3
Removes remaining deprecated code paths.
Converts component methods to native return types.
Adds missing return types to magic methods.
Security1
Hardens __toString trampolines via __unserialize().
__toString__unserializePlatform1
Bumps the minimum PHP version to 8.2.
Deprecations to plan for
Deprecated5
Deprecates config builder generators.
Deprecates the fluent PHP format for semantic configuration.
Deprecates setting a default value on a node that is required.
Deprecates ExtensionInterface::getXsdValidationBasePath() and getNamespace().
ExtensionInterface::getXsdValidationBasePath()ExtensionInterface::getNamespace()Deprecates using $this or the internal loader scope from PHP config files.
$thisAPI changes
Generated by DepDelta from published PHP source. Not mixed with prose notes.
- changed:
constructor ConfigCache(string $file, bool $debug) → constructor ConfigCache(string $file, bool $debug, ?string $metaFile = …, ?array $skippedResourceTypes = …) - changed:
constructor ResourceCheckerConfigCache(string $file, iterable $resourceCheckers = …) → constructor ResourceCheckerConfigCache(string $file, iterable $resourceCheckers = …, ?string $metaFile = …) - changed:
method ConfigCacheInterface.write(string $content, ?array $metadata = …) → method ConfigCacheInterface.write(string $content, ?array $metadata = …): void - changed:
method FileLocator.locate(string $name, ?string $currentPath = …, bool $first = …) → method FileLocator.locate(string $name, ?string $currentPath = …, bool $first = …): string|array - changed:
method FileLocatorInterface.locate(string $name, ?string $currentPath = …, bool $first = …) → method FileLocatorInterface.locate(string $name, ?string $currentPath = …, bool $first = …): string|array - changed:
method ResourceCheckerConfigCache.write(string $content, ?array $metadata = …) → method ResourceCheckerConfigCache.write(string $content, ?array $metadata = …): void - changed:
method ResourceCheckerInterface.isFresh(ResourceInterface $resource, int $timestamp) → method ResourceCheckerInterface.isFresh(ResourceInterface $resource, int $timestamp): bool - changed:
method ResourceCheckerInterface.supports(ResourceInterface $metadata) → method ResourceCheckerInterface.supports(ResourceInterface $metadata): bool - changed:
protected property FileLocator.paths → protected property FileLocator.paths: array
- changed:
constructor ClassBuilder(string $namespace, string $name) → constructor ClassBuilder(string $namespace, string $name, NodeInterface $node, bool $isRoot = …) - added:
method ClassBuilder.getNode(): NodeInterface - added:
property ClassBuilder.isRoot: bool
- changed:
constructor EnumNode(?string $name, ?NodeInterface $parent = …, array $values = …, string $pathSeparator = …) → constructor EnumNode(?string $name, ?NodeInterface $parent = …, array $values = …, string $pathSeparator = …, ?string $enumFqcn = …) - changed:
method ArrayNode.addChild(NodeInterface $node) → method ArrayNode.addChild(NodeInterface $node): void - changed:
method ArrayNode.setAddIfNotSet(bool $boolean) → method ArrayNode.setAddIfNotSet(bool $boolean): void - changed:
method ArrayNode.setAllowFalse(bool $allow) → method ArrayNode.setAllowFalse(bool $allow): void - changed:
method ArrayNode.setAllowNewKeys(bool $allow) → method ArrayNode.setAllowNewKeys(bool $allow): void - changed:
method ArrayNode.setIgnoreExtraKeys(bool $boolean, bool $remove = …) → method ArrayNode.setIgnoreExtraKeys(bool $boolean, bool $remove = …): void - changed:
method ArrayNode.setName(string $name) → method ArrayNode.setName(string $name): void - changed:
method ArrayNode.setNormalizeKeys(bool $normalizeKeys) → method ArrayNode.setNormalizeKeys(bool $normalizeKeys): void - changed:
method ArrayNode.setPerformDeepMerging(bool $boolean) → method ArrayNode.setPerformDeepMerging(bool $boolean): void - changed:
method ArrayNode.setXmlRemappings(array $remappings) → method ArrayNode.setXmlRemappings(array $remappings): void - changed:
method BaseNode.addEquivalentValue(mixed $originalValue, mixed $equivalentValue) → method BaseNode.addEquivalentValue(mixed $originalValue, mixed $equivalentValue): void - changed:
method BaseNode.removeAttribute(string $key) → method BaseNode.removeAttribute(string $key): void - changed:
method BaseNode.setAllowOverwrite(bool $allow) → method BaseNode.setAllowOverwrite(bool $allow): void - changed:
method BaseNode.setAttribute(string $key, mixed $value) → method BaseNode.setAttribute(string $key, mixed $value): void - changed:
method BaseNode.setAttributes(array $attributes) → method BaseNode.setAttributes(array $attributes): void - changed:
method BaseNode.setDeprecated(string $package, string $version, string $message = …) → method BaseNode.setDeprecated(string $package, string $version, string $message = …): void - changed:
method BaseNode.setExample(string|array $example) → method BaseNode.setExample(string|array $example): void - changed:
method BaseNode.setFinalValidationClosures(array $closures) → method BaseNode.setFinalValidationClosures(array $closures): void - changed:
method BaseNode.setInfo(string $info) → method BaseNode.setInfo(string $info): void - changed:
method BaseNode.setNormalizationClosures(array $closures) → method BaseNode.setNormalizationClosures(array $closures): void - changed:
method BaseNode.setNormalizedTypes(array $types) → method BaseNode.setNormalizedTypes(array $types): void - changed:
method BaseNode.setRequired(bool $boolean) → method BaseNode.setRequired(bool $boolean): void - changed:
method ConfigurationInterface.getConfigTreeBuilder() → method ConfigurationInterface.getConfigTreeBuilder(): TreeBuilder - changed:
method EnumNode.getPermissibleValues(string $separator): string → method EnumNode.getPermissibleValues(string $separator, bool $trim = …): string - changed:
method EnumNode.getValues() → method EnumNode.getValues(): array - changed:
method PrototypeNodeInterface.setName(string $name) → method PrototypeNodeInterface.setName(string $name): void - changed:
method PrototypedArrayNode.addChild(NodeInterface $node) → method PrototypedArrayNode.addChild(NodeInterface $node): never - changed:
method PrototypedArrayNode.setAddChildrenIfNoneSet(int|string|array|null $children = …) → method PrototypedArrayNode.setAddChildrenIfNoneSet(int|string|array|null $children = …): void - changed:
method PrototypedArrayNode.setDefaultValue(array $value) → method PrototypedArrayNode.setDefaultValue(array $value): void - changed:
method PrototypedArrayNode.setKeyAttribute(string $attribute, bool $remove = …) → method PrototypedArrayNode.setKeyAttribute(string $attribute, bool $remove = …): void - changed:
method PrototypedArrayNode.setMinNumberOfElements(int $number) → method PrototypedArrayNode.setMinNumberOfElements(int $number): void - changed:
method PrototypedArrayNode.setPrototype(PrototypeNodeInterface $node) → method PrototypedArrayNode.setPrototype(PrototypeNodeInterface $node): void - changed:
method VariableNode.setAllowEmptyValue(bool $boolean) → method VariableNode.setAllowEmptyValue(bool $boolean): void - changed:
method VariableNode.setDefaultValue(mixed $value) → method VariableNode.setDefaultValue(mixed $value): void - changed:
method VariableNode.setName(string $name) → method VariableNode.setName(string $name): void - changed:
protected method ArrayNode.validateType(mixed $value) → protected method ArrayNode.validateType(mixed $value): void - changed:
protected method BaseNode.validateType(mixed $value) → protected method BaseNode.validateType(mixed $value): void - changed:
protected method BooleanNode.validateType(mixed $value) → protected method BooleanNode.validateType(mixed $value): void - changed:
protected method EnumNode.validateType(mixed $value) → protected method EnumNode.validateType(mixed $value): void - changed:
protected method FloatNode.validateType(mixed $value) → protected method FloatNode.validateType(mixed $value): void - changed:
protected method IntegerNode.validateType(mixed $value) → protected method IntegerNode.validateType(mixed $value): void - changed:
protected method ScalarNode.validateType(mixed $value) → protected method ScalarNode.validateType(mixed $value): void - changed:
protected method VariableNode.validateType(mixed $value) → protected method VariableNode.validateType(mixed $value): void - changed:
protected property ArrayNode.addIfNotSet → protected property ArrayNode.addIfNotSet: bool - changed:
protected property ArrayNode.allowFalse → protected property ArrayNode.allowFalse: bool - changed:
protected property ArrayNode.allowNewKeys → protected property ArrayNode.allowNewKeys: bool - changed:
protected property ArrayNode.children → protected property ArrayNode.children: array - changed:
protected property ArrayNode.ignoreExtraKeys → protected property ArrayNode.ignoreExtraKeys: bool - changed:
protected property ArrayNode.normalizeKeys → protected property ArrayNode.normalizeKeys: bool - changed:
protected property ArrayNode.performDeepMerging → protected property ArrayNode.performDeepMerging: bool - changed:
protected property ArrayNode.removeExtraKeys → protected property ArrayNode.removeExtraKeys: bool - changed:
protected property ArrayNode.xmlRemappings → protected property ArrayNode.xmlRemappings: array - changed:
protected property BaseNode.allowOverwrite → protected property BaseNode.allowOverwrite: bool - changed:
protected property BaseNode.attributes → protected property BaseNode.attributes: array - changed:
protected property BaseNode.deprecation → protected property BaseNode.deprecation: array - changed:
protected property BaseNode.equivalentValues → protected property BaseNode.equivalentValues: array - changed:
protected property BaseNode.finalValidationClosures → protected property BaseNode.finalValidationClosures: array - changed:
protected property BaseNode.name → protected property BaseNode.name: string - changed:
protected property BaseNode.normalizationClosures → protected property BaseNode.normalizationClosures: array - changed:
protected property BaseNode.normalizedTypes → protected property BaseNode.normalizedTypes: array - changed:
protected property BaseNode.parent → protected property BaseNode.parent: ?NodeInterface - changed:
protected property BaseNode.pathSeparator → protected property BaseNode.pathSeparator: string - changed:
protected property BaseNode.required → protected property BaseNode.required: bool - changed:
protected property NumericNode.max → protected property NumericNode.max: int|float|null - changed:
protected property NumericNode.min → protected property NumericNode.min: int|float|null - changed:
protected property PrototypedArrayNode.defaultChildren → protected property PrototypedArrayNode.defaultChildren: ?array - changed:
protected property PrototypedArrayNode.defaultValue → protected property PrototypedArrayNode.defaultValue: array - changed:
protected property PrototypedArrayNode.keyAttribute → protected property PrototypedArrayNode.keyAttribute: ?string - changed:
protected property PrototypedArrayNode.minNumberOfElements → protected property PrototypedArrayNode.minNumberOfElements: int - changed:
protected property PrototypedArrayNode.prototype → protected property PrototypedArrayNode.prototype: PrototypeNodeInterface - changed:
protected property PrototypedArrayNode.removeKeyAttribute → protected property PrototypedArrayNode.removeKeyAttribute: bool - changed:
protected property VariableNode.allowEmptyValue → protected property VariableNode.allowEmptyValue: bool - changed:
protected property VariableNode.defaultValue → protected property VariableNode.defaultValue: mixed - changed:
protected property VariableNode.defaultValueSet → protected property VariableNode.defaultValueSet: bool - added:
class StringNode extends ScalarNode - added:
constructor BooleanNode(?string $name, ?NodeInterface $parent = …, string $pathSeparator = …, bool $nullable = …) - added:
final class ArrayShapeGenerator - added:
method ArrayNode.shouldPerformDeepMerging(): bool - added:
method BaseNode.getDeprecationMessage(?NodeInterface $parent = …): string - added:
method EnumNode.getEnumFqcn(): ?string - added:
method NumericNode.getMax(): float|int|null - added:
method NumericNode.getMin(): float|int|null - added:
method PrototypedArrayNode.setNullAsDefault(): void - added:
protected method StringNode.getValidPlaceholderTypes(): array - added:
protected method StringNode.validateType(mixed $value): void - added:
static method ArrayShapeGenerator.generate(NodeInterface $node): string
- changed:
method ArrayNodeDefinition.setBuilder(NodeBuilder $builder) → method ArrayNodeDefinition.setBuilder(NodeBuilder $builder): void - changed:
method BuilderAwareInterface.setBuilder(NodeBuilder $builder) → method BuilderAwareInterface.setBuilder(NodeBuilder $builder): void - changed:
method ExprBuilder.end(): NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition → method ExprBuilder.end(): NodeDefinition - changed:
method MergeBuilder.end(): NodeDefinition|ArrayNodeDefinition|VariableNodeDefinition → method MergeBuilder.end(): NodeDefinition - changed:
method NodeBuilder.end() → method NodeBuilder.end(): (NodeDefinition&ParentNodeDefinitionInterface)|null - changed:
method NodeBuilder.setParent(?ParentNodeDefinitionInterface $parent = …): static → method NodeBuilder.setParent((NodeDefinition&ParentNodeDefinitionInterface)|null $parent): static - changed:
method NodeDefinition.end(): NodeParentInterface|NodeBuilder|self|ArrayNodeDefinition|VariableNodeDefinition|null → method NodeDefinition.end(): ?NodeParentInterface - changed:
method TreeBuilder.getRootNode(): NodeDefinition|ArrayNodeDefinition → method TreeBuilder.getRootNode(): NodeDefinition - changed:
method TreeBuilder.setPathSeparator(string $separator) → method TreeBuilder.setPathSeparator(string $separator): void - changed:
property ExprBuilder.allowedTypes → property ExprBuilder.allowedTypes: string - changed:
property ExprBuilder.ifPart → property ExprBuilder.ifPart: ?\Closure - changed:
property ExprBuilder.thenPart → property ExprBuilder.thenPart: ?\Closure - changed:
property MergeBuilder.allowFalse → property MergeBuilder.allowFalse: bool - changed:
property MergeBuilder.allowOverwrite → property MergeBuilder.allowOverwrite: bool - changed:
property NormalizationBuilder.before → property NormalizationBuilder.before: array - changed:
property NormalizationBuilder.declaredTypes → property NormalizationBuilder.declaredTypes: array - changed:
property NormalizationBuilder.remappings → property NormalizationBuilder.remappings: array - changed:
property ValidationBuilder.rules → property ValidationBuilder.rules: array - changed:
protected method ArrayNodeDefinition.validateConcreteNode(ArrayNode $node) → protected method ArrayNodeDefinition.validateConcreteNode(ArrayNode $node): void - changed:
protected method ArrayNodeDefinition.validatePrototypeNode(PrototypedArrayNode $node) → protected method ArrayNodeDefinition.validatePrototypeNode(PrototypedArrayNode $node): void - changed:
protected property ArrayNodeDefinition.addDefaultChildren → protected property ArrayNodeDefinition.addDefaultChildren: int|string|array|false|null - changed:
protected property ArrayNodeDefinition.addDefaults → protected property ArrayNodeDefinition.addDefaults: bool - changed:
protected property ArrayNodeDefinition.allowNewKeys → protected property ArrayNodeDefinition.allowNewKeys: bool - changed:
protected property ArrayNodeDefinition.atLeastOne → protected property ArrayNodeDefinition.atLeastOne: bool - changed:
protected property ArrayNodeDefinition.children → protected property ArrayNodeDefinition.children: array - changed:
protected property ArrayNodeDefinition.ignoreExtraKeys → protected property ArrayNodeDefinition.ignoreExtraKeys: bool - changed:
protected property ArrayNodeDefinition.key → protected property ArrayNodeDefinition.key: ?string - changed:
protected property ArrayNodeDefinition.nodeBuilder → protected property ArrayNodeDefinition.nodeBuilder: NodeBuilder - changed:
protected property ArrayNodeDefinition.normalizeKeys → protected property ArrayNodeDefinition.normalizeKeys: bool - changed:
protected property ArrayNodeDefinition.performDeepMerging → protected property ArrayNodeDefinition.performDeepMerging: bool - changed:
protected property ArrayNodeDefinition.prototype → protected property ArrayNodeDefinition.prototype: NodeDefinition - changed:
protected property ArrayNodeDefinition.removeExtraKeys → protected property ArrayNodeDefinition.removeExtraKeys: bool - changed:
protected property ArrayNodeDefinition.removeKeyItem → protected property ArrayNodeDefinition.removeKeyItem: bool - changed:
protected property ExprBuilder.node → protected property ExprBuilder.node: NodeDefinition - changed:
protected property MergeBuilder.node → protected property MergeBuilder.node: NodeDefinition - changed:
protected property NodeBuilder.nodeMapping → protected property NodeBuilder.nodeMapping: array - changed:
protected property NodeBuilder.parent → protected property NodeBuilder.parent: (NodeDefinition&ParentNodeDefinitionInterface)|null - changed:
protected property NodeDefinition.allowEmptyValue → protected property NodeDefinition.allowEmptyValue: bool - changed:
protected property NodeDefinition.attributes → protected property NodeDefinition.attributes: array - changed:
protected property NodeDefinition.default → protected property NodeDefinition.default: bool - changed:
protected property NodeDefinition.defaultValue → protected property NodeDefinition.defaultValue: mixed - changed:
protected property NodeDefinition.deprecation → protected property NodeDefinition.deprecation: array - changed:
protected property NodeDefinition.falseEquivalent → protected property NodeDefinition.falseEquivalent: mixed - changed:
protected property NodeDefinition.merge → protected property NodeDefinition.merge: MergeBuilder - changed:
protected property NodeDefinition.name → protected property NodeDefinition.name: ?string - changed:
protected property NodeDefinition.normalization → protected property NodeDefinition.normalization: NormalizationBuilder - changed:
protected property NodeDefinition.nullEquivalent → protected property NodeDefinition.nullEquivalent: mixed - changed:
protected property NodeDefinition.parent → protected property NodeDefinition.parent: NodeParentInterface|NodeInterface|null - changed:
protected property NodeDefinition.pathSeparator → protected property NodeDefinition.pathSeparator: string - changed:
protected property NodeDefinition.required → protected property NodeDefinition.required: bool - changed:
protected property NodeDefinition.trueEquivalent → protected property NodeDefinition.trueEquivalent: mixed - changed:
protected property NodeDefinition.validation → protected property NodeDefinition.validation: ValidationBuilder - changed:
protected property NormalizationBuilder.node → protected property NormalizationBuilder.node: NodeDefinition - changed:
protected property NumericNodeDefinition.max → protected property NumericNodeDefinition.max: int|float|null - changed:
protected property NumericNodeDefinition.min → protected property NumericNodeDefinition.min: int|float|null - changed:
protected property TreeBuilder.root → protected property TreeBuilder.root: ?NodeDefinition - changed:
protected property TreeBuilder.tree → protected property TreeBuilder.tree: ?NodeInterface - changed:
protected property ValidationBuilder.node → protected property ValidationBuilder.node: NodeDefinition - added:
class StringNodeDefinition extends ScalarNodeDefinition - added:
const ExprBuilder.TYPE_BACKED_ENUM - added:
const ExprBuilder.TYPE_BOOL - added:
const ExprBuilder.TYPE_INT - added:
constructor StringNodeDefinition(?string $name, ?NodeParentInterface $parent = …) - added:
method ArrayNodeDefinition.acceptAndWrap(array $allowedTypes, ?string $key = …): static - added:
method ArrayNodeDefinition.defaultValue(mixed $value): static - added:
method ArrayNodeDefinition.stringPrototype(): StringNodeDefinition - added:
method BooleanNodeDefinition.defaultValue(mixed $value): static - added:
method EnumNodeDefinition.enumFqcn(string $enumFqcn): static - added:
method ExprBuilder.ifFalse(?\Closure $closure = …): static - added:
method NodeBuilder.stringNode(string $name): StringNodeDefinition - added:
method NodeDefinition.docUrl(string $uri, ?string $package = …): static - added:
protected method StringNodeDefinition.instantiateNode(): StringNode - added:
protected property ArrayNodeDefinition.allowedTypes: ?array
- changed:
method DefinitionConfigurator.rootNode(): NodeDefinition|ArrayNodeDefinition → method DefinitionConfigurator.rootNode(): NodeDefinition
- changed:
method XmlReferenceDumper.dump(ConfigurationInterface $configuration, ?string $namespace = …) → method XmlReferenceDumper.dump(ConfigurationInterface $configuration, ?string $namespace = …): string - changed:
method XmlReferenceDumper.dumpNode(NodeInterface $node, ?string $namespace = …) → method XmlReferenceDumper.dumpNode(NodeInterface $node, ?string $namespace = …): string - changed:
method YamlReferenceDumper.dump(ConfigurationInterface $configuration) → method YamlReferenceDumper.dump(ConfigurationInterface $configuration): string - changed:
method YamlReferenceDumper.dumpAtPath(ConfigurationInterface $configuration, string $path) → method YamlReferenceDumper.dumpAtPath(ConfigurationInterface $configuration, string $path): string - changed:
method YamlReferenceDumper.dumpNode(NodeInterface $node) → method YamlReferenceDumper.dumpNode(NodeInterface $node): string
- changed:
method InvalidConfigurationException.addHint(string $hint) → method InvalidConfigurationException.addHint(string $hint): void - changed:
method InvalidConfigurationException.setPath(string $path) → method InvalidConfigurationException.setPath(string $path): void
- changed:
method FileLocatorFileNotFoundException.getPaths() → method FileLocatorFileNotFoundException.getPaths(): array - changed:
protected method LoaderLoadException.varToString(mixed $var) → protected method LoaderLoadException.varToString(mixed $var): string - added:
class LogicException extends \LogicException
- changed:
method FileLoader.import(mixed $resource, ?string $type = …, bool $ignoreErrors = …, ?string $sourceResource = …, string|array|null $exclude = …) → method FileLoader.import(mixed $resource, ?string $type = …, bool $ignoreErrors = …, ?string $sourceResource = …, string|array|null $exclude = …): mixed - changed:
method FileLoader.setCurrentDir(string $dir) → method FileLoader.setCurrentDir(string $dir): void - changed:
method Loader.import(mixed $resource, ?string $type = …) → method Loader.import(mixed $resource, ?string $type = …): mixed - changed:
method Loader.setResolver(LoaderResolverInterface $resolver) → method Loader.setResolver(LoaderResolverInterface $resolver): void - changed:
method LoaderInterface.getResolver() → method LoaderInterface.getResolver(): LoaderResolverInterface - changed:
method LoaderInterface.load(mixed $resource, ?string $type = …) → method LoaderInterface.load(mixed $resource, ?string $type = …): mixed - changed:
method LoaderInterface.setResolver(LoaderResolverInterface $resolver) → method LoaderInterface.setResolver(LoaderResolverInterface $resolver): void - changed:
method LoaderInterface.supports(mixed $resource, ?string $type = …) → method LoaderInterface.supports(mixed $resource, ?string $type = …): bool - changed:
method LoaderResolver.addLoader(LoaderInterface $loader) → method LoaderResolver.addLoader(LoaderInterface $loader): void - changed:
protected property FileLoader.locator → protected property FileLoader.locator: FileLocatorInterface - changed:
protected property Loader.env → protected property Loader.env: ?string - changed:
protected property Loader.resolver → protected property Loader.resolver: ?LoaderResolverInterface - changed:
protected static property FileLoader.loading → protected static property FileLoader.loading: array
- added:
class SkippingResourceChecker implements ResourceCheckerInterface - added:
constructor SkippingResourceChecker(array $skippedResourceTypes = …) - added:
method ComposerResource.__serialize(): array - added:
method DirectoryResource.__serialize(): array - added:
method FileExistenceResource.__serialize(): array - added:
method FileResource.__serialize(): array - added:
method SkippingResourceChecker.__serialize(): array - added:
method SkippingResourceChecker.isFresh(ResourceInterface $resource, int $timestamp): bool - added:
method SkippingResourceChecker.supports(ResourceInterface $metadata): bool
- changed:
protected static method XmlUtils.getXmlErrors(bool $internalErrors) → protected static method XmlUtils.getXmlErrors(bool $internalErrors): array