Conditions | 2 |
Paths | 1 |
Total Lines | 6 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public static function isValidRgb(int $red, int $green, int $blue) : bool |
||
28 | { |
||
29 | // Check to see the values are between 0 and 255 and return false if any are outside the bounds |
||
30 | 14 | return array_reduce([$red, $green, $blue], function ($carry, $color) { |
|
31 | 14 | return max(min(intval($color), 255), 0) === $color && $carry === true; |
|
32 | 14 | }, true); |
|
33 | } |
||
63 |