Passed
Push — main ( 274053...e55150 )
by Will
02:54
created
src/mappings/devices.php 1 patch
Spacing   +13 added lines, -13 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
-			'ios' => function (string $value, int $i, array $tokens) : array {
17
+			'ios' => function(string $value, int $i, array $tokens) : array {
18 18
 				$version = null;
19 19
 				$model = null;
20 20
 				foreach ($tokens AS $item) {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 				'device' => 'Xbox',
47 47
 				'model' => ($model = \mb_substr($value, 5)) === '' ? null : $model
48 48
 			],
49
-			'playstation' => function (string $value) : array {
49
+			'playstation' => function(string $value) : array {
50 50
 				$parts = \explode(' ', $value);
51 51
 				if (\str_contains($parts[1], '/')) {
52 52
 					list($parts[1], $parts[2]) = \explode('/', $parts[1]);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 					'bits' => 64
70 70
 				];
71 71
 			},
72
-			'firetablet' => function (string $value) : ?array {
72
+			'firetablet' => function(string $value) : ?array {
73 73
 				$model = \explode(' ', $value)[0];
74 74
 				if (\ctype_alpha($model) && \mb_strlen($model) <= 7) {
75 75
 					return [
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			],
210 210
 			'Apple/' => [
211 211
 				'match' => 'start',
212
-				'categories' => function (string $value) : array {
212
+				'categories' => function(string $value) : array {
213 213
 					$value = \mb_substr($value, 6);
214 214
 					$split = \strcspn($value, '0123456789');
215 215
 					$device = \mb_substr($value, 0, $split);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 			],
286 286
 			'SAMSUNG-' => [
287 287
 				'match' => 'start',
288
-				'categories' => function (string $value) : array {
288
+				'categories' => function(string $value) : array {
289 289
 					$parts = \explode('/', $value, 2);
290 290
 					return [
291 291
 						'type' => 'human',
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 			],
305 305
 			'SM-' => [
306 306
 				'match' => 'start',
307
-				'categories' => function (string $value) : array {
307
+				'categories' => function(string $value) : array {
308 308
 					$parts = \explode('.', \explode(' ', $value)[0]);
309 309
 					return [
310 310
 						'vendor' => 'Samsung',
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 			],
322 322
 			'SonyEricsson' => [
323 323
 				'match' => 'start',
324
-				'categories' => function (string $value) : array {
324
+				'categories' => function(string $value) : array {
325 325
 					$parts = \explode('/', $value, 2);
326 326
 					return [
327 327
 						'type' => 'human',
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 			],
335 335
 			'LGE' => [
336 336
 				'match' => 'exact',
337
-				'categories' => function (string $value, int $i, array $tokens) : array {
337
+				'categories' => function(string $value, int $i, array $tokens) : array {
338 338
 					$device = $tokens[++$i] ?? null;
339 339
 					$platformversion = empty($tokens[++$i]) ? null : \mb_substr(\explode(' ', $tokens[$i])[0], 5);
340 340
 					$build = $tokens[++$i] ?? null;
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 			],
351 351
 			'NOKIA' => [
352 352
 				'match' => 'start',
353
-				'categories' => function (string $value) : array {
353
+				'categories' => function(string $value) : array {
354 354
 					return \array_merge(devices::getDevice($value), [
355 355
 						'type' => 'human',
356 356
 						'category' => 'mobile',
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			],
387 387
 			'ThinkPad' => [
388 388
 				'match' => 'start',
389
-				'categories' => function (string $value, int $i, array $tokens) : array {
389
+				'categories' => function(string $value, int $i, array $tokens) : array {
390 390
 					if (\mb_strpos($tokens[++$i] ?? '', 'Build/') === 0) {
391 391
 						$device = \explode('_', \mb_substr($tokens[$i], 6));
392 392
 					}
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 			],
402 402
 			'BlackBerry' => [
403 403
 				'match' => 'start',
404
-				'categories' => function (string $value) : array {
404
+				'categories' => function(string $value) : array {
405 405
 					$parts = \explode('/', $value);
406 406
 					return [
407 407
 						'type' => 'human',
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 			],
426 426
 			'x' => [
427 427
 				'match' => 'any',
428
-				'categories' => function (string $value) : ?array {
428
+				'categories' => function(string $value) : ?array {
429 429
 					$parts = \explode('x', $value);
430 430
 					if (!isset($parts[2]) && \is_numeric($parts[0]) && \is_numeric($parts[1])) {
431 431
 						return [
Please login to merge, or discard this patch.
src/mappings/crawlers.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
 /**
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 			'ads' => fn (string $value) : array => self::getApp($value, ['category' => 'ads']),
44 44
 			'validator' => fn (string $value) : array => self::getApp($value, ['category' => 'validator']),
45 45
 			'feed' => fn (string $value) : array => self::getApp($value, ['category' => 'feed']),
46
-			'crawler' => function (string $value) : array {
46
+			'crawler' => function(string $value) : array {
47 47
 				$parts = \explode('/', $value, 2);
48 48
 				$map = [
49 49
 					'baiduspider' => 'search',
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			},
60 60
 			'monitor' => fn (string $value) : array => self::getApp($value, ['category' => 'monitor']),
61 61
 			'scraper' => fn (string $value) : array => self::getApp($value, ['category' => 'scraper']),
62
-			'map' => function (string $value) : ?array {
62
+			'map' => function(string $value) : ?array {
63 63
 				if (!\str_contains($value, '://') && \strcasecmp('Cubot', $value) !== 0 && \strcasecmp('Power bot', $value) !== 0) { // bot will be in the URL
64 64
 					$parts = \explode('/', $value, 2);
65 65
 					$category = [
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 			],
229 229
 			'Pingdom.com' => [
230 230
 				'match' => 'start',
231
-				'categories' => function (string $value) : array {
231
+				'categories' => function(string $value) : array {
232 232
 					$version = \explode('_', \trim($value, '_'));
233 233
 					return [
234 234
 						'type' => 'robot',
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 			],
314 314
 			'Microsoft Office' => [
315 315
 				'match' => 'start',
316
-				'categories' => function (string $value, int $i, array $tokens) : array {
316
+				'categories' => function(string $value, int $i, array $tokens) : array {
317 317
 					$data = [
318 318
 						'type' => 'human'
319 319
 					];
Please login to merge, or discard this patch.
src/mappings/apps.php 1 patch
Spacing   +9 added lines, -9 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
-			'appslash' => function (string $value, int $i, array $tokens, string $match) : array {
17
+			'appslash' => function(string $value, int $i, array $tokens, string $match) : array {
18 18
 				if (\mb_stripos($value, 'AppleWebKit') !== 0 && !\str_contains($value, '://')) {
19 19
 					$parts = \explode('/', $value, 4);
20 20
 					$offset = isset($parts[2]) ? 1 : 0;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 				}
46 46
 				return [];
47 47
 			},
48
-			'langslash' => function (string $value) : array {
48
+			'langslash' => function(string $value) : array {
49 49
 				$parts = \explode('-', \str_replace('_', '-', \explode('/', $value, 2)[1]), 4);
50 50
 				$suffix = $parts[2] ?? $parts[1] ?? null;
51 51
 				return [
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		return [
57 57
 			'OcIdWebView' => [
58 58
 				'match' => 'exact',
59
-				'categories' => function (string $value) : array {
59
+				'categories' => function(string $value) : array {
60 60
 					$data = [
61 61
 						'app' => $value
62 62
 					];
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 			],
66 66
 			'com.google.GoogleMobile/' => [
67 67
 				'match' => 'start',
68
-				'categories' => function (string $value, int $i, array $tokens, string $match) use ($fn) : array {
68
+				'categories' => function(string $value, int $i, array $tokens, string $match) use ($fn) : array {
69 69
 					return \array_merge($fn['appslash']($value, $i, $tokens, $match), [
70 70
 						'category' => 'mobile'
71 71
 					]);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			],
78 78
 			'Instagram' => [
79 79
 				'match' => 'any',
80
-				'categories' => function (string $value, int $i, array $tokens) : array {
80
+				'categories' => function(string $value, int $i, array $tokens) : array {
81 81
 					$parts = \explode(' ', $value, 4);
82 82
 					$data = [
83 83
 						'type' => 'human',
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 			// special parser for Facebook app because it is completely different to any other
213 213
 			'FBAN/' => [
214 214
 				'match' => 'any',
215
-				'categories' => function (string $value) : array {
215
+				'categories' => function(string $value) : array {
216 216
 					$map = [
217 217
 						'FBAN/MessengerLiteForiOS' => [
218 218
 							'type' => 'human',
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 			],
288 288
 			'FBDM/' => [
289 289
 				'match' => 'start',
290
-				'categories' => function (string $value) : array {
290
+				'categories' => function(string $value) : array {
291 291
 					$data = [];
292 292
 					foreach (\explode(',', \trim(\mb_substr($value, 5), '{}')) AS $item) {
293 293
 						$parts = \explode('=', $item);
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 			],
334 334
 			'isDarkMode/' => [
335 335
 				'match' => 'start',
336
-				'categories' => function (string $value) : array {
336
+				'categories' => function(string $value) : array {
337 337
 					$mode = \mb_substr($value, 11);
338 338
 					return [
339 339
 						'darkmode' => \in_array($mode, ['0', '1'], true) ? \boolval($mode) : null
Please login to merge, or discard this patch.