Skip to content
Snippets Groups Projects
Commit 041497c9 authored by Andreas Kienast's avatar Andreas Kienast
Browse files

[TASK] Deprecate `MathUtility::convertToPositiveInteger()`

TYPO3 has a method to ensure an integer is always positive:
`MathUtility::convertToPositiveInteger()`. However, the method is
rather "heavy" as it internally calls `MU::forceIntegerInRange()` and
therefore misuses a clamp mechanism to convert the integer to a
positive number.

Also, the method name doesn't reflect what it actually does. Negative
numbers are not converted to their positive counterpart, but are
swapped with `0`. Due to the naming issue and the fact that the method
can be superseded by a simple `max()` call, the method is therefore
deprecated.

Resolves: #103785
Releases: main
Change-Id: I4fd0548ec6bc7289008057ade4e64f9437c2da7b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84141


Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarTorben Hansen <derhansen@gmail.com>
Tested-by: default avatarTorben Hansen <derhansen@gmail.com>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarBenjamin Franzke <ben@bnf.dev>
Tested-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
Reviewed-by: default avatarAndreas Kienast <a.fernandez@scripting-base.de>
parent a512e8bd
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment