Review main Merged Breaking

79955[!!!][TASK] Introduce type declarations for GU networking-related methods

Oliver Klee CR +2 V +2 Normal +107 −56 updated 07/18/23, 11:38

Commit message

Native return and param type declarations have been introduced for the
following methods of `\TYPO3\CMS\Core\Utility\GeneralUtility`:

- `cmpFQDN`
- `cmpIP`
- `cmpIPv4`
- `cmpIPv6`
- `getUrl`
- `isOnCurrentHost`
- `isValidUrl`
- `locationHeaderUrl`
- `normalizeIPv6`
- `sanitizeLocalUrl`
- `validEmail`
- `validIP`
- `validIPv4`
- `validIPv6`
- `validPathStr`

Also, type declarations have been added to the corresponding unit tests.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1316

  1. Oliver Klee uploaded patch set 1 07/11/23, 07:26

  2. Oliver Klee commented on patch set 1 CR -1 07/11/23, 07:31

  3. core-ci voted on patch set 1 V -1 07/11/23, 07:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44006

  4. Alexander Schnitzler commented on patch set 1 07/11/23, 08:16

    GeneralUtility.php:114

    What about making $list variadic and make the comma separated list only a fallback? Would apply to all other methods that accept a comma separated list as well.

    GeneralUtility.php:2527

    Since we have a breaking change, I suggest removing the default value because it doesn't make sense to call this method without any argument. $url being empty is valid though.
  5. Oliver Klee commented on patch set 1 07/11/23, 09:37

    GeneralUtility.php:2527 Reply

  6. Oliver Klee uploaded patch set 2 CR -1 V -1 07/11/23, 10:39

  7. core-ci voted on patch set 2 V +1 07/11/23, 10:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44033

  8. Oliver Klee commented on patch set 2 07/11/23, 10:48

    GeneralUtility.php:114 Reply

    I like that idea! And I would like to have it in a separate change. Hence, I have created a ticket for this: https://forge.typo3.org/issues/101312
  9. Oliver Klee uploaded patch set 3 V +1 07/12/23, 17:00

  10. core-ci voted on patch set 3 V +1 07/12/23, 17:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44092

  11. Stefan Bürk commented on patch set 3 07/18/23, 08:59

    GeneralUtility.php:114 Reply

    I would rather create new methods with more meaningfull names and use the verdic there, doing here the decode and dispatching to the "new" verdic variants. And after replaceing them in the core deprecate the old variants. Maybe this could help beginners to understand more what the method name means. What do you think ? (Same for the other cmp* methods).
  12. Stefan Bürk voted on patch set 3 V +1 CR +1 07/18/23, 09:02

  13. Christian Kuhn voted on patch set 3 V +2 CR +2 07/18/23, 09:51

  14. Christian Kuhn merged patch set 4 07/18/23, 09:56

  15. Oliver Klee commented on patch set 4 07/18/23, 11:34

    GeneralUtility.php:114 Reply

    I‘d be fine with both, and like the idea of introducing new, better-named methods even more! (Either way, that should happen in a separate change.)
  16. Oliver Klee commented on patch set 4 07/18/23, 11:38

    GeneralUtility.php:114 Reply

    I have created an issue for this now: https://forge.typo3.org/issues/101377