Review main Merged

91188[TASK] Make MathUtility::canBeInterpretedAsInteger more robust

Oliver Klee CR +2 V +2 Easy +12 −1 updated 10/22/25, 12:49

Commit message

Instead of using casts which might throw an exception in
PHP 8.5, check the string representation of the value to
match a pattern that makes sense as an integer.

Review

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

Issues 2

Files 2

Review log 2632

Show 67 earlier messages
  1. Oliver Klee uploaded patch set 1 10/21/25, 14:32

  2. Mathias Brodala commented on patch set 1 10/21/25, 14:34

    Really? "Add FIRST_INSTALL to .gitignore"

    MathUtility.php:68

    That's definitely not simpler than before. So maybe rephrase the commit title to actually mention the intended change.
  3. Oliver Klee commented on patch set 1 10/21/25, 14:37

    Reply

    Oh, that _definitively_ was copy'n'pasted from the wrong place …
  4. Oliver Klee updated the commit message in patch set 2 10/21/25, 14:38

  5. Oliver Klee commented on patch set 1 10/21/25, 14:38

    Reply

    Done

    MathUtility.php:68 Reply

    Done
  6. core-ci voted on patch set 1 V -1 10/21/25, 14:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87190

  7. Simon Schaufelberger commented on patch set 2 10/21/25, 14:45

    Please cover this with tests
  1. Simon Schaufelberger commented on patch set 2 10/21/25, 14:45

    [B ?
  2. core-ci voted on patch set 2 V -1 10/21/25, 14:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87191

  3. Andreas Kienast commented on patch set 2 CR +1 10/21/25, 14:46

    Reply

    What's wrong with the existing ones?
  4. Oliver Klee updated the commit message in patch set 3 CR +1 V -1 10/21/25, 14:47

  5. Simon Schaufelberger commented on patch set 2 10/21/25, 14:47

    Reply

    sorry, I didn't check that. If the method is already covered - all good!
  6. Simon Schaufelberger commented on patch set 3 10/21/25, 14:48

    Reply

    Done

    Reply

    Done
  7. Oliver Klee commented on patch set 2 10/21/25, 14:49

    Reply

    Done
  8. Oliver Klee commented on patch set 3 V -1 10/21/25, 14:51

    It seems that there's something strange going on with `NormalizeCommand` (or its unit test). On it.
  9. core-ci voted on patch set 3 V -1 10/21/25, 14:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87192

  10. Oliver Klee uploaded patch set 4 V -1 10/21/25, 14:55

  11. Oliver Klee commented on patch set 4 10/21/25, 14:56

    Reply

    Done
  12. Oliver Klee commented on patch set 4 10/21/25, 14:57

    Reply

    The other failing test showed that a test case was indeed missing from `MathUtilityTest`. I've added it now.
  13. core-ci voted on patch set 4 V +1 10/21/25, 15:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87193

  14. Stefan Bürk voted on patch set 4 CR +1 V +1 10/22/25, 08:26

  15. Oliver Hader commented on patch set 4 10/22/25, 08:29

    The `preg_match` looks good, however I'm wondering whether we should aim for a "faster" solution (I did not do any performance measures, yet)
  16. Stefan Bürk commented on patch set 4 CR 0 V 0 10/22/25, 08:59

    Reply

    The cast thing would be the more performatn I guess, but than we need to use the `@` silence operator like done here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91119 Beside that, the float method uses regexp also. But the int is really often used, so make some performance gathering first (thanks for mentioning that).
  17. Oliver Hader commented on patch set 4 10/22/25, 09:05

    Reply

    I tried to measure it, but I does not look that significant and it really depends on the input format & length. Thus, I think `preg_match` would be fine here.
  18. Oliver Hader uploaded patch set 5 V +1 10/22/25, 09:14

  19. Oliver Hader voted on patch set 5 CR +1 V +1 10/22/25, 09:15

  20. core-ci voted on patch set 5 V -1 10/22/25, 09:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87224

  21. Oliver Hader uploaded patch set 6 CR +1 V +1 10/22/25, 09:38

  22. Oliver Hader voted on patch set 6 CR +1 V +1 10/22/25, 09:38

  23. core-ci voted on patch set 6 V +1 10/22/25, 09:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/87229

  24. Stefan Bürk voted on patch set 6 CR +2 V +2 10/22/25, 12:30

  25. Stefan Bürk merged patch set 7 10/22/25, 12:49