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 |
||
| 10 | class StopExtension |
||
| 11 | { |
||
| 12 | private $stopStrategies = array(); |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param Configuration $_configuration |
||
| 16 | * @param Dispatcher $_eventDispatcher |
||
| 17 | * @throws \phmLabs\Components\Annovent\Exception |
||
| 18 | */ |
||
| 19 | public function init(Configuration $_configuration, Dispatcher $_eventDispatcher) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @Event("Scanner.Scan.isStopped") |
||
| 33 | */ |
||
| 34 | public function isStopped(Event $event) |
||
| 45 | |||
| 46 | View Code Duplication | public function getStrategy($name) |
|
| 54 | } |
||
| 55 |