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 TaxStrategy implements CalculateStrategyInterface |
||
|
|
|||
| 11 | { |
||
| 12 | protected $app; |
||
| 13 | protected $Order; |
||
| 14 | |||
| 15 | 12 | public function __construct(Application $app = null) |
|
| 19 | |||
| 20 | 12 | public function execute(OrderDetailCollection $OrderDetails) |
|
| 29 | |||
| 30 | 12 | public function setApplication(Application $app) |
|
| 35 | |||
| 36 | 12 | public function setOrder(Order $Order) |
|
| 41 | } |
||
| 42 |