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 |
||
| 18 | final class Version20180605111249 extends AbstractMigration implements ContainerAwareInterface |
||
|
|
|||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var ContainerInterface |
||
| 22 | */ |
||
| 23 | private $container; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param ContainerInterface|null $container |
||
| 27 | */ |
||
| 28 | public function setContainer(ContainerInterface $container = null) |
||
| 32 | |||
| 33 | public function up(Schema $schema): void |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param Schema $schema |
||
| 41 | */ |
||
| 42 | View Code Duplication | public function postUp(Schema $schema) |
|
| 62 | |||
| 63 | public function down(Schema $schema): void |
||
| 68 | } |
||
| 69 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.