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 |
||
| 13 | class TIncludeType extends IsOK |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @property string $namespace |
||
| 18 | */ |
||
| 19 | private $namespace = null; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @property string $alias |
||
| 23 | */ |
||
| 24 | private $alias = null; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Gets as namespace |
||
| 28 | * |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | public function getNamespace() |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Sets a new namespace |
||
| 38 | * |
||
| 39 | * @param string $namespace |
||
| 40 | * @return self |
||
| 41 | */ |
||
| 42 | public function setNamespace($namespace) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Gets as alias |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | public function getAlias() |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Sets a new alias |
||
| 60 | * |
||
| 61 | * @param string $alias |
||
| 62 | * @return self |
||
| 63 | */ |
||
| 64 | public function setAlias($alias) |
||
| 69 | |||
| 70 | protected function isOK(&$msg = null) |
||
| 94 | } |
||
| 95 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.