Project

General

Profile

Actions

Bug #24218

closed

Refactor conditions in t3lib_extFileFunc

Added by Andreas Wolf over 13 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-11-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)


Files

0016586_v1.diff (43.6 KB) 0016586_v1.diff Administrator Admin, 2010-11-28 01:18

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #30213: copy directorys in filemanagerClosedAndreas Wolf2011-09-22

Actions
Actions #1

Updated by Andreas Wolf over 13 years ago

Attached a patch with the suggested refactorings.

Actions #2

Updated by Mr. Hudson almost 13 years ago

Patch set 2 of change Ic900fe3294142ebc89be4c3d420bb729a24d5452 has been pushed to the review server.
It is available at http://review.typo3.org/1087

Actions #3

Updated by Andreas Wolf almost 13 years ago

  • Status changed from New to Resolved
  • Target version changed from 0 to 1238
  • % Done changed from 0 to 100
  • TYPO3 Version changed from 4.5 to 4.6

Has been integrated with commit 2585d5a060eb1196965458954b30d0b869abc58c.

Actions #4

Updated by Xavier Perseguers about 12 years ago

  • Status changed from Resolved to Closed
Actions #5

Updated by Ernesto Baschny almost 11 years ago

  • Target version deleted (1238)
Actions

Also available in: Atom PDF