Review main Merged

16518[FEATURE] Introduce ClassNamingUtility

Anja Leichsenring CR +2 V +2 Hard +382 −0 updated 06/03/13, 20:49

Commit message

Introduce a utility class for several naming issues like
converting class names from Model to Repository and
vice versa and exploding controllerObjectNames into used parts.

Thanks to Alexander Schnitzler for the initial patch.

Review

  • Code review CR +2
    • Andreas Wolf +2
    • Markus Günther +1
  • Verified V +2
    • Andreas Wolf +2
    • Markus Günther +1

Files 2

Review log 15

  1. Stefan Neufeind commented on patch set 1 02/10/13, 14:25

    Verified; Looks good to me, but someone else must approve But for 6.1
    vise => vice
    6.1 now

    ClassNamingUtility.php:47

    Simply str_replace maybe? Should be faster. And I expect such a classnaming-util might possibly be used in some central place / called often.

    ClassNamingUtility.php:48

    Three backslashes? I would have expected two or four ... and think two might be correct here.

    ClassNamingUtility.php:48

    Add underscores in front/at the back as in function below? Same for the extra \\ at the end imho

    ClassNamingUtility.php:65

    two backslashes maybe? Possibly followed by another \\ to make sure it appears "in the middle" of such a name and does not trigger on whatever (strange) \\ModelSomething or so?

    ClassNamingUtility.php:81

    also add those additional slashes/underscores like in comment above? Imho four backslashes instead of three? One to escape them and one another for each (doubling it again) to escape them because of the preg. Tried locally that it works with 3 and 4 the same way ... hmm, I would have expected a warning with three backslashes since the last one isn't properly escaped imho. But it works as is ...

    ClassNamingUtility.php:100

    TYPO3\\CMS imho

    ClassNamingUtilityTest.php:33

    and translateModelNameToValidatorName

    ClassNamingUtilityTest.php:118

    should we add a third dummy-parameter here since the dataProvider returns three values? Although the last one isn't used in this test. Same for test below.
  2. Andreas Wolf uploaded patch set 3 02/10/13, 14:25

  3. Andreas Wolf commented on patch set 3 02/10/13, 14:25

    Verified; Looks good to me, but someone else must approve
  4. Andreas Wolf commented on patch set 3 02/10/13, 14:25

    Ran unit tests and extended them, also added a new method to test the model->validator transformation.
  5. Andreas Wolf commented on patch set 3 V 0 02/10/13, 14:25

    by team member; Looks good to me, approved
  6. Andreas Wolf merged patch set 4 02/10/13, 14:25

  7. Stefan Neufeind commented on patch set 2 02/10/13, 14:25

    (3 inline comments)
  8. Stefan Neufeind commented on patch set 3 02/10/13, 14:25

    (5 inline comments)
  9. Stefan Neufeind commented on patch set 4 02/10/13, 14:25

    just some nitpicks
  10. Markus Günther commented on patch set 3 02/10/13, 14:25

    Verified; Looks good to me, but someone else must approve Cool! Thanks for that new Utility.
  11. Anja Leichsenring uploaded patch set 2 02/10/13, 14:25

  12. Mr. Jenkins commented on patch set 1 02/10/13, 14:25

  13. Mr. Jenkins commented on patch set 2 02/10/13, 14:25

  14. Mr. Jenkins commented on patch set 3 02/10/13, 14:25

  15. Stefan Neufeind commented on patch set 4 02/10/13, 14:25