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

@@ -41,7 +41,7 @@ class LoggingTranslatorPass implements CompilerPassInterface
$class = $container->getParameterBag()->resolveValue($definition->getClass());
if (!$r = $container->getReflectionClass($class)) {
throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $translatorAlias));
throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $translatorAlias));
}
if ($r->isSubclassOf(TranslatorInterface::class) && $r->isSubclassOf(TranslatorBagInterface::class)) {
$container->getDefinition('translator.logging')->setDecoratedService('translator');

View File

@@ -45,7 +45,7 @@ class ProfilerPass implements CompilerPassInterface
if (isset($attributes[0]['template']) || is_subclass_of($collectorClass, TemplateAwareDataCollectorInterface::class)) {
$idForTemplate = $attributes[0]['id'] ?? $collectorClass;
if (!$idForTemplate) {
throw new InvalidArgumentException(sprintf('Data collector service "%s" must have an id attribute in order to specify a template.', $id));
throw new InvalidArgumentException(\sprintf('Data collector service "%s" must have an id attribute in order to specify a template.', $id));
}
$template = [$idForTemplate, $attributes[0]['template'] ?? $collectorClass::getTemplate()];
}

View File

@@ -34,7 +34,10 @@ class TestServiceContainerWeakRefPass implements CompilerPassInterface
$definitions = $container->getDefinitions();
foreach ($definitions as $id => $definition) {
if ($id && '.' !== $id[0] && (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag('container.private')) && !$definition->hasErrors() && !$definition->isAbstract()) {
if ($inner = $definition->getTag('container.decorator')[0]['inner'] ?? null) {
$privateServices[$inner] = new Reference($inner, ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE);
}
if ($id && '.' !== $id[0] && ($definition->isPrivate() || $definition->hasTag('container.private')) && !$definition->hasErrors() && !$definition->isAbstract()) {
$privateServices[$id] = new Reference($id, ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE);
}
}

View File

@@ -132,9 +132,9 @@ class UnusedTagsPass implements CompilerPassInterface
}
$services = array_keys($container->findTaggedServiceIds($tag));
$message = sprintf('Tag "%s" was defined on service(s) "%s", but was never used.', $tag, implode('", "', $services));
$message = \sprintf('Tag "%s" was defined on service(s) "%s", but was never used.', $tag, implode('", "', $services));
if ($candidates) {
$message .= sprintf(' Did you mean "%s"?', implode('", "', $candidates));
$message .= \sprintf(' Did you mean "%s"?', implode('", "', $candidates));
}
$container->log($this, $message);

View File

@@ -45,7 +45,7 @@ class WorkflowGuardListenerPass implements CompilerPassInterface
foreach ($servicesNeeded as $service) {
if (!$container->has($service)) {
throw new LogicException(sprintf('The "%s" service is needed to be able to use the workflow guard listener.', $service));
throw new LogicException(\sprintf('The "%s" service is needed to be able to use the workflow guard listener.', $service));
}
}
}