mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +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:
@@ -25,7 +25,7 @@ trait DecorateTrait
|
||||
*
|
||||
* @throws InvalidArgumentException in case the decorated service id and the new decorated service id are equals
|
||||
*/
|
||||
final public function decorate(?string $id, string $renamedId = null, int $priority = 0, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): static
|
||||
final public function decorate(?string $id, ?string $renamedId = null, int $priority = 0, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): static
|
||||
{
|
||||
$this->definition->setDecoratedService($id, $renamedId, $priority, $invalidBehavior);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ trait FactoryTrait
|
||||
if (\is_string($factory) && 1 === substr_count($factory, ':')) {
|
||||
$factoryParts = explode(':', $factory);
|
||||
|
||||
throw new InvalidArgumentException(sprintf('Invalid factory "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'%s\'), \'%s\']" instead.', $factory, $factoryParts[0], $factoryParts[1]));
|
||||
throw new InvalidArgumentException(\sprintf('Invalid factory "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'%s\'), \'%s\']" instead.', $factory, $factoryParts[0], $factoryParts[1]));
|
||||
}
|
||||
|
||||
if ($factory instanceof Expression) {
|
||||
|
||||
@@ -35,7 +35,7 @@ trait FromCallableTrait
|
||||
'calls' => 'getMethodCalls',
|
||||
] as $key => $method) {
|
||||
if ($this->definition->$method()) {
|
||||
throw new InvalidArgumentException(sprintf('The configuration key "%s" is unsupported when using "fromCallable()".', $key));
|
||||
throw new InvalidArgumentException(\sprintf('The configuration key "%s" is unsupported when using "fromCallable()".', $key));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ trait FromCallableTrait
|
||||
if (\is_string($callable) && 1 === substr_count($callable, ':')) {
|
||||
$parts = explode(':', $callable);
|
||||
|
||||
throw new InvalidArgumentException(sprintf('Invalid callable "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'%s\'), \'%s\']" instead.', $callable, $parts[0], $parts[1]));
|
||||
throw new InvalidArgumentException(\sprintf('Invalid callable "%s": the "service:method" notation is not available when using PHP-based DI configuration. Use "[service(\'%s\'), \'%s\']" instead.', $callable, $parts[0], $parts[1]));
|
||||
}
|
||||
|
||||
if ($callable instanceof Expression) {
|
||||
|
||||
@@ -26,7 +26,7 @@ trait ParentTrait
|
||||
final public function parent(string $parent): static
|
||||
{
|
||||
if (!$this->allowParent) {
|
||||
throw new InvalidArgumentException(sprintf('A parent cannot be defined when either "_instanceof" or "_defaults" are also defined for service prototype "%s".', $this->id));
|
||||
throw new InvalidArgumentException(\sprintf('A parent cannot be defined when either "_instanceof" or "_defaults" are also defined for service prototype "%s".', $this->id));
|
||||
}
|
||||
|
||||
if ($this->definition instanceof ChildDefinition) {
|
||||
|
||||
@@ -23,7 +23,7 @@ trait TagTrait
|
||||
final public function tag(string $name, array $attributes = []): static
|
||||
{
|
||||
if ('' === $name) {
|
||||
throw new InvalidArgumentException(sprintf('The tag name for service "%s" must be a non-empty string.', $this->id));
|
||||
throw new InvalidArgumentException(\sprintf('The tag name for service "%s" must be a non-empty string.', $this->id));
|
||||
}
|
||||
|
||||
$this->validateAttributes($name, $attributes);
|
||||
@@ -40,7 +40,7 @@ trait TagTrait
|
||||
$this->validateAttributes($tag, $value, [...$path, $name]);
|
||||
} elseif (!\is_scalar($value ?? '')) {
|
||||
$name = implode('.', [...$path, $name]);
|
||||
throw new InvalidArgumentException(sprintf('A tag attribute must be of a scalar-type or an array of scalar-types for service "%s", tag "%s", attribute "%s".', $this->id, $tag, $name));
|
||||
throw new InvalidArgumentException(\sprintf('A tag attribute must be of a scalar-type or an array of scalar-types for service "%s", tag "%s", attribute "%s".', $this->id, $tag, $name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user