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

@@ -44,7 +44,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
private mixed $sourceContextProvider;
private bool $webMode;
public function __construct(Stopwatch $stopwatch = null, string|FileLinkFormatter $fileLinkFormat = null, string $charset = null, RequestStack $requestStack = null, DataDumperInterface|Connection $dumper = null, bool $webMode = null)
public function __construct(?Stopwatch $stopwatch = null, string|FileLinkFormatter|null $fileLinkFormat = null, ?string $charset = null, ?RequestStack $requestStack = null, DataDumperInterface|Connection|null $dumper = null, ?bool $webMode = null)
{
$fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
$this->stopwatch = $stopwatch;
@@ -100,7 +100,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
return null;
}
public function collect(Request $request, Response $response, \Throwable $exception = null): void
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
if (!$this->dataCount) {
$this->data = [];
@@ -143,10 +143,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
$this->clonesIndex = 0;
}
/**
* @internal
*/
public function __sleep(): array
public function __serialize(): array
{
if (!$this->dataCount) {
$this->data = [];
@@ -161,16 +158,12 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
$this->dataCount = 0;
$this->isCollected = true;
return parent::__sleep();
return ['data' => $this->data];
}
/**
* @internal
*/
public function __wakeup(): void
public function __unserialize(array $data): void
{
parent::__wakeup();
$this->data = array_pop($data) ?? [];
$charset = array_pop($this->data);
$fileLinkFormat = array_pop($this->data);
$this->dataCount = \count($this->data);
@@ -180,7 +173,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
}
}
self::__construct($this->stopwatch, \is_string($fileLinkFormat) || $fileLinkFormat instanceof FileLinkFormatter ? $fileLinkFormat : null, \is_string($charset) ? $charset : null);
self::__construct($this->stopwatch ?? null, \is_string($fileLinkFormat) || $fileLinkFormat instanceof FileLinkFormatter ? $fileLinkFormat : null, \is_string($charset) ? $charset : null);
}
public function getDumpsCount(): int
@@ -196,7 +189,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
$dumper = new HtmlDumper($data, $this->charset);
$dumper->setDisplayOptions(['fileLinkFormat' => $this->fileLinkFormat]);
} else {
throw new \InvalidArgumentException(sprintf('Invalid dump format: "%s".', $format));
throw new \InvalidArgumentException(\sprintf('Invalid dump format: "%s".', $format));
}
$dumps = [];
@@ -263,9 +256,9 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
$f = strip_tags($this->style('', $file));
$name = strip_tags($this->style('', $name));
if ($fmt && $link = \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : $fmt->format($file, $line)) {
$name = sprintf('<a href="%s" title="%s">'.$s.'</a>', strip_tags($this->style('', $link)), $f, $name);
$name = \sprintf('<a href="%s" title="%s">'.$s.'</a>', strip_tags($this->style('', $link)), $f, $name);
} else {
$name = sprintf('<abbr title="%s">'.$s.'</abbr>', $f, $name);
$name = \sprintf('<abbr title="%s">'.$s.'</abbr>', $f, $name);
}
} else {
$name = $this->style('meta', $name);