Completed
Pull Request — master (#5)
by Yılmaz
13:43
created
src/Color.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $hex = $this->normalize($hex);
48 48
 
49
-        if(!$this->isValidHex($hex)) {
49
+        if (!$this->isValidHex($hex)) {
50 50
             throw new \InvalidArgumentException(sprintf('Given hex value %s is invalid', $hex));
51 51
         }
52 52
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function toRGB()
72 72
     {
73 73
         list($r, $g, $b) = sscanf($this->color, "%02x%02x%02x");
74
-        return [ $r, $g, $b ];
74
+        return [$r, $g, $b];
75 75
     }
76 76
 
77 77
     /**
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
     private function distanceL2(array $color1, array $color2)
142 142
     {
143 143
         return sqrt(
144
-            pow($color1[0]-$color2[0], 2) +
145
-            pow($color1[1]-$color2[1], 2) +
146
-            pow($color1[2]-$color2[2], 2)
144
+            pow($color1[0] - $color2[0], 2) +
145
+            pow($color1[1] - $color2[1], 2) +
146
+            pow($color1[2] - $color2[2], 2)
147 147
         );
148 148
     }
149 149
 
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
     private function normalize($hex)
196 196
     {
197 197
         // Get rid of first # sign if it exists
198
-        if($hex[0] === '#') {
198
+        if ($hex[0] === '#') {
199 199
             $hex = substr($hex, 1);
200 200
         }
201 201
 
202
-        if(strlen($hex) === 3) {
202
+        if (strlen($hex) === 3) {
203 203
             // Convert to 6 digit version
204 204
             $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2];
205 205
         }
Please login to merge, or discard this patch.