1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 03:54:03 +00:00

Fix PHP 8.4 deprecation for type declaration for default null value (#25)

This commit is contained in:
Eric Junker 2024-10-29 10:38:32 -05:00 committed by GitHub
parent 37326d5e26
commit 27d0405b98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -85,6 +85,7 @@ $rules = [
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_indent' => true,

View file

@ -23,7 +23,7 @@ trait Options
* Generate a string format of the enum options using the provided callback and glue.
* @param Closure(string $name, mixed $value): string $callback
*/
public static function stringOptions(Closure $callback = null, string $glue = '\n'): string
public static function stringOptions(?Closure $callback = null, string $glue = '\n'): string
{
$firstCase = static::cases()[0] ?? null;