Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+10 -10
View File
@@ -75,8 +75,8 @@ class MaskBuilder extends AbstractMaskBuilder
public function getPattern()
{
$pattern = self::ALL_OFF;
$length = strlen($pattern);
$bitmask = str_pad(decbin($this->mask), $length, '0', STR_PAD_LEFT);
$length = \strlen($pattern);
$bitmask = str_pad(decbin($this->mask), $length, '0', \STR_PAD_LEFT);
for ($i = $length - 1; $i >= 0; --$i) {
if ('1' === $bitmask[$i]) {
@@ -103,21 +103,21 @@ class MaskBuilder extends AbstractMaskBuilder
*/
public static function getCode($mask)
{
if (!is_int($mask)) {
if (!\is_int($mask)) {
throw new \InvalidArgumentException('$mask must be an integer.');
}
$reflection = new \ReflectionClass(get_called_class());
$reflection = new \ReflectionClass(static::class);
foreach ($reflection->getConstants() as $name => $cMask) {
if (0 !== strpos($name, 'MASK_') || $mask !== $cMask) {
continue;
}
if (!defined($cName = 'static::CODE_'.substr($name, 5))) {
if (!\defined($cName = 'static::CODE_'.substr($name, 5))) {
throw new \RuntimeException('There was no code defined for this mask.');
}
return constant($cName);
return \constant($cName);
}
throw new \InvalidArgumentException(sprintf('The mask "%d" is not supported.', $mask));
@@ -134,15 +134,15 @@ class MaskBuilder extends AbstractMaskBuilder
*/
public function resolveMask($code)
{
if (is_string($code)) {
if (!defined($name = sprintf('static::MASK_%s', strtoupper($code)))) {
if (\is_string($code)) {
if (!\defined($name = sprintf('static::MASK_%s', strtoupper($code)))) {
throw new \InvalidArgumentException(sprintf('The code "%s" is not supported', $code));
}
return constant($name);
return \constant($name);
}
if (!is_int($code)) {
if (!\is_int($code)) {
throw new \InvalidArgumentException('$code must be an integer.');
}