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 |
||
35 | class Setup |
||
36 | { |
||
37 | /** |
||
38 | * Use this method to register all autoloads for a downloaded Doctrine library. |
||
39 | * Pick the directory the library was uncompressed into. |
||
40 | * |
||
41 | * @param string $directory |
||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | 1 | public static function registerAutoloadDirectory($directory) |
|
57 | |||
58 | /** |
||
59 | * Creates a configuration with an annotation metadata driver. |
||
60 | * |
||
61 | * @param array $paths |
||
62 | * @param boolean $isDevMode |
||
63 | * @param string $proxyDir |
||
64 | * @param Cache $cache |
||
65 | * @param bool $useSimpleAnnotationReader |
||
66 | * |
||
67 | * @return Configuration |
||
68 | */ |
||
69 | 3 | View Code Duplication | public static function createAnnotationMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null, $useSimpleAnnotationReader = true) |
76 | |||
77 | /** |
||
78 | * Creates a configuration with a xml metadata driver. |
||
79 | * |
||
80 | * @param array $paths |
||
81 | * @param boolean $isDevMode |
||
82 | * @param string $proxyDir |
||
83 | * @param Cache $cache |
||
84 | * |
||
85 | * @return Configuration |
||
86 | */ |
||
87 | 1 | View Code Duplication | public static function createXMLMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null) |
94 | |||
95 | /** |
||
96 | * Creates a configuration with a yaml metadata driver. |
||
97 | * |
||
98 | * @param array $paths |
||
99 | * @param boolean $isDevMode |
||
100 | * @param string $proxyDir |
||
101 | * @param Cache $cache |
||
102 | * |
||
103 | * @return Configuration |
||
104 | */ |
||
105 | 1 | View Code Duplication | public static function createYAMLMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null) |
112 | |||
113 | /** |
||
114 | * Creates a configuration without a metadata driver. |
||
115 | * |
||
116 | * @param bool $isDevMode |
||
117 | * @param string $proxyDir |
||
118 | * @param Cache $cache |
||
119 | * |
||
120 | * @return Configuration |
||
121 | */ |
||
122 | 6 | public static function createConfiguration($isDevMode = false, $proxyDir = null, Cache $cache = null) |
|
170 | } |
||
171 |
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.