GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

RGB   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 16
c 0
b 0
f 0
dl 0
loc 38
ccs 17
cts 17
cp 1
rs 10
wmc 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getRed() 0 3 1
A getGreen() 0 3 1
A getBlue() 0 3 1
B __construct() 0 17 7
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Artack\Color\Color;
6
7
use Artack\Color\Exception\InvalidArgumentException;
8
9
class RGB extends Color
10
{
11
    private $red;
12
    private $green;
13
    private $blue;
14
15 735
    public function __construct(int $red, int $green, int $blue)
16
    {
17 735
        if ($red < 0 || $red > 255) {
18 2
            throw new InvalidArgumentException(sprintf('Given red value %d is expected to be between %d and %d >> [%2$d,%3$d]', $red, 0, 255));
19
        }
20
21 733
        if ($green < 0 || $green > 255) {
22 2
            throw new InvalidArgumentException(sprintf('Given green value %d is expected to be between %d and %d >> [%2$d,%3$d]', $green, 0, 255));
23
        }
24
25 731
        if ($blue < 0 || $blue > 255) {
26 2
            throw new InvalidArgumentException(sprintf('Given blue value %d is expected to be between %d and %d >> [%2$d,%3$d]', $blue, 0, 255));
27
        }
28
29 729
        $this->red = $red;
30 729
        $this->green = $green;
31 729
        $this->blue = $blue;
32 729
    }
33
34 727
    public function getRed(): int
35
    {
36 727
        return $this->red;
37
    }
38
39 727
    public function getGreen(): int
40
    {
41 727
        return $this->green;
42
    }
43
44 727
    public function getBlue(): int
45
    {
46 727
        return $this->blue;
47
    }
48
}
49