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 |
||
| 30 | class Version13000Date20170814074715 extends SimpleMigrationStep { |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param IOutput $output |
||
| 34 | * @param \Closure $schemaClosure The `\Closure` returns a `Schema` |
||
| 35 | * @param array $options |
||
| 36 | * @since 13.0.0 |
||
| 37 | */ |
||
| 38 | public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param IOutput $output |
||
| 43 | * @param \Closure $schemaClosure The `\Closure` returns a `Schema` |
||
| 44 | * @param array $options |
||
| 45 | * @return null|Schema |
||
| 46 | * @since 13.0.0 |
||
| 47 | */ |
||
| 48 | public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @param IOutput $output |
||
| 72 | * @param \Closure $schemaClosure The `\Closure` returns a `Schema` |
||
| 73 | * @param array $options |
||
| 74 | * @since 13.0.0 |
||
| 75 | */ |
||
| 76 | public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { |
||
| 78 | } |
||
| 79 |