Review main Merged

82932[TASK] Update `phpstan/phpstan` version

Stefan Bürk CR +2 V +2 Easy +8 −14 updated 02/13/24, 07:25

Commit message

A new PHPStan version has been released,
which is pulled in automatically in the
composerInstallMax nightly test.

The higher version allows to remove a
ignore pattern from the baseline and
a superfluous key unset is detected.

This change raises the PHPStan version,
removes the superfluous `unset()` and
regenerates the baseline to remove the
invalid ignore pattern.

Used command(s):

> Build/Scripts/runTests.sh -s composer \
    -- require --dev "phpstan/phpstan":"^1.10.58"
> Build/Scripts/runTests.sh \
    -s phpstanGenerateBaseline

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • Anja Leichsenring +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 2026

Show 1 earlier messages
  1. Stefan Bürk uploaded patch set 1 02/13/24, 05:39

  1. core-ci voted on patch set 1 V +1 02/13/24, 05:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53109

  2. Stefan Bürk uploaded patch set 2 V +1 02/13/24, 05:46

  3. core-ci voted on patch set 2 V +1 02/13/24, 05:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53111

  4. Anja Leichsenring updated the commit message in patch set 3 V +1 02/13/24, 06:06

  5. Anja Leichsenring voted on patch set 3 CR +1 V +1 02/13/24, 06:06

  6. core-ci voted on patch set 3 V +1 02/13/24, 06:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53114

  7. Benjamin Franzke commented on patch set 3 CR -1 02/13/24, 06:12

    FormEditorController.php:314

    Please explain why this `unset` was unneeded. The phpstan error rather sounds like a phpstan bug: > Cannot unset offset 'sorting' on array<int, array{key: (int|string), cssKey: string|null, label: mixed, sorting: mixed, iconIdentifier: mixed}|string>. Which is because it thinks `$formElementsByGroup[$groupName]` is either an `array` or a `string`
  8. Benjamin Franzke commented on patch set 3 02/13/24, 06:14

    FormEditorController.php:314 Reply

    Reason for this misunderstanding is a false docblock in line 280: ``` /** @var array<string, array<string, string>> $formElementsByGroup */ ``` While line 296 the inserts another structure. The correct fix is to drop the 280 line or to make that a correct @var statement.
  9. Stefan Bürk commented on patch set 3 02/13/24, 06:29

    FormEditorController.php:314 Reply

    Either the docblock in L280 is wrong or the assignment in 296 - but I'd say it's possible to have multiple elements per group so that 296 should be correct and the correct docblock should be ``` /** @var array<string, list<array<string, string>>> */ ``` The `unset()` is not needed and wrong, because `$formElementsByGroup[$groupName]` is an array of elements - and has no `sorting` key set directly. The structure build in the first foreach loop is ``` $formElementsByGroup = [ 'group-name-1' => [ [ 'key' => '', 'cssKey' => '', 'label' => '', 'sorting' => '', 'iconIdentifier' => '', ], [ 'key' => '', 'cssKey' => '', 'label' => '', 'sorting' => '', 'iconIdentifier' => '', ], ], 'group-name-2' => [ [ 'key' => '', 'cssKey' => '', 'label' => '', 'sorting' => '', 'iconIdentifier' => '', ], [ 'key' => '', 'cssKey' => '', 'label' => '', 'sorting' => '', 'iconIdentifier' => '', ], ], ] ``` and `unset($formElementsByGroup[$groupName]['sorting')` will never ever remove anything as tha array is index based and not associative - not having an `sorting` key. What do you think ?
  10. Benjamin Franzke commented on patch set 3 02/13/24, 06:29

    also 13.0
  11. Stefan Bürk uploaded patch set 4 CR +1 V +1 02/13/24, 06:33

  12. Stefan Bürk updated the commit message in patch set 5 02/13/24, 06:34

  13. Stefan Bürk commented on patch set 5 02/13/24, 06:39

    Reply

    Done
  14. core-ci voted on patch set 5 V +1 02/13/24, 06:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53118

  15. core-ci voted on patch set 4 V +1 02/13/24, 06:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53116

  16. Thomas Hohn voted on patch set 5 CR +1 V +1 02/13/24, 06:55

  17. Benjamin Franzke commented on patch set 5 02/13/24, 06:57

    FormEditorController.php:280

    As `sorting` will be an integer (coming from yaml parser) this should probably be `mixed`. Or maybe better: ``` array{key: string, cssKey: string, label: string, sorting: int, iconIdentifier: string} ```

    FormEditorController.php:314 Reply

    Ok Alright, thank you!
  18. Stefan Bürk commented on patch set 6 CR +1 V +1 02/13/24, 07:01

    Published edit on patch set 5.
  19. core-ci voted on patch set 6 V +1 02/13/24, 07:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53121

  20. Stefan Bürk commented on patch set 6 02/13/24, 07:11

    FormEditorController.php:280 Reply

    Done
  21. Benjamin Franzke voted on patch set 6 CR +1 02/13/24, 07:17

  22. Benjamin Franzke voted on patch set 6 V +1 02/13/24, 07:19

  23. Anja Leichsenring voted on patch set 6 CR +1 V +1 02/13/24, 07:22

  24. Stefan Bürk voted on patch set 6 CR +2 V +2 02/13/24, 07:25

  25. Stefan Bürk merged patch set 7 02/13/24, 07:25