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.
Completed
Push — master ( 097b8b...051aff )
by Sebastian
12s
created

InvalidColorValue::malformedColorString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Spatie\Color\Exceptions;
4
5
use Exception;
6
7
class InvalidColorValue extends Exception
8
{
9
    public static function rgbChannelValueNotInRange(int $value, string $channel): self
10
    {
11
        return new static("An rgb values must be an integer between 0 and 255, `{$value}` provided for channel {$channel}.");
12
    }
13
14
    public static function alphaChannelValueNotInRange(int $value): self
15
    {
16
        return new static("An alpha values must be a float between 0 and 1, `{$value}` provided.");
17
    }
18
19
    public static function hexChannelValueHasInvalidLength(string $value): self
20
    {
21
        $length = strlen($value);
22
23
        return new static("Hex values must contain exactly 2 characters, `{$value}` contains {$length} characters.");
24
    }
25
26
    public static function hexValueContainsInvalidCharacters(string $value): self
27
    {
28
        return new static("Hex values can only contain numbers or letters from A-F, `{$value}` contains invalid characters.");
29
    }
30
31
    public static function malformedHexColorString(string $string): self
32
    {
33
        return new static("Hex color string `{$string}` is malformed. A hex color string starts with a `#` and contains exactly six characters, e.g. `#aabbcc`.");
34
    }
35
36
    public static function malformedRgbColorString(string $string): self
37
    {
38
        return new static("Rgb color string `{$string}` is malformed. An rgb color contains 3 comma separated values between 0 and 255, wrapped in `rgb()`, e.g. `rgb(0,0,255)`.");
39
    }
40
41
    public static function malformedRgbaColorString(string $string): self
42
    {
43
        return new static("Rgba color string `{$string}` is malformed. An rgba color contains 3 comma separated values between 0 and 255 with an alpha value between 0 and 1, wrapped in `rgba()`, e.g. `rgb(0,0,255,0.5)`.");
44
    }
45
46
    public static function malformedColorString(string $string): self
47
    {
48
        return new static("Color string `{$string}` doesn't match any of the available colors.");
49
    }
50
}
51