Skip to content

Commit 9844c27

Browse files
authored
fix php8.4 deprecation (#13)
* fix php8.4 deprecation * fix php8.4 deprecation and ensure Traits\BinaryFlags::getAllFlags() returns an array with integer keys
1 parent 7467fda commit 9844c27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Traits/BinaryFlags.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function getAllFlags(): array
4848
if ($constants) {
4949
foreach ($constants as $constant => $flag) {
5050
if (is_numeric($flag)) {
51-
$flags[$flag] = implode('', array_map('ucfirst', explode('_', strtolower($constant))));
51+
$flags[(int) $flag] = implode('', array_map('ucfirst', explode('_', strtolower($constant))));
5252
}
5353
}
5454
}
@@ -78,7 +78,7 @@ function ($flag, $carry) {
7878
* @param bool $asArray
7979
* @return string|array<int, string>
8080
*/
81-
public function getFlagNames(int $mask = null, bool $asArray = false): string|array
81+
public function getFlagNames(?int $mask = null, bool $asArray = false): string|array
8282
{
8383
$mask = $mask ?? $this->mask;
8484
$names = [];

0 commit comments

Comments
 (0)