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...
24
{
25
if ($power < 0 || $power > 65535) {
26
throw new InvalidValueException("Power level {$power} outside allowable range of 0 - 65535");
27
}
28
29
$this->power = $power;
30
}
31
32
private function setLabel(Label $label): void
33
{
34
$this->label = $label;
35
}
36
37
/**
38
* @param HsbkColor $color
39
* @param int $power
40
* @param Label $label
41
* @throws InvalidValueException
42
*/
43
public function __construct(HsbkColor $color, int $power, Label $label)
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.