Review main Merged

79159[TASK] Use local variable in `CleanUpLocalProcessedFilesCommand`

Stefan Bürk CR +2 V +2 Easy +4 −3 updated 06/01/23, 12:16

Commit message

With recent changes in phpstan/phpstan, it seems the possible return
value of methods is not set in stone anymore, allowing detection
of possible issues in the code.

This change uses a local method variable for the method return
value of `isVerbose()` and uses this instead of several method calls.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Oliver Hader +2
    • Oliver Klee +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Oliver Klee +1
    • Andreas Kienast +1

Issues 1

Files 1

Review log 1520

  1. Stefan Bürk uploaded patch set 1 06/01/23, 10:26

  2. core-ci voted on patch set 1 V +1 06/01/23, 10:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42145

  3. Stefan Bürk commented on patch set 1 06/01/23, 10:34

  4. core-ci commented on patch set 1 06/01/23, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42146

  5. Andreas Kienast commented on patch set 1 06/01/23, 11:06

    I think that phpstan has an issue with the code because `isVerbose()` _could_ suddenly return a different value which would indeed lead to "Variable $progressBar might not be defined"
  6. Stefan Bürk commented on patch set 1 06/01/23, 11:11

    Reply

    Ack. Anyway, the change should avoid that in static code anaylzes and processing. A suggestion how to change the commit message ?
  7. Andreas Kienast voted on patch set 1 CR +1 06/01/23, 11:13

  8. Andreas Kienast updated the commit message in patch set 2 CR +1 V +1 06/01/23, 11:15

  9. Anja Leichsenring updated the commit message in patch set 3 06/01/23, 11:15

  10. Anja Leichsenring voted on patch set 3 V +1 CR +1 06/01/23, 11:15

  11. Andreas Kienast updated the commit message in patch set 4 CR +1 V +1 06/01/23, 11:18

  12. Andreas Kienast voted on patch set 4 V +1 CR +1 06/01/23, 11:19

  13. Stefan Bürk commented on patch set 4 06/01/23, 11:20

    Reply

    Done
  14. Oliver Klee voted on patch set 4 V +1 CR +1 06/01/23, 11:27

  15. core-ci voted on patch set 2 V +1 06/01/23, 11:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42149

  16. Anja Leichsenring voted on patch set 4 V +2 CR +2 06/01/23, 11:28

  17. Anja Leichsenring merged patch set 5 06/01/23, 11:28

  18. core-ci voted on patch set 3 V +1 06/01/23, 11:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42150

  19. core-ci voted on patch set 4 V +1 06/01/23, 11:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/42151

  20. Oliver Hader commented on patch set 5 CR +2 06/01/23, 12:16

    Actually the behavior of PhpStan is correct (better) here. There is no guarantee, that consecutive function calls return the same value...