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.

CMYK   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 21
c 1
b 0
f 0
dl 0
loc 49
ccs 22
cts 22
cp 1
rs 10
wmc 13

5 Methods

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 22 9
A getCyan() 0 3 1
A getMagenta() 0 3 1
A getKey() 0 3 1
A getYellow() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Artack\Color\Color;
6
7
use Artack\Color\Exception\InvalidArgumentException;
8
9
class CMYK extends Color
10
{
11
    private $cyan;
12
    private $magenta;
13
    private $yellow;
14
    private $key;
15
16 206
    public function __construct(float $cyan, float $magenta, float $yellow, float $key)
17
    {
18 206
        if (((int) floor($cyan)) < 0 || ((int) ceil($cyan)) > 100) {
19 2
            throw new InvalidArgumentException(sprintf('Given cyan value %f must be between %d and %d >> [%2$d, %3$d]', $cyan, 0, 100));
20
        }
21
22 204
        if (((int) floor($magenta)) < 0 || ((int) ceil($magenta)) > 100) {
23 2
            throw new InvalidArgumentException(sprintf('Given magenta value %f must be between %d and %d >> [%2$d, %3$d]', $magenta, 0, 100));
24
        }
25
26 202
        if (((int) floor($yellow)) < 0 || ((int) ceil($yellow)) > 100) {
27 2
            throw new InvalidArgumentException(sprintf('Given yellow value %f must be between %d and %d >> [%2$d, %3$d]', $yellow, 0, 100));
28
        }
29
30 200
        if (((int) floor($key)) < 0 || ((int) ceil($key)) > 100) {
31 2
            throw new InvalidArgumentException(sprintf('Given key value %f must be between %d and %d >> [%2$d, %3$d]', $key, 0, 100));
32
        }
33
34 198
        $this->cyan = $cyan;
35 198
        $this->magenta = $magenta;
36 198
        $this->yellow = $yellow;
37 198
        $this->key = $key;
38 198
    }
39
40 198
    public function getCyan(): float
41
    {
42 198
        return $this->cyan;
43
    }
44
45 198
    public function getMagenta(): float
46
    {
47 198
        return $this->magenta;
48
    }
49
50 198
    public function getYellow(): float
51
    {
52 198
        return $this->yellow;
53
    }
54
55 198
    public function getKey(): float
56
    {
57 198
        return $this->key;
58
    }
59
}
60