1 | <?php |
||
14 | class UsersRequest extends AbstractMessage |
||
|
|||
15 | { |
||
16 | |||
17 | /** |
||
18 | * UsersRequest constructor. |
||
19 | * |
||
20 | * @param string $instanceName |
||
21 | * |
||
22 | * @throws MalformedRequestException |
||
23 | */ |
||
24 | 2 | public function __construct($instanceName) |
|
25 | { |
||
26 | 2 | if (!is_string($instanceName)) |
|
27 | 2 | throw new MalformedRequestException('Missing required parameter "instanceName"'); |
|
28 | |||
29 | 1 | parent::__construct(self::TYPE_USERS_REQUEST, $instanceName); |
|
30 | 1 | } |
|
31 | |||
32 | |||
33 | /** |
||
34 | * @return string |
||
35 | */ |
||
36 | public function getInstanceName() |
||
40 | |||
41 | } |
||
42 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.