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 |
||
| 8 | class PhpEnumType extends AbstractPhpEnumType |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param $typeNameOrEnumClass |
||
| 12 | * @param null $enumClass |
||
| 13 | * @throws InvalidArgumentException |
||
| 14 | * @throws DBALException |
||
| 15 | */ |
||
| 16 | 9 | public static function registerEnumType($typeNameOrEnumClass, $enumClass = null) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @param array $types |
||
| 39 | * @throws InvalidArgumentException |
||
| 40 | * @throws DBALException |
||
| 41 | */ |
||
| 42 | 2 | View Code Duplication | public static function registerEnumTypes(array $types) |
| 49 | } |
||
| 50 |