Review main Merged

83449[TASK] Clean up code inconsistencies detected by phpstan

Benni Mack CR +2 V +2 Hard +65 −241 updated 03/22/24, 16:01

Commit message

Various places in smaller extensions were
reported in phpstan that had some inconsistencies
in their code style, which were unnecessary and are
now avoided.

Review

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

Issues 1

Files 18

Review log 1824

  1. Benni Mack uploaded patch set 1 03/13/24, 09:23

  2. core-ci voted on patch set 1 V +1 03/13/24, 09:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54461

  3. Benni Mack updated the commit message in patch set 2 V +1 03/13/24, 09:46

  4. core-ci voted on patch set 2 V +1 03/13/24, 09:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54464

  5. Benjamin Franzke commented on patch set 2 03/13/24, 10:19

    DatabaseIntegrityController.php:1486

    This code looked fishy. Without that I checked it out/tested yet, this looks like this assignment resulted in one foreach iteration below, with `fieldName` and `fieldType` set to an empty string, which then creates some strange values in the `default` branch. Is that an implicit bugfix?
  6. Benni Mack uploaded patch set 3 V +1 03/13/24, 10:41

  7. core-ci voted on patch set 3 V -1 03/13/24, 10:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54468

  8. Benni Mack uploaded patch set 4 V -1 03/13/24, 10:59

  9. core-ci voted on patch set 4 V -1 03/13/24, 11:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54469

  10. Benni Mack uploaded patch set 5 V -1 03/13/24, 12:21

  11. core-ci voted on patch set 5 V +1 03/13/24, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54474

  12. Benni Mack commented on patch set 5 03/13/24, 13:03

    DatabaseIntegrityController.php:1486 Reply

    should be fine now, I guess?
  13. Benjamin Franzke commented on patch set 5 03/13/24, 13:05

    DatabaseIntegrityController.php:1486 Reply

    Acknowledged
  14. Benjamin Franzke commented on patch set 5 03/13/24, 13:32

    ExtendedFileUtility.php:893

    `File|false|null` (see line 901 – or change that to `= false`)

    ContentObjectRenderer.php:2443

    Good catch by phpstan, the old condition never matched: ``` php > var_dump(empty(explode(',', ''))); bool(false) var_dump(empty([''])); bool(false) php > var_dump(explode(',', '') === ['']); bool(true) ``` Should we backport(?)
  15. Benni Mack commented on patch set 5 03/15/24, 15:44

    ContentObjectRenderer.php:2443 Reply

    Yes. Based on the code below, it would still return '' - I tried adding tests but they do not change depending on this change.
  16. Benni Mack commented on patch set 6 V +1 03/22/24, 15:11

    Published edit on patch set 5.
  17. Benjamin Franzke commented on patch set 5 03/22/24, 15:14

    ContentObjectRenderer.php:2443 Reply

    Acknowledged
  18. Benjamin Franzke commented on patch set 6 03/22/24, 15:14

    ExtendedFileUtility.php:893 Reply

    Done
  19. core-ci voted on patch set 6 V +1 03/22/24, 15:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/54850

  20. Benjamin Franzke voted on patch set 6 CR +1 03/22/24, 15:17

  21. Benjamin Franzke voted on patch set 6 V +1 03/22/24, 15:28

  22. Stefan Bürk voted on patch set 6 CR +1 V +1 03/22/24, 16:00

  23. Benni Mack voted on patch set 6 CR +2 V +2 03/22/24, 16:00

  24. Benni Mack merged patch set 7 03/22/24, 16:01