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 |
||
| 11 | class TaxStrategy implements CalculateStrategyInterface |
||
|
|
|||
| 12 | { |
||
| 13 | protected $app; |
||
| 14 | protected $Order; |
||
| 15 | |||
| 16 | public function __construct(Application $app = null) |
||
| 20 | |||
| 21 | public function execute(ShipmentItemCollection $ShipmentItems) |
||
| 31 | |||
| 32 | public function setApplication(Application $app) |
||
| 37 | |||
| 38 | public function setOrder(PurchaseInterface $Order) |
||
| 43 | |||
| 44 | public function getTargetTypes() |
||
| 48 | } |
||
| 49 |