Review main Merged

75005[BUGFIX] Avoid yoda-style conditions in PHP

Elias Häußler CR +2 V +2 Normal +34 −33 updated 07/01/22, 09:37

Commit message

The core team agreed on not using yoda-style conditions in PHP. An
appropriate PHP-CS-Fixer rule to explicitly disable yoda-style has
been added to ensure that this coding style is respected. Additionally,
all yoda-style conditions have been transformed to normal conditions.

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Björn Jacob +1
    • Oliver Hader +1
    • Mathias Brodala +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Oliver Hader +1
    • Mathias Brodala +1
    • core-ci +1 CI

Issues 1

Files 19

Review log 1416

  1. Elias Häußler uploaded patch set 1 07/01/22, 08:50

  2. Mathias Brodala commented on patch set 1 07/01/22, 08:55

    php-cs-fixer.php:102

    This can be simplified to `=> false`.
  3. Björn Jacob voted on patch set 1 CR +1 07/01/22, 08:55

  4. Elias Häußler commented on patch set 1 07/01/22, 08:57

    php-cs-fixer.php:102 Reply

    Setting it to `false` had no effect when I initially tested it. Have you successfully tried it?
  5. core-ci voted on patch set 1 V +1 07/01/22, 08:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28552

  6. Mathias Brodala commented on patch set 1 V +1 CR +1 07/01/22, 09:02

    php-cs-fixer.php:102 Reply

    Hm, just had a look at the source any you are right, one must configure each type separately. Not sure why I assumed that just "false" works, thanks for the hint.
  7. Nikita Hovratov commented on patch set 1 07/01/22, 09:09

    Let's exclude 10.4 from this patch, as it is only cosmetical.
  8. Elias Häußler updated the commit message in patch set 2 07/01/22, 09:11

  9. Björn Jacob voted on patch set 2 CR +1 07/01/22, 09:12

  10. Mathias Brodala voted on patch set 2 V +1 CR +1 07/01/22, 09:14

  11. core-ci voted on patch set 2 V +1 07/01/22, 09:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28554

  12. Nikita Hovratov voted on patch set 2 V +1 CR +1 07/01/22, 09:27

  13. Oliver Hader voted on patch set 2 CR +1 07/01/22, 09:29

  14. Oliver Hader voted on patch set 2 V +1 07/01/22, 09:30

  15. Nikita Hovratov voted on patch set 2 V +2 CR +2 07/01/22, 09:31

  16. Nikita Hovratov merged patch set 3 07/01/22, 09:37