@@ -8,17 +8,17 @@ |
||
8 | 8 | |
9 | 9 | abstract class NumericContainer extends StyleContainer |
10 | 10 | { |
11 | - public function px(int $px, bool $important=false) : StyleBuilder |
|
11 | + public function px(int $px, bool $important = false) : StyleBuilder |
|
12 | 12 | { |
13 | 13 | return $this->setStylePX($px, $important); |
14 | 14 | } |
15 | 15 | |
16 | - public function percent(float $percent, bool $important=false) : StyleBuilder |
|
16 | + public function percent(float $percent, bool $important = false) : StyleBuilder |
|
17 | 17 | { |
18 | 18 | return $this->setStylePercent($percent, $important); |
19 | 19 | } |
20 | 20 | |
21 | - public function em(float $percent, bool $important=false) : StyleBuilder |
|
21 | + public function em(float $percent, bool $important = false) : StyleBuilder |
|
22 | 22 | { |
23 | 23 | return $this->setStyleEM($percent, $important); |
24 | 24 | } |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | */ |
22 | 22 | private $collection; |
23 | 23 | |
24 | - private function __construct(?StyleCollection $collection=null) |
|
24 | + private function __construct(?StyleCollection $collection = null) |
|
25 | 25 | { |
26 | - if($collection === null) |
|
26 | + if ($collection === null) |
|
27 | 27 | { |
28 | 28 | $collection = StyleCollection::create(); |
29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $this->collection = $collection; |
32 | 32 | } |
33 | 33 | |
34 | - public static function create(?StyleCollection $collection=null) : StyleBuilder |
|
34 | + public static function create(?StyleCollection $collection = null) : StyleBuilder |
|
35 | 35 | { |
36 | 36 | return new StyleBuilder($collection); |
37 | 37 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | |
99 | 99 | public static function percent2Float(float $percent) : float |
100 | 100 | { |
101 | - return round($percent/100, self::$floatPrecision); |
|
101 | + return round($percent / 100, self::$floatPrecision); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | public static function float2percent(float $value) : float |
@@ -41,9 +41,9 @@ |
||
41 | 41 | { |
42 | 42 | $parts = array(RGBAColor::CHANNEL_RED, RGBAColor::CHANNEL_GREEN, RGBAColor::CHANNEL_BLUE); |
43 | 43 | |
44 | - foreach($parts as $part) |
|
44 | + foreach ($parts as $part) |
|
45 | 45 | { |
46 | - if($sourceColor->getColor($part)->get8Bit() !== $targetColor->getColor($part)->get8Bit()) |
|
46 | + if ($sourceColor->getColor($part)->get8Bit() !== $targetColor->getColor($part)->get8Bit()) |
|
47 | 47 | { |
48 | 48 | return false; |
49 | 49 | } |
@@ -21,18 +21,18 @@ |
||
21 | 21 | * @throws ColorException |
22 | 22 | * @see RGBAColor::ERROR_INVALID_HEX_LENGTH |
23 | 23 | */ |
24 | - public function parse(string $hex, string $name='') : RGBAColor |
|
24 | + public function parse(string $hex, string $name = '') : RGBAColor |
|
25 | 25 | { |
26 | 26 | $hex = ltrim($hex, '#'); // Remove the hash if present |
27 | 27 | $hex = strtoupper($hex); |
28 | 28 | $length = strlen($hex); |
29 | 29 | |
30 | - if($length === 3) |
|
30 | + if ($length === 3) |
|
31 | 31 | { |
32 | 32 | return $this->parseHEX3($hex, $name); |
33 | 33 | } |
34 | 34 | |
35 | - if($length === 6) |
|
35 | + if ($length === 6) |
|
36 | 36 | { |
37 | 37 | return $this->parseHEX6($hex, $name); |
38 | 38 | } |
@@ -9,9 +9,9 @@ |
||
9 | 9 | |
10 | 10 | declare(strict_types=1); |
11 | 11 | |
12 | -$autoload = __DIR__ . '/../vendor/autoload.php'; |
|
12 | +$autoload = __DIR__.'/../vendor/autoload.php'; |
|
13 | 13 | |
14 | -if(!file_exists($autoload)) |
|
14 | +if (!file_exists($autoload)) |
|
15 | 15 | { |
16 | 16 | die('<b>ERROR:</b> Autoloader not present. Please run composer install first.'); |
17 | 17 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | <br> |
43 | 43 | <?php |
44 | 44 | |
45 | - foreach($urls as $url) |
|
45 | + foreach ($urls as $url) |
|
46 | 46 | { |
47 | 47 | $info = parseURL($url); |
48 | 48 |
@@ -41,6 +41,6 @@ |
||
41 | 41 | |
42 | 42 | public function invert() : EightBitChannel |
43 | 43 | { |
44 | - return ColorChannel::eightBit(255-$this->value); |
|
44 | + return ColorChannel::eightBit(255 - $this->value); |
|
45 | 45 | } |
46 | 46 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $this->validateValue($value); |
38 | 38 | |
39 | - if(strlen($value) === 1) |
|
39 | + if (strlen($value) === 1) |
|
40 | 40 | { |
41 | 41 | $value = str_repeat($value, 2); |
42 | 42 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $match = preg_match('/\A[0-9A-F]{1,2}\z/iU', $hex); |
55 | 55 | |
56 | - if($match !== false && $match > 0) |
|
56 | + if ($match !== false && $match > 0) |
|
57 | 57 | { |
58 | 58 | return; |
59 | 59 | } |