[TYPO3-v4] Deprecation of t3lib_div::testInt() in TYPO3 4.6

Jigal van Hemert jigal at xs4all.nl
Wed Nov 23 11:26:46 CET 2011


Hi,

On 23-11-2011 9:29, François Suter wrote:
> As you are probably aware of several "mathematical" method were moved to
> a separate class from t3lib_div and methods such as t3lib_div::testInt()
> were marked as deprecated. As this is very commonly used in extensions,
> it absolutely floods the deprecation log to the point where it becomes
> nearly useless.

It shows also the need for a more intelligent deprecation log...

> Although this deprecation move does not
> seem very wise, we can't really turn back,

We can't? We can always un-deprecate it; such things happens from time 
to time. For these functions it seems wise to do this.

> In effect the situation would mean that - for each testInt() call - we
> have to check whether class t3lib_utility_Math exists or not and call it
> instead of t3lib_div if it does. Probably this would better be wrapped
> inside one's own utility method.

Now you see the very unwanted side effect of such deprecations. Instead 
of using an API call it has to be wrapped inside a function of your own. 
Why would one wrap two functions + check in a function when both 
function contain exactly the same code? It's better copy the code to my 
own function then.
Because there is a list of those wrapper functions a new extension is 
born; another extension programmers library.

Rewriting code and then putting it in a new class plus deprecating the 
old functions seems sensible, this wasn't IMO.

-- 
Kind regards / met vriendelijke groet,

Jigal van Hemert.


More information about the TYPO3-project-v4 mailing list