This method seems to be duplicated in your project.
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.
Loading history...
32
{
33
// Protocol spec states this is a uint32 rather than a uint16, so allow any uint32 value at the protocol level
34
if ($port < UINT32_MIN || $port > UINT32_MAX) {
35
throw new InvalidValueException(
36
"Port {$port} outside allowable range of " . UINT32_MIN . " - " . UINT32_MAX
37
);
38
}
39
40
$this->port = $port;
41
}
42
43
/**
44
* @param int $typeId
45
* @param int $port
46
* @throws InvalidValueException
47
*/
48
public function __construct(int $typeId, int $port)
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.