Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php |
||
| 7 | class TYPO3FlowInstaller extends BaseInstaller |
||
| 8 | { |
||
| 9 | protected $locations = array( |
||
| 10 | 'package' => 'Packages/Application/{$name}/', |
||
| 11 | 'framework' => 'Packages/Framework/{$name}/', |
||
| 12 | 'plugin' => 'Packages/Plugins/{$name}/', |
||
| 13 | 'site' => 'Packages/Sites/{$name}/', |
||
| 14 | 'boilerplate' => 'Packages/Boilerplates/{$name}/', |
||
| 15 | 'build' => 'Build/{$name}/', |
||
| 16 | ); |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Modify the package name to be a TYPO3 Flow style key. |
||
| 20 | * |
||
| 21 | * @param array $vars |
||
| 22 | * @return array |
||
| 23 | */ |
||
| 24 | public function inflectPackageVars($vars) |
||
| 38 | } |
||
| 39 |