Passed
Push — master ( 616725...543f0f )
by Malte
03:41
created
src/GeoIP.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      *
52 52
      * @return array|null
53 53
      */
54
-    public function current(){
54
+    public function current() {
55 55
         return $this->get($this->remote_address->getIpAddress());
56 56
     }
57 57
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      *
62 62
      * @return array|null
63 63
      */
64
-    public function get($ip){
64
+    public function get($ip) {
65 65
         if (isset($this->cache[$ip])) {
66 66
             return $this->cache[$ip];
67 67
         }
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
             $output = curl_exec($ch);
89 89
             curl_close($ch);
90 90
 
91
-            if($output == false) {
91
+            if ($output == false) {
92 92
                 sleep(1);
93
-            }else{
93
+            } else {
94 94
                 return json_decode($output, true);
95 95
             }
96 96
 
97 97
             $retries++;
98 98
         }
99
-        while($retries > 0);
99
+        while ($retries > 0);
100 100
 
101 101
         return null;
102 102
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 
91 91
             if($output == false) {
92 92
                 sleep(1);
93
-            }else{
93
+            } else{
94 94
                 return json_decode($output, true);
95 95
             }
96 96
 
Please login to merge, or discard this patch.
src/RemoteAddress.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     public function getIpAddress() {
106 106
         $ip_address = $this->getIpAddressFromProxy();
107 107
 
108
-        if($ip_address == "127.0.0.1" || strlen($ip_address) < 7) {
108
+        if ($ip_address == "127.0.0.1" || strlen($ip_address) < 7) {
109 109
             $ip_address = false;
110 110
         }
111 111
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
         $ip_address = $_SERVER["REMOTE_ADDR"];
117 117
 
118
-        if(strlen($ip_address) < 7) {
118
+        if (strlen($ip_address) < 7) {
119 119
             $ip_address = "127.0.0.1";
120 120
         }
121 121
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $header = strtoupper($header);
176 176
         $header = str_replace('-', '_', $header);
177 177
         if (0 !== strpos($header, 'HTTP_')) {
178
-            $header = 'HTTP_' . $header;
178
+            $header = 'HTTP_'.$header;
179 179
         }
180 180
         return $header;
181 181
     }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     /**
184 184
      * @return bool
185 185
      */
186
-    public function isProxy(){
186
+    public function isProxy() {
187 187
         $test_HTTP_proxy_headers = [
188 188
             'HTTP_VIA',
189 189
             'VIA',
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             'HTTP_PROXY_CONNECTION'
210 210
         ];
211 211
 
212
-        foreach($test_HTTP_proxy_headers as $header){
212
+        foreach ($test_HTTP_proxy_headers as $header) {
213 213
             if (isset($_SERVER[$header]) && !empty($_SERVER[$header])) {
214 214
                 return true;
215 215
             }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,8 +240,9 @@
 block discarded – undo
240 240
         } else {
241 241
             $myisp = $isp[1].'.'.$isp[0];
242 242
         }
243
-        if (preg_match("/[0-9]{1,3}\.[0-9]{1,3}/", $myisp))
244
-            return null;
243
+        if (preg_match("/[0-9]{1,3}\.[0-9]{1,3}/", $myisp)) {
244
+                    return null;
245
+        }
245 246
 
246 247
         $isp = explode('.', $myisp);
247 248
         return $isp[0];
Please login to merge, or discard this patch.