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 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 34

  1. Stefan Bürk uploaded patch set 1 07/02/24, 18:16

  2. core-ci voted on patch set 1 V +1 07/02/24, 18:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60865

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 07/02/24, 18:31

  4. Stefan Bürk merged patch set 2 07/02/24, 18:32