[TYPO3-dev] RFC: CGL change regarding return statements

Dmitry Dulepov dmitry.dulepov at gmail.com
Fri Mar 11 09:58:44 CET 2011


Hi!

François Suter wrote:
> One thing we should absolutely avoid IMO is to have mixed return types.
> This still happens in a lot of places in the Core: some method is
> expected to return a string or an array, but returns FALSE when it
> fails. This is bad style. If we are bent on cleaning up the Core, we
> should rather throw exceptions when a problem arises and return
> type-fitting values otherwise.
>
> Throwing exceptions can probably some or all of the early returns.

Good idea! +1.

-- 
Dmitry Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/




More information about the TYPO3-dev mailing list