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

Oliver Klee typo3-german-02 at oliverklee.de
Thu Mar 10 17:55:54 CET 2011


Hi,

Am 09.03.2011 18:21, schrieb Andreas Wolf:
> So what I propose is to drop the limitation to one return statement for
> all validation logic at the start of a method. It should be clear where
> this part ends and when the business logic starts. There, only one
> return statement is allowed.

I fully agree (assuming that I've understood you correctly, of which I'm
not quite sure yet). Just to be safe, let me paraphrase what I've
understood:

1. (optional, and possibly several) guard clauses at the beginning of
the function for error cases and special cases (those might contain
either an exception or returns)

2. after that, only exactly one (or no) return at the end of the function


Is this what you mean?


Oli
-- 
Certified TYPO3 Integrator | TYPO3 Security Team Member




More information about the TYPO3-dev mailing list