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:
@@ -26,7 +26,7 @@ final class EnumRequirement implements \Stringable
|
||||
{
|
||||
if (\is_string($cases)) {
|
||||
if (!is_subclass_of($cases, \BackedEnum::class, true)) {
|
||||
throw new InvalidArgumentException(sprintf('"%s" is not a "BackedEnum" class.', $cases));
|
||||
throw new InvalidArgumentException(\sprintf('"%s" is not a "BackedEnum" class.', $cases));
|
||||
}
|
||||
|
||||
$cases = $cases::cases();
|
||||
@@ -35,13 +35,13 @@ final class EnumRequirement implements \Stringable
|
||||
|
||||
foreach ($cases as $case) {
|
||||
if (!$case instanceof \BackedEnum) {
|
||||
throw new InvalidArgumentException(sprintf('Case must be a "BackedEnum" instance, "%s" given.', get_debug_type($case)));
|
||||
throw new InvalidArgumentException(\sprintf('Case must be a "BackedEnum" instance, "%s" given.', get_debug_type($case)));
|
||||
}
|
||||
|
||||
$class ??= $case::class;
|
||||
|
||||
if (!$case instanceof $class) {
|
||||
throw new InvalidArgumentException(sprintf('"%s::%s" is not a case of "%s".', get_debug_type($case), $case->name, $class));
|
||||
throw new InvalidArgumentException(\sprintf('"%s::%s" is not a case of "%s".', get_debug_type($case), $case->name, $class));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ enum Requirement
|
||||
public const POSITIVE_INT = '[1-9][0-9]*';
|
||||
public const UID_BASE32 = '[0-9A-HJKMNP-TV-Z]{26}';
|
||||
public const UID_BASE58 = '[1-9A-HJ-NP-Za-km-z]{22}';
|
||||
public const UID_RFC4122 = '[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}';
|
||||
public const UID_RFC4122 = '[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}'; // RFC 9562 obsoleted RFC 4122 but the format is the same
|
||||
public const ULID = '[0-7][0-9A-HJKMNP-TV-Z]{25}';
|
||||
public const UUID = '[0-9a-f]{8}-[0-9a-f]{4}-[13-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}';
|
||||
public const UUID_V1 = '[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}';
|
||||
|
||||
Reference in New Issue
Block a user