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::getRed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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