Review main Merged Breaking

73987[!!!][TASK] Add modern typing to ClassNamingUtility

crell CR +2 V +2 Easy +10 −20 updated 04/04/22, 14:57

Commit message

Simple type additions. Nothing exciting.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Georg Ringer +1
    • Oliver Klee +1
    • Simon Gilli +1
    • Stefan Bürk +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Georg Ringer +1
    • Stefan Bürk +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 4655

Show 2530 earlier messages
  1. crell uploaded patch set 1 03/17/22, 20:14

  2. core-ci voted on patch set 1 V +1 03/17/22, 20:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24970

  3. Oli Bartsch commented on patch set 1 V -1 03/17/22, 21:44

    Adding type hints to parameters of API methods is a breaking change which has to be documented as such.
  4. crell uploaded patch set 2 03/29/22, 18:19

  5. core-ci voted on patch set 2 V +1 03/29/22, 18:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25266

  6. Oliver Klee voted on patch set 2 CR +1 03/29/22, 18:50

  7. Stefan Bürk uploaded patch set 3 03/29/22, 23:31

  8. core-ci voted on patch set 3 V +1 03/29/22, 23:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25275

  9. Stefan Bürk voted on patch set 3 V +1 CR +1 03/29/22, 23:59

  10. crell commented on patch set 3 03/30/22, 01:29

    ClassNamingUtility.php:67

    If we're going to mess with the code here, I'd go all the way to a ternary, frankly. :-) (Multiline ternaries are a very useful construct for this sort of case.)
  11. Simon Schaufelberger commented on patch set 3 03/30/22, 15:41

    ClassNamingUtility.php:67 Reply

    would make sense to me imho
  12. Stefan Bürk commented on patch set 3 03/30/22, 15:43

    ClassNamingUtility.php:67 Reply

    The point is, that I wanted a classic "default -> if condition then" instead if a if-then-else. Do not have something against multiline ternaries, personally. But had not the best luck with it in other patches - thus using this one. Personally I'm fine with both, still preferred here that construct because of method call as condition.
  13. Oliver Klee commented on patch set 3 03/30/22, 15:48

    ClassNamingUtility.php:67 Reply

    I personally find nested ternaries really hard to read and to understand and would recommend against using them. (Better let's have very clear, slightly longer code than very "clever", but hard to (mis)read code.)
  14. crell commented on patch set 3 03/30/22, 15:54

    ClassNamingUtility.php:67 Reply

    No nesting involved. I agree, nested ternaries are nasty. I mean this: $extensionName = str_starts_with($controllerObjectName, 'TYPO3\\CMS') ? $extensionName = '^(?P<vendorName>[^\\\\]+\\\[^\\\\]+)\\\(?P<extensionName>[^\\\\]+)' : '^(?P<vendorName>[^\\\\]+)\\\\(?P<extensionName>[^\\\\]+)'; Which avoids multiple assignments to the same variable, but also only has one assignment statement overall. It's basically a shortened version of match(), in practice. It's logically identical to the current code. (I'd have left the original code in place to avoid scope creeping here, but as long as we're messing with it, let's go for the cleanest option.)
  15. Stefan Bürk commented on patch set 3 03/30/22, 15:58

    ClassNamingUtility.php:67 Reply

    go for it (just remove $extensName in the if-line (from my side). I'm fine with both at all in that case. It's just old school kicked in to avoid else-branches ;) Having the "default" before, and only change if condition matched. As said. Fine with both from myside. Would buy both.
  16. crell uploaded patch set 4 03/30/22, 16:22

  17. Oliver Klee commented on patch set 4 CR +1 03/30/22, 16:27

    Thanks!
  18. crell commented on patch set 3 03/30/22, 16:30

    ClassNamingUtility.php:67 Reply

    Ack
  19. core-ci voted on patch set 4 V +1 03/30/22, 16:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25292

  20. Stefan Bürk voted on patch set 4 V +1 CR +1 03/30/22, 16:40

  21. Simon Schaufelberger commented on patch set 4 03/31/22, 00:24

    ClassNamingUtility.php:67

    this semicolon looks a bit lost here. I have never seen this code style anywhere in the core and would prefer putting it in the end of line 66
  22. Simon Schaufelberger voted on patch set 4 CR -1 03/31/22, 00:27

  23. Simon Schaufelberger commented on patch set 4 03/31/22, 00:30

    ClassNamingUtility.php:67 Reply

    I've checked other ternary usages in the core and the semicolon is always at the end of the line.
  24. Stefan Bürk uploaded patch set 5 03/31/22, 12:46

  25. Stefan Bürk commented on patch set 5 V +1 CR +1 03/31/22, 12:47

    ClassNamingUtility.php:67 Reply

    Done
  26. Oliver Klee voted on patch set 5 CR +1 03/31/22, 12:53

  27. core-ci voted on patch set 5 V +1 03/31/22, 12:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25304

  28. Simon Schaufelberger voted on patch set 5 V +1 CR +1 03/31/22, 14:29

  29. crell commented on patch set 5 CR +1 03/31/22, 15:26

    I've done a little of each on the ternary semicolon, so I don't care greatly either way.
  30. Andreas Kienast commented on patch set 5 CR -1 04/01/22, 12:34

    Breaking-97210-TypesAddedToMethodSignatures.rst:17

    By adding your changed class you agree it's a breaking change. Please prefix such patches with [!!!].
  1. Andreas Kienast updated the commit message in patch set 6 04/01/22, 12:35

  2. Simon Schaufelberger voted on patch set 6 V +1 CR +1 04/01/22, 12:36

  3. Stefan Bürk voted on patch set 6 V +1 CR +1 04/01/22, 12:36

  4. Andreas Kienast voted on patch set 6 CR +1 04/01/22, 12:37

  5. Stefan Bürk commented on patch set 6 04/01/22, 12:37

    Breaking-97210-TypesAddedToMethodSignatures.rst:17 Reply

    huh! .. right (head against the wall)
  6. Oliver Klee voted on patch set 6 CR +1 04/01/22, 12:49

  7. core-ci voted on patch set 6 V +1 04/01/22, 12:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25352

  8. Simon Gilli commented on patch set 6 CR -1 04/01/22, 12:52

    ClassNamingUtility.php:58

    Exact type hint is missing
  9. Stefan Bürk commented on patch set 6 04/01/22, 13:06

    ClassNamingUtility.php:58 Reply

    Was not before either. Which one do you have in mind ?
  10. crell updated the commit message in patch set 7 04/01/22, 13:34

  11. Simon Schaufelberger updated the commit message in patch set 8 04/01/22, 13:38

  12. Oliver Klee voted on patch set 8 CR +1 04/01/22, 13:42

  13. core-ci voted on patch set 7 V +1 04/01/22, 13:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25355

  14. Simon Schaufelberger voted on patch set 8 V +1 CR +1 04/01/22, 13:44

  15. core-ci voted on patch set 8 V +1 04/01/22, 13:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25356

  16. crell uploaded patch set 9 04/01/22, 13:50

  17. Simon Schaufelberger voted on patch set 9 V +1 CR +1 04/01/22, 13:53

  18. crell commented on patch set 9 04/01/22, 13:53

    ClassNamingUtility.php:58 Reply

    Done

    Breaking-97210-TypesAddedToMethodSignatures.rst:17 Reply

    Done
  19. core-ci voted on patch set 9 V +1 04/01/22, 13:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25357

  20. Oliver Klee voted on patch set 9 CR +1 04/01/22, 14:12

  21. Georg Ringer voted on patch set 9 V +1 CR +1 04/02/22, 06:50

  22. Simon Gilli voted on patch set 9 CR +1 04/02/22, 11:35

  23. Stefan Bürk voted on patch set 9 V +1 CR +1 04/04/22, 14:52

  24. Andreas Kienast voted on patch set 9 V +2 CR +2 04/04/22, 14:57

  25. Andreas Kienast merged patch set 10 04/04/22, 14:57