Review 11.5 Merged

83625[TASK] Avoid calling deprecated Symfony Console helper commands

Oliver Klee CR +2 V +2 Easy +3 −3 updated 04/04/24, 13:39

Commit message

`Console\Helper::strlen()` was deprecated in Symfony 5.3. As we
require Symfony >= 5.4, we can safely use the replacement
function instead that 12.4 and `main` also use.

Note: This already got fixed in main and 12.4 with the upgrade to
Symfony 6.1. So this fix here is for 11.5 only.

Another note: This change aligns the code with 12.4 and `main`. Changing this to the more fitting `::width()` should happen in a separate later change across versions, not only for 11.5.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Jörg Bösche +1
    • Andreas Kienast +1
    • Oliver Hader +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1826

Show 1 earlier messages
  1. Oliver Klee uploaded patch set 1 03/29/24, 17:59

  1. core-ci voted on patch set 1 V +1 03/29/24, 18:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55067

  2. Oliver Klee updated the commit message in patch set 2 V +1 03/29/24, 19:14

  3. core-ci voted on patch set 2 V -1 03/29/24, 19:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55068

  4. Oliver Klee updated the commit message in patch set 3 V -1 03/29/24, 19:55

  5. core-ci voted on patch set 3 V +1 03/29/24, 20:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55069

  6. Sybille Peters commented on patch set 3 03/30/24, 05:32

    TextDescriptor.php:108

    Since we want the width, wouldn't we normally call Helper::width() instead? (Or just strlen() if we know it is an English non-multibyte string).
  7. Oliver Klee commented on patch set 3 03/30/24, 10:02

    TextDescriptor.php:108 Reply

    We probably could. However, in 12.4 and main we also call `Helper::length` (https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Command/Descriptor/TextDescriptor.php#L108), and I'd like the code to be consistent across versions. (For cleanup, it might make sense to change this to `::width()` across versions, but I'd prefer that to be a separate change.)
  8. Sybille Peters voted on patch set 3 CR +1 03/30/24, 11:17

  9. Nikita Hovratov updated the commit message in patch set 4 CR +1 V +1 03/30/24, 16:38

  10. core-ci voted on patch set 4 V -1 03/30/24, 16:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55094

  11. Oliver Klee commented on patch set 4 03/30/24, 17:35

    Oops, and good catch! Thanks!
  12. core-ci commented on patch set 4 03/30/24, 17:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55094

  13. core-ci commented on patch set 4 03/30/24, 17:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55094

  14. core-ci voted on patch set 4 V +1 03/30/24, 17:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55094

  15. Georg Ringer voted on patch set 4 CR +1 V +1 04/02/24, 14:18

  16. Oliver Hader commented on patch set 4 04/03/24, 09:56

    I guess this is a `[TASK]` instead, isn't it? since no actual bug is fixed... Besides that, Symfony is using `width` for `strlen` - there's a difference between `width` and `length`: * The width is how many characters positions the string will use. * The length is related to how many bytes the string will use. For the visual representation we are probably interested in the "width", not "length", aren't we?
  17. Oliver Klee commented on patch set 4 04/03/24, 10:20

    Reply

    This avoids a deprecation notice getting logged. That's why I marked it as a `[BUGFIX]` to start with. I'd be fine with having it as a `[TASK]` as well (if it helps this change getting merged). Concerning the `width`/`length` issue: We probably should change this to `width`. However, in 12.4 and main we also call `Helper::length` (https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Command/Descriptor/TextDescriptor.php#L108), and I'd like the code to be consistent across versions. (For cleanup, it might make sense to change this to `::width()` across versions, but I'd prefer that to be a separate change.)
  18. Oliver Klee updated the commit message in patch set 5 CR +1 V +1 04/03/24, 10:22

  19. core-ci voted on patch set 5 V +1 04/03/24, 10:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55261

  20. Oliver Hader voted on patch set 5 CR +1 04/03/24, 12:33

  21. Jörg Bösche voted on patch set 5 CR +1 04/04/24, 06:31

  22. Georg Ringer voted on patch set 5 CR +1 V +1 04/04/24, 11:50

  23. Andreas Kienast voted on patch set 5 CR +1 04/04/24, 12:28

  24. Oli Bartsch voted on patch set 5 CR +2 V +2 04/04/24, 13:39

  25. Oli Bartsch merged patch set 6 04/04/24, 13:39