Review main Merged

75683[TASK] Prevent undefined array key warnings in ext:adminpanel

Oliver Hader CR +2 V +2 Normal +47 −34 updated 09/22/22, 07:40

Commit message

This change addresses several "undefined array key" issues that have
been identified by PsalmPHP (see issue #98321).

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Oliver Klee +1
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • Susi Moog +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • Susi Moog +1
    • core-ci +1 CI

Issues 1

Files 16

Review log 2126

Show 1 earlier messages
  1. Oliver Hader uploaded patch set 1 09/10/22, 12:03

  1. core-ci voted on patch set 1 V +1 09/10/22, 12:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30943

  2. Stefan Bürk commented on patch set 1 09/10/22, 13:02

    PageTitle.php:81

    I think we should move this two lines below into the if-block, to the right scrope. not needed on that level. (nit-pick).
  3. Stefan Bürk uploaded patch set 2 09/10/22, 13:02

  4. Stefan Bürk commented on patch set 2 09/10/22, 13:02

    PageTitle.php:81 Reply

    Done
  5. core-ci voted on patch set 2 V +1 09/10/22, 13:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30945

  6. Stefan Bürk voted on patch set 2 V +1 CR +1 09/10/22, 13:11

  7. Simon Schaufelberger updated the commit message in patch set 3 09/10/22, 14:49

  8. core-ci voted on patch set 3 V +1 09/10/22, 14:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30948

  9. Oliver Klee commented on patch set 3 09/10/22, 16:31

    PreviewModule.php:49

    Are those array elements nullable, or are they optional? In case they are optional instead of nullable, the corresponding notation should look like this instead: * showHiddenPages?: bool, * simulateDate?: int, * showHiddenRecords?: bool, * showScheduledRecords?: bool, * simulateUserGroup?: int, * showFluidDebug?: bool This is documented here: https://phpstan.org/writing-php-code/phpdoc-types#array-shapes
  10. Oliver Hader commented on patch set 3 09/10/22, 18:11

    PreviewModule.php:49 Reply

    Thanks, indeed those are meant to be optional, not nullable.
  11. Oliver Hader uploaded patch set 4 09/10/22, 18:11

  12. core-ci voted on patch set 4 V +1 09/10/22, 18:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30953

  13. Oliver Klee voted on patch set 4 CR +1 09/11/22, 10:09

  14. Susi Moog voted on patch set 4 V +1 CR +1 09/15/22, 07:10

  15. Benjamin Franzke commented on patch set 4 09/16/22, 10:04

    AbstractModule.php:68

    Hm.. did psalm PHP complain about this line? It's a construct we use very often, and I don't see the issue… Replacing that with empty makes the code harder to read (IMO) and later/strict phpstan levels will complain about empty() not being typesafe (too general) condition.
  16. Oliver Hader commented on patch set 4 09/19/22, 11:44

    AbstractModule.php:68 Reply

    Psalm complained about the line below - and did not anymore when using `empty` - sure, that is an internal issue with Psalm. → extracted issue with Psalm: https://psalm.dev/r/1ad02a92e4 However, using `empty` is the explicit form of what currently is evaluated here. In the future PhpStan might issues problems for mixed types as well. → extracted issue with PhpStan: https://phpstan.org/r/ed831730-cbec-47d0-9d19-46d6c3ffc4eb Anyway, I'm fine with keep the previous code (discarding this change).
  17. Oliver Hader uploaded patch set 5 09/19/22, 11:46

  18. Oliver Hader commented on patch set 5 09/19/22, 11:47

    AbstractModule.php:68 Reply

    Done
  19. core-ci voted on patch set 5 V +1 09/19/22, 11:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31265

  20. Oliver Klee voted on patch set 5 CR +1 09/19/22, 13:47

  21. Anja Leichsenring voted on patch set 5 V +1 CR +1 09/19/22, 16:44

  22. Stefan Bürk voted on patch set 5 V +1 CR +1 09/19/22, 16:46

  23. Susi Moog voted on patch set 5 V +1 CR +1 09/22/22, 05:36

  24. Oli Bartsch voted on patch set 5 V +2 CR +2 09/22/22, 07:40

  25. Oli Bartsch merged patch set 6 09/22/22, 07:40