Review main Merged

75599[TASK] Avoid unsolveable phpstan error for return-type mismatch

Stefan Bürk CR +2 V +2 Easy +1 −0 updated 09/02/22, 14:48

Commit message

PHP8.1 introduced native return types to native methods
and interfaces, which crashes if they are not compatible.
As a workaround the introduced `#[\ReturnTypeWillChange]`
attribute can be used to mitigate this, which has been
used to mitigate quite some issues with it.

PHPStan has released a new version which fixes a bunch
of bugs, which detects more issues in core. These will
be addressed with the dedicated PHPStan raise patch #98246.
However, one issue cannot be solved or added to the baseline
and must be fixed beforehand. The reason is, that phpstan
also evaluates the PHPDoc return type.

This change uses the `#[\ReturnTypeWillChange]` attribute
to silence this as a backportable intermediate solution.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 56

  1. Stefan Bürk uploaded patch set 1 09/02/22, 12:58

  2. Stefan Bürk updated the commit message in patch set 2 09/02/22, 13:00

  3. core-ci voted on patch set 2 V +1 09/02/22, 13:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30597

  4. Oliver Klee voted on patch set 2 V +1 CR +1 09/02/22, 13:27

  5. Christian Kuhn voted on patch set 2 V +2 CR +2 09/02/22, 14:46

  6. Christian Kuhn merged patch set 3 09/02/22, 14:48