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 declare(strict_types=1); |
||
7 | class Module extends CompressableExternalModule implements CompressInterface |
||
|
|||
8 | { |
||
9 | /** Database table prefix */ |
||
10 | public $prefix; |
||
11 | /** Database name */ |
||
12 | public $name; |
||
13 | /** Login */ |
||
14 | public $login = 'root'; |
||
15 | /** Password */ |
||
16 | public $pwd; |
||
17 | /** Host */ |
||
18 | public $host = '127.0.0.1'; |
||
19 | /** @var string Port number */ |
||
20 | public $port = ''; |
||
21 | public $relations = array(); |
||
22 | |||
23 | /* Array of additional relations to set */ |
||
24 | /** |
||
25 | * Идентификатор модуля |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $id = 'activerecord'; |
||
29 | |||
30 | /** @see \samson\core\CompressableExternalModule::beforeCompress() */ |
||
31 | public function beforeCompress(& $obj = null, array & $code = null) |
||
35 | |||
36 | /** @see \samson\core\CompressableExternalModule::afterCompress() */ |
||
37 | public function afterCompress(& $obj = null, array & $code = null) |
||
60 | |||
61 | /** @see \samson\core\ExternalModule::prepare() */ |
||
62 | public function prepare() |
||
94 | |||
95 | //[PHPCOMPRESSOR(remove,start)] |
||
96 | public function relations() |
||
100 | |||
101 | //[PHPCOMPRESSOR(remove,end)] |
||
102 | |||
103 | /** @see \samson\core\ExternalModule::init() */ |
||
104 | public function init(array $params = array()) |
||
113 | } |
||
114 |
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.