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

@@ -63,11 +63,11 @@ class ClassBuilder
}
unset($path[$key]);
}
$require .= sprintf('require_once __DIR__.\DIRECTORY_SEPARATOR.\'%s\';', implode('\'.\DIRECTORY_SEPARATOR.\'', $path))."\n";
$require .= \sprintf('require_once __DIR__.\DIRECTORY_SEPARATOR.\'%s\';', implode('\'.\DIRECTORY_SEPARATOR.\'', $path))."\n";
}
$use = $require ? "\n" : '';
foreach (array_keys($this->use) as $statement) {
$use .= sprintf('use %s;', $statement)."\n";
$use .= \sprintf('use %s;', $statement)."\n";
}
$implements = [] === $this->implements ? '' : 'implements '.implode(', ', $this->implements);
@@ -119,15 +119,15 @@ BODY
$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) {
$property->setType($classType);
}
$this->properties[] = $property;
$defaultValue = null !== $defaultValue ? sprintf(' = %s', $defaultValue) : '';
$property->setContent(sprintf('private $%s%s;', $property->getName(), $defaultValue));
$defaultValue = null !== $defaultValue ? \sprintf(' = %s', $defaultValue) : '';
$property->setContent(\sprintf('private $%s%s;', $property->getName(), $defaultValue));
return $property;
}