@@ -18,12 +18,12 @@ |
||
18 | 18 | class SentrySeverity |
19 | 19 | { |
20 | 20 | /** |
21 | - * Maps PHP's internal error-types into those suited to {@link Severity}. |
|
22 | - * |
|
23 | - * @param mixed int|string $severity The incoming level from userland code or |
|
24 | - * PHP itself. |
|
25 | - * @return string |
|
26 | - */ |
|
21 | + * Maps PHP's internal error-types into those suited to {@link Severity}. |
|
22 | + * |
|
23 | + * @param mixed int|string $severity The incoming level from userland code or |
|
24 | + * PHP itself. |
|
25 | + * @return string |
|
26 | + */ |
|
27 | 27 | public static function process_severity($severity) : string |
28 | 28 | { |
29 | 29 | // Stringified PHP severities out of \backtrace() like "notice" |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $this->context['env'] = $data; |
78 | 78 | break; |
79 | 79 | case 'tags': |
80 | - Hub::getCurrent()->configureScope(function (Scope $scope) use($data) : void { |
|
80 | + Hub::getCurrent()->configureScope(function(Scope $scope) use($data) : void { |
|
81 | 81 | foreach ($data as $tagName => $tagData) { |
82 | 82 | $scope->setTag($tagName, $tagData); |
83 | 83 | $this->context['tags'][$tagName] = $tagData; |
@@ -85,13 +85,13 @@ discard block |
||
85 | 85 | }); |
86 | 86 | break; |
87 | 87 | case 'user': |
88 | - Hub::getCurrent()->configureScope(function (Scope $scope) use($data) : void { |
|
88 | + Hub::getCurrent()->configureScope(function(Scope $scope) use($data) : void { |
|
89 | 89 | $scope->setUser($data); |
90 | 90 | $this->context['user'] = $data; |
91 | 91 | }); |
92 | 92 | break; |
93 | 93 | case 'extra': |
94 | - Hub::getCurrent()->configureScope(function (Scope $scope) use($data) : void { |
|
94 | + Hub::getCurrent()->configureScope(function(Scope $scope) use($data) : void { |
|
95 | 95 | foreach ($data as $extraKey => $extraData) { |
96 | 96 | $scope->setExtra($extraKey, $extraData); |
97 | 97 | $this->context['extra'][$extraKey] = $extraData; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | }); |
100 | 100 | break; |
101 | 101 | case 'level': |
102 | - Hub::getCurrent()->configureScope(function (Scope $scope) use($data) : void { |
|
102 | + Hub::getCurrent()->configureScope(function(Scope $scope) use($data) : void { |
|
103 | 103 | $scope->setLevel(new Severity(SentrySeverity::process_severity($level = $data))); |
104 | 104 | }); |
105 | 105 | break; |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use Sentry\State\Scope; |
15 | 15 | use Sentry\ClientInterface; |
16 | 16 | use Sentry\Severity; |
17 | -use SilverStripe\Control\Director; |
|
18 | 17 | use SilverStripe\Core\Config\Configurable; |
19 | 18 | use SilverStripe\Core\Injector\Injector; |
20 | 19 | use SilverStripe\Core\Environment as Env; |
@@ -372,7 +372,7 @@ |
||
372 | 372 | |
373 | 373 | /** |
374 | 374 | * Check if we are on a tagged release and if so, use that to set the client release |
375 | - * @param $ref |
|
375 | + * @param string $ref |
|
376 | 376 | * @return mixed |
377 | 377 | */ |
378 | 378 | protected static function getGitTag($ref) |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | { |
184 | 184 | $peak = memory_get_peak_usage(true) / 1024 / 1024; |
185 | 185 | |
186 | - return (string)round($peak, 2) . 'Mb'; |
|
186 | + return (string) round($peak, 2) . 'Mb'; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
@@ -238,8 +238,7 @@ discard block |
||
238 | 238 | |
239 | 239 | if (defined('TRUSTED_PROXY')) { |
240 | 240 | $headers = (defined('SS_TRUSTED_PROXY_IP_HEADER')) ? |
241 | - [SS_TRUSTED_PROXY_IP_HEADER] : |
|
242 | - null; |
|
241 | + [SS_TRUSTED_PROXY_IP_HEADER] : null; |
|
243 | 242 | |
244 | 243 | if (!$headers) { |
245 | 244 | // Backwards compatible defaults |
@@ -386,7 +385,7 @@ discard block |
||
386 | 385 | } |
387 | 386 | $tags = explode(' ', $line); |
388 | 387 | if ($tags[0] === $ref) { |
389 | - list(,,$tag) = explode('/', $ref[1]); |
|
388 | + list(,, $tag) = explode('/', $ref[1]); |
|
390 | 389 | return $tag; |
391 | 390 | } |
392 | 391 | } |