Skip to content
Snippets Groups Projects
Commit 91381725 authored by Larry Garfield's avatar Larry Garfield Committed by Christian Kuhn
Browse files

[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: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 256d53ef
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