N°8834 - Add compatibility with PHP 8.4 (#819)

* N°8834 - Add compatibility with PHP 8.4

* Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
Lenaick
2026-02-26 10:36:32 +01:00
committed by GitHub
parent d4821b7edc
commit fc967c06ce
961 changed files with 12298 additions and 7130 deletions

View File

@@ -34,7 +34,7 @@ class XmlReferenceDumper
/**
* @return string
*/
public function dump(ConfigurationInterface $configuration, string $namespace = null)
public function dump(ConfigurationInterface $configuration, ?string $namespace = null)
{
return $this->dumpNode($configuration->getConfigTreeBuilder()->buildTree(), $namespace);
}
@@ -42,7 +42,7 @@ class XmlReferenceDumper
/**
* @return string
*/
public function dumpNode(NodeInterface $node, string $namespace = null)
public function dumpNode(NodeInterface $node, ?string $namespace = null)
{
$this->reference = '';
$this->writeNode($node, 0, true, $namespace);
@@ -52,7 +52,7 @@ class XmlReferenceDumper
return $ref;
}
private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, string $namespace = null): void
private function writeNode(NodeInterface $node, int $depth = 0, bool $root = false, ?string $namespace = null): void
{
$rootName = ($root ? 'config' : $node->getName());
$rootNamespace = ($namespace ?: ($root ? 'http://example.org/schema/dic/'.$node->getName() : null));
@@ -151,7 +151,7 @@ class XmlReferenceDumper
if ($child instanceof BaseNode && $child->isDeprecated()) {
$deprecation = $child->getDeprecation($child->getName(), $node->getPath());
$comments[] = sprintf('Deprecated (%s)', ($deprecation['package'] || $deprecation['version'] ? "Since {$deprecation['package']} {$deprecation['version']}: " : '').$deprecation['message']);
$comments[] = \sprintf('Deprecated (%s)', ($deprecation['package'] || $deprecation['version'] ? "Since {$deprecation['package']} {$deprecation['version']}: " : '').$deprecation['message']);
}
if ($child instanceof EnumNode) {
@@ -205,7 +205,7 @@ class XmlReferenceDumper
$rootOpenTag = '<'.$rootName;
if (1 >= ($attributesCount = \count($rootAttributes))) {
if (1 === $attributesCount) {
$rootOpenTag .= sprintf(' %s="%s"', current(array_keys($rootAttributes)), $this->writeValue(current($rootAttributes)));
$rootOpenTag .= \sprintf(' %s="%s"', current(array_keys($rootAttributes)), $this->writeValue(current($rootAttributes)));
}
$rootOpenTag .= $rootIsEmptyTag ? ' />' : '>';
@@ -221,7 +221,7 @@ class XmlReferenceDumper
$i = 1;
foreach ($rootAttributes as $attrName => $attrValue) {
$attr = sprintf('%s="%s"', $attrName, $this->writeValue($attrValue));
$attr = \sprintf('%s="%s"', $attrName, $this->writeValue($attrValue));
$this->writeLine($attr, $depth + 4);
@@ -258,7 +258,7 @@ class XmlReferenceDumper
$indent = \strlen($text) + $indent;
$format = '%'.$indent.'s';
$this->reference .= sprintf($format, $text).\PHP_EOL;
$this->reference .= \sprintf($format, $text).\PHP_EOL;
}
/**