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...
19
{
20
if ($level < 0 || $level > 65535) {
21
throw new InvalidValueException("Power level {$level} outside allowable range of 0 - 65535");
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
if ($duration < UINT32_MIN || $duration > UINT32_MAX) {
34
throw new InvalidValueException(
35
"Transition duration {$duration} outside allowable range of " . UINT32_MIN . " - " . UINT32_MAX
36
);
37
}
38
39
$this->duration = $duration;
40
}
41
42
/**
43
* @param int $level
44
* @param int $duration
45
* @throws InvalidValueException
46
*/
47
public function __construct(int $level, int $duration)
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.