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...
20
{
21
if ($typeId < 0 || $typeId > 255) {
22
throw new InvalidValueException("Service type ID {$typeId} outside allowable range of 0 - 255");
23
}
24
25
// Protocol spec states this is a uint32 rather than a uint16, so allow any uint32 value at the protocol level
26
if ($port < UINT32_MIN || $port > UINT32_MAX) {
27
throw new InvalidValueException(
28
"Port {$port} outside allowable range of " . UINT32_MIN . " - " . UINT32_MAX
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.