Passed
Push — main ( 0009be...03a93c )
by Will
02:49
created
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, int $i, array $tokens) : ?array {
62
+			'map' => function(string $value, int $i, array $tokens) : ?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/devices.php 1 patch
Spacing   +10 added lines, -10 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]);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 			],
251 251
 			'Apple/' => [
252 252
 				'match' => 'start',
253
-				'categories' => function (string $value) : array {
253
+				'categories' => function(string $value) : array {
254 254
 					$value = \mb_substr($value, 6);
255 255
 					$split = \strcspn($value, '0123456789');
256 256
 					$device = \mb_substr($value, 0, $split);
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 			],
335 335
 			'SAMSUNG-' => [
336 336
 				'match' => 'start',
337
-				'categories' => function (string $value) : array {
337
+				'categories' => function(string $value) : array {
338 338
 					$parts = \explode('/', $value, 2);
339 339
 					return [
340 340
 						'type' => 'human',
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 			],
360 360
 			'SonyEricsson' => [
361 361
 				'match' => 'start',
362
-				'categories' => function (string $value) : array {
362
+				'categories' => function(string $value) : array {
363 363
 					$parts = \explode('/', $value, 2);
364 364
 					return [
365 365
 						'type' => 'human',
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 			],
373 373
 			'LGE' => [
374 374
 				'match' => 'exact',
375
-				'categories' => function (string $value, int $i, array $tokens) : array {
375
+				'categories' => function(string $value, int $i, array $tokens) : array {
376 376
 					$device = $tokens[++$i] ?? null;
377 377
 					$platformversion = empty($tokens[++$i]) ? null : \mb_substr(\explode(' ', $tokens[$i])[0], 5);
378 378
 					$build = $tokens[++$i] ?? null;
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 			],
389 389
 			'NOKIA' => [
390 390
 				'match' => 'start',
391
-				'categories' => function (string $value) : array {
391
+				'categories' => function(string $value) : array {
392 392
 					return \array_merge(devices::getDevice($value), [
393 393
 						'type' => 'human',
394 394
 						'category' => 'mobile',
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			],
425 425
 			'ThinkPad' => [
426 426
 				'match' => 'start',
427
-				'categories' => function (string $value, int $i, array $tokens) : array {
427
+				'categories' => function(string $value, int $i, array $tokens) : array {
428 428
 					if (\mb_strpos($tokens[++$i] ?? '', 'Build/') === 0) {
429 429
 						$device = \explode('_', \mb_substr($tokens[$i], 6));
430 430
 					}
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 			],
450 450
 			'x' => [
451 451
 				'match' => 'any',
452
-				'categories' => function (string $value) : ?array {
452
+				'categories' => function(string $value) : ?array {
453 453
 					$parts = \explode('x', $value);
454 454
 					if (!isset($parts[2]) && \is_numeric($parts[0]) && \is_numeric($parts[1])) {
455 455
 						return [
Please login to merge, or discard this patch.