Skip to content

Commit 08bf719

Browse files
committed
TASK: Fix bugs detected by phpstan
1 parent 1d8d057 commit 08bf719

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

Classes/Eel/ColorBuilder.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,19 @@ public function hsl(int $hue, int $saturatiom, int $lightness, int $alpha = 100)
5656
public function hex(string $hex): ?ColorHelper
5757
{
5858
if (preg_match(self::PATTERN_HEX_SHORT, $hex, $matches)) {
59-
$red = (int)hexdec($matches['red'].$matches['red']);
60-
$green = (int)hexdec($matches['green'].$matches['green']);
61-
$blue = (int)hexdec($matches['blue'].$matches['blue']);
62-
$alpha = (int)hexdec(isset($matches['alpha']) ? $matches['alpha'].$matches['alpha'] : "ff");
59+
$red = (int) hexdec($matches['red'].$matches['red']);
60+
$green = (int) hexdec($matches['green'].$matches['green']);
61+
$blue = (int) hexdec($matches['blue'].$matches['blue']);
62+
$alpha = (int) hexdec(isset($matches['alpha']) ? $matches['alpha'].$matches['alpha'] : "ff");
6363

6464
return new ColorHelper(
6565
new RgbaColor($red, $green, $blue, $alpha)
6666
);
6767
} elseif (preg_match(self::PATTERN_HEX_LONG, $hex, $matches)) {
68-
$red = (int)hexdec($matches['red']);
69-
$green = (int)hexdec($matches['green']);
70-
$blue = (int)hexdec($matches['blue']);
71-
$alpha = (int)hexdec($matches['alpha'] ?? "ff");
68+
$red = (int) hexdec($matches['red']);
69+
$green = (int) hexdec($matches['green']);
70+
$blue = (int) hexdec($matches['blue']);
71+
$alpha = (int) hexdec($matches['alpha'] ?? "ff");
7272

7373
return new ColorHelper(
7474
new RgbaColor($red, $green, $blue, $alpha)
@@ -88,19 +88,19 @@ public function hex(string $hex): ?ColorHelper
8888
public function css(string $colorString): ?ColorHelper
8989
{
9090
if (preg_match(self::PATTERN_HEX_SHORT, $colorString, $matches)) {
91-
$red = (int)hexdec($matches['red'].$matches['red']);
92-
$green = (int)hexdec($matches['green'].$matches['green']);
93-
$blue = (int)hexdec($matches['blue'].$matches['blue']);
94-
$alpha = (int)hexdec(isset($matches['alpha']) ? $matches['alpha'].$matches['alpha'] : "ff");
91+
$red = (int) hexdec($matches['red'].$matches['red']);
92+
$green = (int) hexdec($matches['green'].$matches['green']);
93+
$blue = (int) hexdec($matches['blue'].$matches['blue']);
94+
$alpha = (int) hexdec(isset($matches['alpha']) ? $matches['alpha'].$matches['alpha'] : "ff");
9595

9696
return new ColorHelper(
9797
new RgbaColor($red, $green, $blue, $alpha)
9898
);
9999
} elseif (preg_match(self::PATTERN_HEX_LONG, $colorString, $matches)) {
100-
$red = (int)hexdec($matches['red']);
101-
$green = (int)hexdec($matches['green']);
102-
$blue = (int)hexdec($matches['blue']);
103-
$alpha = (int)hexdec($matches['alpha'] ? $matches['alpha'] : "ff");
100+
$red = (int) hexdec($matches['red']);
101+
$green = (int) hexdec($matches['green']);
102+
$blue = (int) hexdec($matches['blue']);
103+
$alpha = (int) hexdec($matches['alpha'] ? $matches['alpha'] : "ff");
104104

105105
return new ColorHelper(
106106
new RgbaColor($red, $green, $blue, $alpha)

0 commit comments

Comments
 (0)