[TYPO3-50-general] Refactoring-help needed

Robert Lemke robert at typo3.org
Wed Dec 10 15:41:18 CET 2008


Hi Bastian,

Am 05.12.2008 um 16:36 schrieb Bastian Waidelich:

> Hi all of you infamous PHP developer ;)
>
> While implementing "optional Route Parts"
> (http://forge.typo3.org/issues/show/1790) to the FLOW3 Routing  
> mechanism
> my brain is starting to curl and I'm a bit stuck.
> Well, the code works but it's quite chaotic now and basically  
> unreadable.
>
> Anyone fancy refactoring this
> http://scratchpad.cmlenz.net/8b37ec873f040ca7e0cd175558aa4f9e/ ?
>
> Any help is welcome!

I like the "not" in Julle's proposal, however I wouldn't use  
exceptions because
they'd be somewhat abused in this case (this is no exceptional state  
really).

What you could do is dividing the code into 2 or 3 dedicated functions  
which
gives the whole a better meaning (if you choose good method names).

Cheers,
robert


More information about the TYPO3-project-5_0-general mailing list