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.
Test Failed
Push — master ( 003f3e...5f1f5d )
by Patrick
02:17
created

HEXToRGBConverter::supportsTo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 3
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 3
loc 3
rs 10
c 0
b 0
f 0
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 View Code Duplication
class HEXToRGBConverter implements Convertible
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    public function convert(Color $color): Color
15
    {
16
        /* @var HEX $color */
17
        Assert::isInstanceOf($color, HEX::class, sprintf('color should be an instance of [%s]', HEX::class));
18
19
        $red = hexdec($color->getRed());
20
        $green = hexdec($color->getGreen());
21
        $blue = hexdec($color->getBlue());
22
23
        return new RGB($red, $green, $blue);
0 ignored issues
show
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...
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...
24
    }
25
26
    public static function supportsFrom(): string
27
    {
28
        return HEX::class;
29
    }
30
31
    public static function supportsTo(): string
32
    {
33
        return RGB::class;
34
    }
35
}
36