[TASK] Add modern typing to MathUtility
This patch add more explicit types to MathUtility. Of particular note: * isIntegerInRange(), despite its name, allows for non-ints and treats them as out-of-range. Types are setup to retain that behavior. * convertToPositiveInteger() is the same behavior as a call to forceIntegerInRange() with a min of 0, thus changed to be that. * calculateWithPriorityToAdditionAndSubtraction() was docblock typed to return an int, when in reality it's float|string. Both are changed to "float|string" rather than changing the behavior. * Similarly, calculateWithParentheses()'s docblock changed to proper return type string instead of the incorrect int. Resolves: #97203 Releases: main Change-Id: I1c09ccff321f9a89684869e740b1b7bc16f3aa27 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73986 Tested-by:core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- Build/phpstan/phpstan-baseline.neon 0 additions, 15 deletionsBuild/phpstan/phpstan-baseline.neon
- typo3/sysext/core/Classes/Utility/MathUtility.php 15 additions, 21 deletionstypo3/sysext/core/Classes/Utility/MathUtility.php
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97210-TypesAddedToMethodSignatures.rst 1 addition, 0 deletions...elog/12.0/Breaking-97210-TypesAddedToMethodSignatures.rst
Please register or sign in to comment