32-bit Unit Test Warnings (#3232)

* 32-bit Unit Test Warnings

Some new problems exposed with latest Php8.1.

* Update BitWise.php
This commit is contained in:
oleibman
2022-12-09 08:47:54 -08:00
committed by GitHub
parent 836792c325
commit 73ff527121
3 changed files with 5 additions and 5 deletions
@@ -34,7 +34,7 @@ abstract class DatabaseAbstract
*/
protected static function fieldExtract(array $database, $field): ?int
{
$field = strtoupper(Functions::flattenSingleValue($field ?? ''));
$field = strtoupper(Functions::flattenSingleValue($field) ?? '');
if ($field === '') {
return null;
}
@@ -17,10 +17,12 @@ class BitWise
* Split a number into upper and lower portions for full 32-bit support.
*
* @param float|int $number
*
* @return int[]
*/
private static function splitNumber($number): array
{
return [floor($number / self::SPLIT_DIVISOR), fmod($number, self::SPLIT_DIVISOR)];
return [(int) floor($number / self::SPLIT_DIVISOR), (int) fmod($number, self::SPLIT_DIVISOR)];
}
/**
@@ -55,7 +57,6 @@ class BitWise
$split1 = self::splitNumber($number1);
$split2 = self::splitNumber($number2);
// Scrutinizer does not like bitwise, and doesn't let you override its warning
return self::SPLIT_DIVISOR * ($split1[0] & $split2[0]) + ($split1[1] & $split2[1]);
}
@@ -92,7 +93,6 @@ class BitWise
$split1 = self::splitNumber($number1);
$split2 = self::splitNumber($number2);
// Scrutinizer does not like bitwise, and doesn't let you override its warning
return self::SPLIT_DIVISOR * ($split1[0] | $split2[0]) + ($split1[1] | $split2[1]);
}
+1 -1
View File
@@ -23,7 +23,7 @@ class Validations
// throw new Exception('Reference is not for this worksheet');
// }
return empty($worksheet) ? strtoupper($address) : $worksheet . '!' . strtoupper($address);
return empty($worksheet) ? strtoupper("$address") : $worksheet . '!' . strtoupper("$address");
}
if (is_array($cellAddress)) {