@@ -26,11 +26,11 @@ |
||
26 | 26 | */ |
27 | 27 | const TITLES = [ |
28 | 28 | 'Mr.', |
29 | - 'Ms.', // address for women regardless of their marital status |
|
29 | + 'Ms.', // address for women regardless of their marital status |
|
30 | 30 | 'Mrs.', |
31 | 31 | 'Miss', |
32 | - 'Mx.', // a title that does not indicate gender |
|
33 | - 'Adv.', // advocate |
|
32 | + 'Mx.', // a title that does not indicate gender |
|
33 | + 'Adv.', // advocate |
|
34 | 34 | 'Capt.', // captain |
35 | 35 | 'Dr.', |
36 | 36 | 'Prof.', // professor |
@@ -84,8 +84,8 @@ |
||
84 | 84 | public static function createFromCidrNotation($cidr) |
85 | 85 | { |
86 | 86 | list($subnet, $bits) = explode('/', $cidr); |
87 | - $start = long2ip((ip2long($subnet)) & ((-1 << (32 - (int)$bits)))); |
|
88 | - $end = long2ip((ip2long($subnet)) + pow(2, (32 - (int)$bits))-1); |
|
87 | + $start = long2ip((ip2long($subnet)) & ((-1 << (32 - (int) $bits)))); |
|
88 | + $end = long2ip((ip2long($subnet)) + pow(2, (32 - (int) $bits)) - 1); |
|
89 | 89 | |
90 | 90 | return new IpRange(new IpAddress($start), new IpAddress($end)); |
91 | 91 | } |
@@ -46,7 +46,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |