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.

HEXToRGBConverter::supportsTo()   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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Artack\Color\Converter;
6
7
use Artack\Color\Color\Color;
8
use Artack\Color\Color\HEX;
9
use Artack\Color\Color\RGB;
10
use Webmozart\Assert\Assert;
11
12
class HEXToRGBConverter implements ConverterInterface
13
{
14 131
    public function convert(Color $color): Color
15
    {
16
        /* @var HEX $color */
17 131
        Assert::isInstanceOf($color, HEX::class, sprintf('color should be an instance of [%s]', HEX::class));
18
19 130
        $red = hexdec($color->getRed());
20 130
        $green = hexdec($color->getGreen());
21 130
        $blue = hexdec($color->getBlue());
22
23 130
        return new RGB($red, $green, $blue);
0 ignored issues
show
Bug introduced by
It seems like $red can also be of type double; however, parameter $red of Artack\Color\Color\RGB::__construct() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
        return new RGB(/** @scrutinizer ignore-type */ $red, $green, $blue);
Loading history...
Bug introduced by
It seems like $green can also be of type double; however, parameter $green of Artack\Color\Color\RGB::__construct() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
        return new RGB($red, /** @scrutinizer ignore-type */ $green, $blue);
Loading history...
Bug introduced by
It seems like $blue can also be of type double; however, parameter $blue of Artack\Color\Color\RGB::__construct() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
        return new RGB($red, $green, /** @scrutinizer ignore-type */ $blue);
Loading history...
24
    }
25
26 924
    public static function supportsFrom(): string
27
    {
28 924
        return HEX::class;
29
    }
30
31 924
    public static function supportsTo(): string
32
    {
33 924
        return RGB::class;
34
    }
35
}
36