Review 12.4 Merged

85089[TASK] Ensure coding-style for nullable type declarations

Stefan Bürk CR +2 V +2 Easy +4 −0 updated 07/02/24, 18:32

Commit message

This change modifies the `php-cs-fixer` ruleset and
activate two rules related to nullable types.

Following options are added:

  'nullable_type_declaration' => [
    'syntax' => 'question_mark',
  ],
  'nullable_type_declaration_for_default_null_value' => true,

`nullable_type_declaration` ensures to use `?<type>` declaration
instead of union type `<type>|null` as a convention for properties,
method and return types. For already union types the nullable is
added as additional null union type `ObjectOne|ObjectInterface|null`.

`nullable_type_declaration_for_default_null_value` ensures
to use nullable type declarations to mitigate implicitly
nullable method arguments [1] which has been already fixed
with a series of dedicated changes.

Used command(s):

  Build/Scripts/runTests.sh -s cgl

[1] https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 1