Passed
Push — main ( 4c4711...48372d )
by Will
13:04
created
src/mappings/platforms.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace hexydec\agentzero;
4 4
 
5 5
 /**
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public static function get() : array {
16 16
 		$fn = [
17
-			'platformspace' => function (string $value) : array {
17
+			'platformspace' => function(string $value) : array {
18 18
 				$parts = \explode(' ', $value, 2);
19 19
 				return [
20 20
 					'platform' => $parts[0],
21 21
 					'platformversion' => $parts[1] ?? null
22 22
 				];
23 23
 			},
24
-			'platformlinux' => function (string $value) : array {
24
+			'platformlinux' => function(string $value) : array {
25 25
 				if (!\str_starts_with($value, 'Red Hat/') && ($platform = \mb_strstr($value, ' ', true)) !== false) {
26 26
 					$value = $platform;
27 27
 				}
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 					'platformversion' => isset($parts[1]) && \strspn($parts[1], '0123456789.-_') > 0 ? $parts[1] : null
41 41
 				];
42 42
 			},
43
-			'platformwindows' => function (string $value) : array {
43
+			'platformwindows' => function(string $value) : array {
44 44
 				$mapping = [
45 45
 					'5.0' => '2000',
46 46
 					'5.1' => 'XP',
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			],
78 78
 			'Windows Phone' => [
79 79
 				'match' => 'start',
80
-				'categories' => function (string $value) : array {
80
+				'categories' => function(string $value) : array {
81 81
 					$version = \mb_substr($value, 14);
82 82
 					return [
83 83
 						'type' => 'human',
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 			],
119 119
 			'Mac OS X' => [
120 120
 				'match' => 'any',
121
-				'categories' => function (string $value) : array {
121
+				'categories' => function(string $value) : array {
122 122
 					$version = \str_replace('_', '.', \mb_substr($value, \mb_stripos($value, 'Mac OS X') + 9));
123 123
 					$register = $version && \intval(\explode('.', $version)[1] ?? 0) >= 6 ? 64 : null;
124 124
 					return [
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			],
153 153
 			'CrOS' => [
154 154
 				'match' => 'start',
155
-				'categories' => function (string $value) : array {
155
+				'categories' => function(string $value) : array {
156 156
 					$parts = \explode(' ', $value);
157 157
 					return [
158 158
 						'type' => 'human',
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 			],
174 174
 			'Tizen' => [
175 175
 				'match' => 'start',
176
-				'categories' => function (string $value) : array {
176
+				'categories' => function(string $value) : array {
177 177
 					$parts = \explode(' ', $value, 2);
178 178
 					return [
179 179
 						'type' => 'human',
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 			],
277 277
 			'AmigaOS' => [
278 278
 				'match' => 'any',
279
-				'categories' => function (string $value) : array {
279
+				'categories' => function(string $value) : array {
280 280
 					if (($pos = \mb_stripos($value, 'AmigaOS')) !== false) {
281 281
 						$value = \mb_substr($value, $pos);
282 282
 					}
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 			],
293 293
 			'Fuchsia' => [
294 294
 				'match' => 'exact',
295
-				'categories' => function (string $value, int $i, array $tokens) : array {
295
+				'categories' => function(string $value, int $i, array $tokens) : array {
296 296
 					$os = \explode(' ', $tokens[++$i], 2);
297 297
 					return [
298 298
 						'type' => 'human',
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 			],
306 306
 			'Maemo' => [
307 307
 				'match' => 'exact',
308
-				'categories' => function (string $value, int $i, array $tokens) : array {
308
+				'categories' => function(string $value, int $i, array $tokens) : array {
309 309
 					$os = \explode(' ', $tokens[++$i], 2);
310 310
 					return [
311 311
 						'type' => 'human',
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 			],
328 328
 			'Haiku' => [
329 329
 				'match' => 'any',
330
-				'categories' => function (string $value) : array {
330
+				'categories' => function(string $value) : array {
331 331
 					$parts = \explode('/', $value, 2);
332 332
 					return [
333 333
 						'type' => 'human',
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 			],
341 341
 			'BeOS' => [
342 342
 				'match' => 'start',
343
-				'categories' => function (string $value) : array {
343
+				'categories' => function(string $value) : array {
344 344
 					$parts = \explode('/', $value, 2);
345 345
 					return [
346 346
 						'type' => 'human',
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			],
354 354
 			'Android' => [
355 355
 				'match' => 'start',
356
-				'categories' => function (string $value, int $i, array $tokens) : array {
356
+				'categories' => function(string $value, int $i, array $tokens) : array {
357 357
 					$os = \explode(' ', $value, 3);
358 358
 					$device = empty($tokens[++$i]) || \strlen($tokens[$i]) <= 2 ? [] : devices::getDevice($tokens[$i]);
359 359
 					return \array_merge($device, [
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 			],
374 374
 			'X11' => [
375 375
 				'match' => 'exact',
376
-				'categories' => function (string $value, int $i, array $tokens) : array {
376
+				'categories' => function(string $value, int $i, array $tokens) : array {
377 377
 					$os = \explode(' ', $tokens[++$i] ?? '', 2);
378 378
 					return [
379 379
 						'category' => 'desktop',
Please login to merge, or discard this patch.
src/mappings/browsers.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 namespace hexydec\agentzero;
4 4
 
5 5
 /**
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public static function get() : array {
16 16
 		$fn = [
17
-			'browserslash' => function (string $value) : array {
17
+			'browserslash' => function(string $value) : array {
18 18
 				if (($browser = \mb_strrchr($value, ' ')) !== false) {
19 19
 					$value = \ltrim($browser);
20 20
 				}
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 					'browserversion' => $parts[1] ?? null
44 44
 				];
45 45
 			},
46
-			'presto' => function (string $value) : array {
46
+			'presto' => function(string $value) : array {
47 47
 				$parts = \explode('/', $value, 2);
48 48
 				return [
49 49
 					'type' => 'human',
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 			],
222 222
 			'Midori' => [
223 223
 				'match' => 'start',
224
-				'categories' => function (string $value) : array {
224
+				'categories' => function(string $value) : array {
225 225
 					$parts = \explode('/', $value, 2);
226 226
 					return [
227 227
 						'type' => 'human',
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			],
247 247
 			'Firefox/' =>  [
248 248
 				'match' => 'start',
249
-				'categories' => function (string $value) use ($fn) : array {
249
+				'categories' => function(string $value) use ($fn) : array {
250 250
 					$data = $fn['browserslash']($value);
251 251
 					return \array_merge($data, [
252 252
 						'engine' => 'Gecko',
Please login to merge, or discard this patch.