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

Fix PHP 8.4 deprecation for type declaration for default null value

This commit is contained in:
Eric Junker 2024-10-29 10:15:16 -05:00
parent 37326d5e26
commit 558d859ab4
2 changed files with 2 additions and 1 deletions

View file

@ -85,6 +85,7 @@ $rules = [
'no_whitespace_in_blank_line' => true, 'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true, 'normalize_index_brace' => true,
'not_operator_with_successor_space' => true, 'not_operator_with_successor_space' => true,
'nullable_type_declaration_for_default_null_value' => true,
'object_operator_without_whitespace' => true, 'object_operator_without_whitespace' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'], 'ordered_imports' => ['sort_algorithm' => 'alpha'],
'phpdoc_indent' => true, '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. * Generate a string format of the enum options using the provided callback and glue.
* @param Closure(string $name, mixed $value): string $callback * @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; $firstCase = static::cases()[0] ?? null;