[TYPO3-core] RFC #7357: Use exceptions to detect missing user function

Ingmar Schlecht ingmar at typo3.org
Sat Feb 2 17:12:00 CET 2008


Oliver Klee wrote:
> Martin Kutschker schrieb:
>>> Please use ($errorMode == 0) instead of (!$errorMode) because this will
>>> make the code a lot easier to read (I nearly gave you a -1 because the
>>> new code didn't seem to match the new function documentation).
>> I did this on purpose. See my decription: "To be compatible any true
>> value except 2 means silent. "
> 
> Hm, maybe a "$errorMode != 1" then would make the intent clearer.

I don't find !$errorMode especially hard to read.

>>> Actually, we now have this code three times - this is a bad smell.
>>> Please refactor it to a separate function.
>> What do you suggest? Add a private static function to t3lib_div for that
>> purpose? Or maybe an inline function within callUserFunction() is more
>> to your taste?
> 
> I'll like a private static function best.

I don't think a private static function makes that much sense for those 
few lines of code.

No need to overbeautify things!

cheers
Ingmar

-- 
Ingmar Schlecht
TYPO3 Association Active Member


More information about the TYPO3-team-core mailing list