Review main Merged

63766[TASK] Fix null coalescing operator precedence

TYPO3com CR +2 V +2 Easy +2 −2 updated 03/20/20, 10:47

Commit message

Review

  • Code review CR +2 Done
    • Susi Moog +2
    • Oliver Klee +1
    • Markus Klein +1
  • Verified V +2 Done
    • Susi Moog +2
    • Markus Klein +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1216

  1. TYPO3com uploaded patch set 1 03/18/20, 13:26

  2. TYPO3com voted on patch set 1 V +1 03/18/20, 13:38 Completed build in 11m 58s on Wed, 18 Mar, 01:38 PM Test Summary: 72036 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1418

  3. Oliver Klee commented on patch set 1 03/18/20, 13:49

    Can we have tests that catch this?

    Unresolved

    Is 9.5 affected as well?
  4. Markus Klein commented on patch set 1 03/18/20, 14:42

    Unresolved

    Please no such links in commit messages. thanks.
  5. Markus Klein commented on patch set 1 03/18/20, 14:44

    DataHandler.php:8149

    this cast can be removed as well, while we are at it
  6. Alexander Schnitzler commented on patch set 1 03/18/20, 17:53

    DataHandler.php:8149 Reply

    I am not sure if phpstan doesn't complain about it then because it expects only boolean comparisons in if statements which makes sense. IIRC $userTsConfig['options.']['clearCache.']['all'] can be 1 and is therefore casted to bool.
  7. Markus Klein commented on patch set 1 03/18/20, 19:45

    DataHandler.php:8149 Reply

    You are aware that any expression is cast to bool by definition when used in a condition? So not sure what rule you refer to, but if it means that one needs to write `if ((bool)$a)` then this rule is pure bullshit.
  8. Susi Moog updated the commit message in patch set 2 03/19/20, 09:41

  9. Susi Moog updated the commit message in patch set 3 03/19/20, 09:41

  10. TYPO3com voted on patch set 3 V +1 03/19/20, 10:10 Completed build in 22m 53s on Thu, 19 Mar, 10:10 AM Test Summary: 72084 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1437

  11. TYPO3com voted on patch set 2 V +1 03/19/20, 10:10 Completed build in 23m 05s on Thu, 19 Mar, 10:10 AM Test Summary: 72084 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1436

  12. Oliver Klee voted on patch set 3 CR +1 03/19/20, 11:01

  13. Markus Klein voted on patch set 3 V +1 CR +1 03/20/20, 09:35

  14. Susi Moog voted on patch set 3 V +2 CR +2 03/20/20, 10:02

  15. Susi Moog merged patch set 4 03/20/20, 10:02

  16. Alexander Schnitzler commented on patch set 4 03/20/20, 10:47

    DataHandler.php:8149 Reply Unresolved

    I am aware of that but I still think it makes sense to have more explicit code. phpstan primarily checks for cases like this: > $rows = $conenction->fetchAll(); > if ($rows) {...} The idea is to have explicit types for phpstan to be able to check further code. I would love to get rid of such complex statements in if clauses also for more readability. We could extract checking user ts config values for instance and properly determine what values equal a boolean true. At the moment, casting a string to bool is quite hard to evaluate with our own eyes. Is 'false' casted to false or true? You can't tell right away unless you are experienced. phpstan teaches us to code more explicit and to define types more precisely.