Completed
Pull Request — master (#31)
by
unknown
01:13
created
src/Log/SentryLogger.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
     /**
170 170
      * Return peak memory usage.
171 171
      *
172
-     * @return float
172
+     * @return string
173 173
      */
174 174
     public function getPeakMemory()
175 175
     {
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -218,46 +218,46 @@
 block discarded – undo
218 218
         return php_sapi_name();
219 219
     }
220 220
 
221
- 	/**
222
-	 * Returns the client IP address which originated this request.
223
-     * Lifted and modified from SilverStripe 3's SS_HTTPRequest.
224
-	 *
225
-	 * @return string
226
-	 */
227
-	public function getIP()
221
+        /**
222
+         * Returns the client IP address which originated this request.
223
+         * Lifted and modified from SilverStripe 3's SS_HTTPRequest.
224
+         *
225
+         * @return string
226
+         */
227
+    public function getIP()
228 228
     {
229
-		$headerOverrideIP = null;
229
+        $headerOverrideIP = null;
230 230
 
231
-		if (defined('TRUSTED_PROXY')) {
232
-			$headers = (defined('SS_TRUSTED_PROXY_IP_HEADER')) ?
231
+        if (defined('TRUSTED_PROXY')) {
232
+            $headers = (defined('SS_TRUSTED_PROXY_IP_HEADER')) ?
233 233
                 array(SS_TRUSTED_PROXY_IP_HEADER) :
234 234
                 null;
235 235
 
236
-			if(!$headers) {
237
-				// Backwards compatible defaults
238
-				$headers = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR'];
239
-			}
236
+            if(!$headers) {
237
+                // Backwards compatible defaults
238
+                $headers = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR'];
239
+            }
240 240
 
241
-			foreach($headers as $header) {
242
-				if(!empty($_SERVER[$header])) {
243
-					$headerOverrideIP = $_SERVER[$header];
241
+            foreach($headers as $header) {
242
+                if(!empty($_SERVER[$header])) {
243
+                    $headerOverrideIP = $_SERVER[$header];
244 244
 
245
-					break;
246
-				}
247
-			}
248
-		}
245
+                    break;
246
+                }
247
+            }
248
+        }
249 249
 
250 250
         $proxy = Injector::inst()->create(TrustedProxyMiddleware::class);
251 251
 
252
-		if ($headerOverrideIP) {
253
-			return $proxy->getIPFromHeaderValue($headerOverrideIP);
254
-		}
252
+        if ($headerOverrideIP) {
253
+            return $proxy->getIPFromHeaderValue($headerOverrideIP);
254
+        }
255 255
 
256 256
         if (isset($_SERVER['REMOTE_ADDR'])) {
257
-			return $_SERVER['REMOTE_ADDR'];
258
-		}
257
+            return $_SERVER['REMOTE_ADDR'];
258
+        }
259 259
 
260 260
         return '';
261
-	}
261
+    }
262 262
 
263 263
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -230,16 +230,15 @@
 block discarded – undo
230 230
 
231 231
 		if (defined('TRUSTED_PROXY')) {
232 232
 			$headers = (defined('SS_TRUSTED_PROXY_IP_HEADER')) ?
233
-                array(SS_TRUSTED_PROXY_IP_HEADER) :
234
-                null;
233
+                array(SS_TRUSTED_PROXY_IP_HEADER) : null;
235 234
 
236
-			if(!$headers) {
235
+			if (!$headers) {
237 236
 				// Backwards compatible defaults
238 237
 				$headers = ['HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR'];
239 238
 			}
240 239
 
241
-			foreach($headers as $header) {
242
-				if(!empty($_SERVER[$header])) {
240
+			foreach ($headers as $header) {
241
+				if (!empty($_SERVER[$header])) {
243 242
 					$headerOverrideIP = $_SERVER[$header];
244 243
 
245 244
 					break;
Please login to merge, or discard this patch.
src/Adaptor/RavenClient.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,7 @@
 block discarded – undo
117 117
     public function getLevel($level)
118 118
     {
119 119
         return isset($this->logLevels[$level]) ?
120
-            $this->logLevels[$level] :
121
-            $this->logLevels[self::$default_error_level];
120
+            $this->logLevels[$level] : $this->logLevels[self::$default_error_level];
122 121
     }
123 122
 
124 123
 }
Please login to merge, or discard this patch.