diff -ruN a/Builder/ClassBuilder.php b/Builder/ClassBuilder.php --- a/Builder/ClassBuilder.php 2026-07-15 12:28:18 +++ b/Builder/ClassBuilder.php 2026-07-15 12:28:18 @@ -119,7 +119,7 @@ $this->methods[] = new Method(strtr($body, ['NAME' => $this->camelCase($name)] + $params)); } - public function addProperty(string $name, string $classType = null, string $defaultValue = null): Property + public function addProperty(string $name, ?string $classType = null, ?string $defaultValue = null): Property { $property = new Property($name, '_' !== $name[0] ? $this->camelCase($name) : $name); if (null !== $classType) { diff -ruN a/ConfigCacheInterface.php b/ConfigCacheInterface.php --- a/ConfigCacheInterface.php 2026-07-15 12:28:18 +++ b/ConfigCacheInterface.php 2026-07-15 12:28:18 @@ -41,5 +41,5 @@ * * @throws \RuntimeException When the cache file cannot be written */ - public function write(string $content, array $metadata = null); + public function write(string $content, ?array $metadata = null); } diff -ruN a/Definition/BaseNode.php b/Definition/BaseNode.php --- a/Definition/BaseNode.php 2026-07-15 12:28:18 +++ b/Definition/BaseNode.php 2026-07-15 12:28:18 @@ -45,7 +45,7 @@ /** * @throws \InvalidArgumentException if the name contains a period */ - public function __construct(?string $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR) + public function __construct(?string $name, ?NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR) { if (str_contains($name = (string) $name, $pathSeparator)) { throw new \InvalidArgumentException('The name must not contain ".'.$pathSeparator.'".'); diff -ruN a/Definition/Builder/ArrayNodeDefinition.php b/Definition/Builder/ArrayNodeDefinition.php --- a/Definition/Builder/ArrayNodeDefinition.php 2026-07-15 12:28:18 +++ b/Definition/Builder/ArrayNodeDefinition.php 2026-07-15 12:28:18 @@ -40,7 +40,7 @@ /** * {@inheritdoc} */ - public function __construct(?string $name, NodeParentInterface $parent = null) + public function __construct(?string $name, ?NodeParentInterface $parent = null) { parent::__construct($name, $parent); @@ -132,7 +132,7 @@ * * @return $this */ - public function addDefaultChildrenIfNoneSet(int|string|array $children = null): static + public function addDefaultChildrenIfNoneSet(int|string|array|null $children = null): static { $this->addDefaultChildren = $children; @@ -175,7 +175,7 @@ * * @return $this */ - public function fixXmlConfig(string $singular, string $plural = null): static + public function fixXmlConfig(string $singular, ?string $plural = null): static { $this->normalization()->remap($singular, $plural); diff -ruN a/Definition/Builder/BooleanNodeDefinition.php b/Definition/Builder/BooleanNodeDefinition.php --- a/Definition/Builder/BooleanNodeDefinition.php 2026-07-15 12:28:18 +++ b/Definition/Builder/BooleanNodeDefinition.php 2026-07-15 12:28:18 @@ -24,7 +24,7 @@ /** * {@inheritdoc} */ - public function __construct(?string $name, NodeParentInterface $parent = null) + public function __construct(?string $name, ?NodeParentInterface $parent = null) { parent::__construct($name, $parent); diff -ruN a/Definition/Builder/ExprBuilder.php b/Definition/Builder/ExprBuilder.php --- a/Definition/Builder/ExprBuilder.php 2026-07-15 12:28:18 +++ b/Definition/Builder/ExprBuilder.php 2026-07-15 12:28:18 @@ -35,7 +35,7 @@ * * @return $this */ - public function always(\Closure $then = null): static + public function always(?\Closure $then = null): static { $this->ifPart = function () { return true; }; @@ -53,7 +53,7 @@ * * @return $this */ - public function ifTrue(\Closure $closure = null): static + public function ifTrue(?\Closure $closure = null): static { if (null === $closure) { $closure = function ($v) { return true === $v; }; diff -ruN a/Definition/Builder/NodeBuilder.php b/Definition/Builder/NodeBuilder.php --- a/Definition/Builder/NodeBuilder.php 2026-07-15 12:28:18 +++ b/Definition/Builder/NodeBuilder.php 2026-07-15 12:28:18 @@ -39,7 +39,7 @@ * * @return $this */ - public function setParent(ParentNodeDefinitionInterface $parent = null): static + public function setParent(?ParentNodeDefinitionInterface $parent = null): static { $this->parent = $parent; diff -ruN a/Definition/Builder/NodeDefinition.php b/Definition/Builder/NodeDefinition.php --- a/Definition/Builder/NodeDefinition.php 2026-07-15 12:28:18 +++ b/Definition/Builder/NodeDefinition.php 2026-07-15 12:28:18 @@ -38,7 +38,7 @@ protected $parent; protected $attributes = []; - public function __construct(?string $name, NodeParentInterface $parent = null) + public function __construct(?string $name, ?NodeParentInterface $parent = null) { $this->parent = $parent; $this->name = $name; diff -ruN a/Definition/Builder/NormalizationBuilder.php b/Definition/Builder/NormalizationBuilder.php --- a/Definition/Builder/NormalizationBuilder.php 2026-07-15 12:28:18 +++ b/Definition/Builder/NormalizationBuilder.php 2026-07-15 12:28:18 @@ -35,7 +35,7 @@ * * @return $this */ - public function remap(string $key, string $plural = null): static + public function remap(string $key, ?string $plural = null): static { $this->remappings[] = [$key, null === $plural ? $key.'s' : $plural]; @@ -47,7 +47,7 @@ * * @return ExprBuilder|$this */ - public function before(\Closure $closure = null): ExprBuilder|static + public function before(?\Closure $closure = null): ExprBuilder|static { if (null !== $closure) { $this->before[] = $closure; diff -ruN a/Definition/Builder/TreeBuilder.php b/Definition/Builder/TreeBuilder.php --- a/Definition/Builder/TreeBuilder.php 2026-07-15 12:28:18 +++ b/Definition/Builder/TreeBuilder.php 2026-07-15 12:28:18 @@ -23,7 +23,7 @@ protected $tree; protected $root; - public function __construct(string $name, string $type = 'array', NodeBuilder $builder = null) + public function __construct(string $name, string $type = 'array', ?NodeBuilder $builder = null) { $builder = $builder ?? new NodeBuilder(); $this->root = $builder->node($name, $type)->setParent($this); diff -ruN a/Definition/Builder/ValidationBuilder.php b/Definition/Builder/ValidationBuilder.php --- a/Definition/Builder/ValidationBuilder.php 2026-07-15 12:28:18 +++ b/Definition/Builder/ValidationBuilder.php 2026-07-15 12:28:18 @@ -31,7 +31,7 @@ * * @return ExprBuilder|$this */ - public function rule(\Closure $closure = null): ExprBuilder|static + public function rule(?\Closure $closure = null): ExprBuilder|static { if (null !== $closure) { $this->rules[] = $closure; diff -ruN a/Definition/Dumper/XmlReferenceDumper.php b/Definition/Dumper/XmlReferenceDumper.php --- a/Definition/Dumper/XmlReferenceDumper.php 2026-07-15 12:28:18 +++ b/Definition/Dumper/XmlReferenceDumper.php 2026-07-15 12:28:18 @@ -27,12 +27,12 @@ { private ?string $reference = null; - public function dump(ConfigurationInterface $configuration, string $namespace = null) + public function dump(ConfigurationInterface $configuration, ?string $namespace = null) { return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace); } - public function dumpNode(NodeInterface $node, string $namespace = null) + public function dumpNode(NodeInterface $node, ?string $namespace = null) { $this->reference = ''; $this->writeNode($node, 0, true, $namespace); @@ -42,7 +42,7 @@ return $ref; } - private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, string $namespace = null) + private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, ?string $namespace = null) { $rootName = ($root ? 'config' : $node->getName()); $rootNamespace = ($namespace ?: ($root ? 'http://example.org/schema/dic/'.$node->getName() : null)); diff -ruN a/Definition/Dumper/YamlReferenceDumper.php b/Definition/Dumper/YamlReferenceDumper.php --- a/Definition/Dumper/YamlReferenceDumper.php 2026-07-15 12:28:18 +++ b/Definition/Dumper/YamlReferenceDumper.php 2026-07-15 12:28:18 @@ -71,7 +71,7 @@ return $ref; } - private function writeNode(NodeInterface $node, NodeInterface $parentNode = null, int $depth = 0, bool $prototypedArray = false) + private function writeNode(NodeInterface $node, ?NodeInterface $parentNode = null, int $depth = 0, bool $prototypedArray = false) { $comments = []; $default = ''; diff -ruN a/Definition/EnumNode.php b/Definition/EnumNode.php --- a/Definition/EnumNode.php 2026-07-15 12:28:18 +++ b/Definition/EnumNode.php 2026-07-15 12:28:18 @@ -22,7 +22,7 @@ { private array $values; - public function __construct(?string $name, NodeInterface $parent = null, array $values = [], string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) + public function __construct(?string $name, ?NodeInterface $parent = null, array $values = [], string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) { $values = array_unique($values); if (empty($values)) { diff -ruN a/Definition/NumericNode.php b/Definition/NumericNode.php --- a/Definition/NumericNode.php 2026-07-15 12:28:18 +++ b/Definition/NumericNode.php 2026-07-15 12:28:18 @@ -23,7 +23,7 @@ protected $min; protected $max; - public function __construct(?string $name, NodeInterface $parent = null, int|float $min = null, int|float $max = null, string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) + public function __construct(?string $name, ?NodeInterface $parent = null, int|float|null $min = null, int|float|null $max = null, string $pathSeparator = BaseNode::DEFAULT_PATH_SEPARATOR) { parent::__construct($name, $parent, $pathSeparator); $this->min = $min; diff -ruN a/Definition/Processor.php b/Definition/Processor.php --- a/Definition/Processor.php 2026-07-15 12:28:18 +++ b/Definition/Processor.php 2026-07-15 12:28:18 @@ -67,7 +67,7 @@ * @param string $key The key to normalize * @param string $plural The plural form of the key if it is irregular */ - public static function normalizeConfig(array $config, string $key, string $plural = null): array + public static function normalizeConfig(array $config, string $key, ?string $plural = null): array { if (null === $plural) { $plural = $key.'s'; diff -ruN a/Exception/FileLoaderImportCircularReferenceException.php b/Exception/FileLoaderImportCircularReferenceException.php --- a/Exception/FileLoaderImportCircularReferenceException.php 2026-07-15 12:28:18 +++ b/Exception/FileLoaderImportCircularReferenceException.php 2026-07-15 12:28:18 @@ -18,7 +18,7 @@ */ class FileLoaderImportCircularReferenceException extends LoaderLoadException { - public function __construct(array $resources, int $code = 0, \Throwable $previous = null) + public function __construct(array $resources, int $code = 0, ?\Throwable $previous = null) { $message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]); diff -ruN a/Exception/FileLocatorFileNotFoundException.php b/Exception/FileLocatorFileNotFoundException.php --- a/Exception/FileLocatorFileNotFoundException.php 2026-07-15 12:28:18 +++ b/Exception/FileLocatorFileNotFoundException.php 2026-07-15 12:28:18 @@ -20,7 +20,7 @@ { private array $paths; - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null, array $paths = []) + public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null, array $paths = []) { parent::__construct($message, $code, $previous); diff -ruN a/Exception/LoaderLoadException.php b/Exception/LoaderLoadException.php --- a/Exception/LoaderLoadException.php 2026-07-15 12:28:18 +++ b/Exception/LoaderLoadException.php 2026-07-15 12:28:18 @@ -25,7 +25,7 @@ * @param \Throwable|null $previous A previous exception * @param string|null $type The type of resource */ - public function __construct(string $resource, string $sourceResource = null, int $code = 0, \Throwable $previous = null, string $type = null) + public function __construct(string $resource, ?string $sourceResource = null, int $code = 0, ?\Throwable $previous = null, ?string $type = null) { $message = ''; if ($previous) { diff -ruN a/FileLocator.php b/FileLocator.php --- a/FileLocator.php 2026-07-15 12:28:18 +++ b/FileLocator.php 2026-07-15 12:28:18 @@ -33,7 +33,7 @@ /** * {@inheritdoc} */ - public function locate(string $name, string $currentPath = null, bool $first = true) + public function locate(string $name, ?string $currentPath = null, bool $first = true) { if ('' === $name) { throw new \InvalidArgumentException('An empty file name is not valid to be located.'); diff -ruN a/FileLocatorInterface.php b/FileLocatorInterface.php --- a/FileLocatorInterface.php 2026-07-15 12:28:18 +++ b/FileLocatorInterface.php 2026-07-15 12:28:18 @@ -30,5 +30,5 @@ * @throws \InvalidArgumentException If $name is empty * @throws FileLocatorFileNotFoundException If a file is not found */ - public function locate(string $name, string $currentPath = null, bool $first = true); + public function locate(string $name, ?string $currentPath = null, bool $first = true); } diff -ruN a/Loader/DelegatingLoader.php b/Loader/DelegatingLoader.php --- a/Loader/DelegatingLoader.php 2026-07-15 12:28:18 +++ b/Loader/DelegatingLoader.php 2026-07-15 12:28:18 @@ -31,7 +31,7 @@ /** * {@inheritdoc} */ - public function load(mixed $resource, string $type = null): mixed + public function load(mixed $resource, ?string $type = null): mixed { if (false === $loader = $this->resolver->resolve($resource, $type)) { throw new LoaderLoadException($resource, null, 0, null, $type); @@ -43,7 +43,7 @@ /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports(mixed $resource, ?string $type = null): bool { return false !== $this->resolver->resolve($resource, $type); } diff -ruN a/Loader/FileLoader.php b/Loader/FileLoader.php --- a/Loader/FileLoader.php 2026-07-15 12:28:18 +++ b/Loader/FileLoader.php 2026-07-15 12:28:18 @@ -31,7 +31,7 @@ private ?string $currentDir = null; - public function __construct(FileLocatorInterface $locator, string $env = null) + public function __construct(FileLocatorInterface $locator, ?string $env = null) { $this->locator = $locator; parent::__construct($env); @@ -68,7 +68,7 @@ * @throws FileLoaderImportCircularReferenceException * @throws FileLocatorFileNotFoundException */ - public function import(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null, string|array $exclude = null) + public function import(mixed $resource, ?string $type = null, bool $ignoreErrors = false, ?string $sourceResource = null, string|array|null $exclude = null) { if (\is_string($resource) && \strlen($resource) !== ($i = strcspn($resource, '*?{[')) && !str_contains($resource, "\n")) { $excluded = []; @@ -99,7 +99,7 @@ /** * @internal */ - protected function glob(string $pattern, bool $recursive, array|GlobResource &$resource = null, bool $ignoreErrors = false, bool $forExclusion = false, array $excluded = []) + protected function glob(string $pattern, bool $recursive, array|GlobResource|null &$resource = null, bool $ignoreErrors = false, bool $forExclusion = false, array $excluded = []) { if (\strlen($pattern) === $i = strcspn($pattern, '*?{[')) { $prefix = $pattern; @@ -131,7 +131,7 @@ yield from $resource; } - private function doImport(mixed $resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null) + private function doImport(mixed $resource, ?string $type = null, bool $ignoreErrors = false, ?string $sourceResource = null) { try { $loader = $this->resolve($resource, $type); diff -ruN a/Loader/GlobFileLoader.php b/Loader/GlobFileLoader.php --- a/Loader/GlobFileLoader.php 2026-07-15 12:28:18 +++ b/Loader/GlobFileLoader.php 2026-07-15 12:28:18 @@ -21,7 +21,7 @@ /** * {@inheritdoc} */ - public function load(mixed $resource, string $type = null): mixed + public function load(mixed $resource, ?string $type = null): mixed { return $this->import($resource); } @@ -29,7 +29,7 @@ /** * {@inheritdoc} */ - public function supports(mixed $resource, string $type = null): bool + public function supports(mixed $resource, ?string $type = null): bool { return 'glob' === $type; } diff -ruN a/Loader/Loader.php b/Loader/Loader.php --- a/Loader/Loader.php 2026-07-15 12:28:18 +++ b/Loader/Loader.php 2026-07-15 12:28:18 @@ -23,7 +23,7 @@ protected $resolver; protected $env; - public function __construct(string $env = null) + public function __construct(?string $env = null) { $this->env = $env; } @@ -49,7 +49,7 @@ * * @return mixed */ - public function import(mixed $resource, string $type = null) + public function import(mixed $resource, ?string $type = null) { return $this->resolve($resource, $type)->load($resource, $type); } @@ -59,7 +59,7 @@ * * @throws LoaderLoadException If no loader is found */ - public function resolve(mixed $resource, string $type = null): LoaderInterface + public function resolve(mixed $resource, ?string $type = null): LoaderInterface { if ($this->supports($resource, $type)) { return $this; diff -ruN a/Loader/LoaderInterface.php b/Loader/LoaderInterface.php --- a/Loader/LoaderInterface.php 2026-07-15 12:28:18 +++ b/Loader/LoaderInterface.php 2026-07-15 12:28:18 @@ -25,7 +25,7 @@ * * @throws \Exception If something went wrong */ - public function load(mixed $resource, string $type = null); + public function load(mixed $resource, ?string $type = null); /** * Returns whether this class supports the given resource. @@ -34,7 +34,7 @@ * * @return bool */ - public function supports(mixed $resource, string $type = null); + public function supports(mixed $resource, ?string $type = null); /** * Gets the loader resolver. diff -ruN a/Loader/LoaderResolver.php b/Loader/LoaderResolver.php --- a/Loader/LoaderResolver.php 2026-07-15 12:28:18 +++ b/Loader/LoaderResolver.php 2026-07-15 12:28:18 @@ -39,7 +39,7 @@ /** * {@inheritdoc} */ - public function resolve(mixed $resource, string $type = null): LoaderInterface|false + public function resolve(mixed $resource, ?string $type = null): LoaderInterface|false { foreach ($this->loaders as $loader) { if ($loader->supports($resource, $type)) { diff -ruN a/Loader/LoaderResolverInterface.php b/Loader/LoaderResolverInterface.php --- a/Loader/LoaderResolverInterface.php 2026-07-15 12:28:18 +++ b/Loader/LoaderResolverInterface.php 2026-07-15 12:28:18 @@ -23,5 +23,5 @@ * * @param string|null $type The resource type or null if unknown */ - public function resolve(mixed $resource, string $type = null): LoaderInterface|false; + public function resolve(mixed $resource, ?string $type = null): LoaderInterface|false; } diff -ruN a/Resource/ClassExistenceResource.php b/Resource/ClassExistenceResource.php --- a/Resource/ClassExistenceResource.php 2026-07-15 12:28:18 +++ b/Resource/ClassExistenceResource.php 2026-07-15 12:28:18 @@ -34,7 +34,7 @@ * @param string $resource The fully-qualified class name * @param bool|null $exists Boolean when the existency check has already been done */ - public function __construct(string $resource, bool $exists = null) + public function __construct(string $resource, ?bool $exists = null) { $this->resource = $resource; if (null !== $exists) { @@ -143,7 +143,7 @@ * * @internal */ - public static function throwOnRequiredClass(string $class, \Exception $previous = null) + public static function throwOnRequiredClass(string $class, ?\Exception $previous = null) { // If the passed class is the resource being checked, we shouldn't throw. if (null === $previous && self::$autoloadedClass === $class) { diff -ruN a/Resource/DirectoryResource.php b/Resource/DirectoryResource.php --- a/Resource/DirectoryResource.php 2026-07-15 12:28:18 +++ b/Resource/DirectoryResource.php 2026-07-15 12:28:18 @@ -29,7 +29,7 @@ * * @throws \InvalidArgumentException */ - public function __construct(string $resource, string $pattern = null) + public function __construct(string $resource, ?string $pattern = null) { $resolvedResource = realpath($resource) ?: (file_exists($resource) ? $resource : false); $this->pattern = $pattern; diff -ruN a/ResourceCheckerConfigCache.php b/ResourceCheckerConfigCache.php --- a/ResourceCheckerConfigCache.php 2026-07-15 12:28:18 +++ b/ResourceCheckerConfigCache.php 2026-07-15 12:28:18 @@ -110,7 +110,7 @@ * * @throws \RuntimeException When cache file can't be written */ - public function write(string $content, array $metadata = null) + public function write(string $content, ?array $metadata = null) { $mode = 0666; $umask = umask(); diff -ruN a/Util/XmlUtils.php b/Util/XmlUtils.php --- a/Util/XmlUtils.php 2026-07-15 12:28:18 +++ b/Util/XmlUtils.php 2026-07-15 12:28:18 @@ -42,7 +42,7 @@ * @throws InvalidXmlException When parsing of XML with schema or callable produces any errors unrelated to the XML parsing itself * @throws \RuntimeException When DOM extension is missing */ - public static function parse(string $content, string|callable $schemaOrCallable = null): \DOMDocument + public static function parse(string $content, string|callable|null $schemaOrCallable = null): \DOMDocument { if (!\extension_loaded('dom')) { throw new \LogicException('Extension DOM is required.'); @@ -112,7 +112,7 @@ * @throws XmlParsingException When XML parsing returns any errors * @throws \RuntimeException When DOM extension is missing */ - public static function loadFile(string $file, string|callable $schemaOrCallable = null): \DOMDocument + public static function loadFile(string $file, string|callable|null $schemaOrCallable = null): \DOMDocument { if (!is_file($file)) { throw new \InvalidArgumentException(sprintf('Resource "%s" is not a file.', $file));