mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +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:
@@ -28,14 +28,14 @@ class AutowireLocator extends Autowire
|
||||
/**
|
||||
* @see ServiceSubscriberInterface::getSubscribedServices()
|
||||
*
|
||||
* @param string|array<string|SubscribedService> $services An explicit list of services or a tag name
|
||||
* @param string|string[] $exclude A service or a list of services to exclude
|
||||
* @param string|array<string|Autowire|SubscribedService> $services An explicit list of services or a tag name
|
||||
* @param string|string[] $exclude A service or a list of services to exclude
|
||||
*/
|
||||
public function __construct(
|
||||
string|array $services,
|
||||
string $indexAttribute = null,
|
||||
string $defaultIndexMethod = null,
|
||||
string $defaultPriorityMethod = null,
|
||||
?string $indexAttribute = null,
|
||||
?string $defaultIndexMethod = null,
|
||||
?string $defaultPriorityMethod = null,
|
||||
string|array $exclude = [],
|
||||
bool $excludeSelf = true,
|
||||
) {
|
||||
@@ -58,11 +58,11 @@ class AutowireLocator extends Autowire
|
||||
if ($type instanceof SubscribedService) {
|
||||
$key = $type->key ?? $key;
|
||||
$attributes = $type->attributes;
|
||||
$type = ($type->nullable ? '?' : '').($type->type ?? throw new InvalidArgumentException(sprintf('When "%s" is used, a type must be set.', SubscribedService::class)));
|
||||
$type = ($type->nullable ? '?' : '').($type->type ?? throw new InvalidArgumentException(\sprintf('When "%s" is used, a type must be set.', SubscribedService::class)));
|
||||
}
|
||||
|
||||
if (!\is_string($type) || !preg_match('/(?(DEFINE)(?<cn>[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+))(?(DEFINE)(?<fqcn>(?&cn)(?:\\\\(?&cn))*+))^\??(?&fqcn)(?:(?:\|(?&fqcn))*+|(?:&(?&fqcn))*+)$/', $type)) {
|
||||
throw new InvalidArgumentException(sprintf('"%s" is not a PHP type for key "%s".', \is_string($type) ? $type : get_debug_type($type), $key));
|
||||
throw new InvalidArgumentException(\sprintf('"%s" is not a PHP type for key "%s".', \is_string($type) ? $type : get_debug_type($type), $key));
|
||||
}
|
||||
$optionalBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
|
||||
if ('?' === $type[0]) {
|
||||
|
||||
Reference in New Issue
Block a user