Issue Bug Closed

#24218Refactor conditions in t3lib_extFileFunc

Andreas Wolf 11/28/10, 00:44 updated 06/01/13, 14:43

Description

t3lib_extFileFunc has a lot of deeply nested conditions. These conditions make understanding the code really hard.

Most of the else-branches only contain a log call, so it helps a lot to invert the conditions and move the log call inside the if-branch. The else branch can then be removed, the code can be streamlined.

Example:

before:
if (condition) {
foo();
bar();
} else {
$this->writeLog(…);
}

after:
if (!condition) {
$this->writeLog(…);
}
foo();
bar();

(issue imported from #M16586)

Reviews 2