mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-27 04:28:44 +02:00
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:
@@ -60,17 +60,19 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
|
||||
return 'reflection.'.$this->className;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __sleep(): array
|
||||
public function __serialize(): array
|
||||
{
|
||||
if (!isset($this->hash)) {
|
||||
$this->hash = $this->computeHash();
|
||||
$this->loadFiles($this->classReflector);
|
||||
}
|
||||
|
||||
return ['files', 'className', 'hash'];
|
||||
return [
|
||||
'files' => $this->files,
|
||||
'className' => $this->className,
|
||||
'excludedVendors' => $this->excludedVendors,
|
||||
'hash' => $this->hash,
|
||||
];
|
||||
}
|
||||
|
||||
private function loadFiles(\ReflectionClass $class): void
|
||||
@@ -123,7 +125,7 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
|
||||
yield print_r($attributes, true);
|
||||
$attributes = [];
|
||||
|
||||
yield $class->getDocComment();
|
||||
yield $class->getDocComment() ?: '';
|
||||
yield (int) $class->isFinal();
|
||||
yield (int) $class->isAbstract();
|
||||
|
||||
@@ -135,6 +137,14 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
|
||||
yield print_r($class->getConstants(), true);
|
||||
}
|
||||
|
||||
foreach ($class->getReflectionConstants() as $constant) {
|
||||
foreach ($constant->getAttributes() as $a) {
|
||||
$attributes[] = [$a->getName(), (string) $a];
|
||||
}
|
||||
yield $constant->name.print_r($attributes, true);
|
||||
$attributes = [];
|
||||
}
|
||||
|
||||
if (!$class->isInterface()) {
|
||||
$defaults = $class->getDefaultProperties();
|
||||
|
||||
@@ -145,7 +155,7 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
|
||||
yield print_r($attributes, true);
|
||||
$attributes = [];
|
||||
|
||||
yield $p->getDocComment();
|
||||
yield $p->getDocComment() ?: '';
|
||||
yield $p->isDefault() ? '<default>' : '';
|
||||
yield $p->isPublic() ? 'public' : 'protected';
|
||||
yield $p->isStatic() ? 'static' : '';
|
||||
|
||||
Reference in New Issue
Block a user