Passed
Push — main ( c4a646...dc1874 )
by Will
02:03
created
src/mappings/platforms.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  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
 class platforms {
6 6
 
7 7
 	public static function get() {
8 8
 		$fn = [
9
-			'platformspace' => function (string $value) : array {
9
+			'platformspace' => function(string $value) : array {
10 10
 				$parts = \explode(' ', $value, 2);
11 11
 				return [
12 12
 					'platform' => $parts[0],
13 13
 					'platformversion' => $parts[1] ?? null
14 14
 				];
15 15
 			},
16
-			'platformlinux' => function (string $value) : array {
16
+			'platformlinux' => function(string $value) : array {
17 17
 				if (!\str_starts_with($value, 'Red Hat/') && ($platform = \mb_strstr($value, ' ', true)) !== false) {
18 18
 					$value = $platform;
19 19
 				}
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 					'platformversion' => isset($parts[1]) && \strspn($parts[1], '0123456789.-_') > 0 ? $parts[1] : null
33 33
 				];
34 34
 			},
35
-			'platformwindows' => function (string $value) : array {
35
+			'platformwindows' => function(string $value) : array {
36 36
 				$mapping = [
37 37
 					'5.0' => '2000',
38 38
 					'5.1' => 'XP',
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			],
70 70
 			'Windows Phone' => [
71 71
 				'match' => 'start',
72
-				'categories' => function (string $value) : array {
72
+				'categories' => function(string $value) : array {
73 73
 					$version = \mb_substr($value, 14);
74 74
 					return [
75 75
 						'type' => 'human',
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 			],
111 111
 			'Mac OS X' => [
112 112
 				'match' => 'any',
113
-				'categories' => function (string $value) : array {
113
+				'categories' => function(string $value) : array {
114 114
 					$version = \str_replace('_', '.', \mb_substr($value, \mb_stripos($value, 'Mac OS X') + 9));
115 115
 					$register = $version && \intval(\explode('.', $version)[1] ?? 0) >= 6 ? 64 : null;
116 116
 					return [
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 			],
134 134
 			'CrOS' => [
135 135
 				'match' => 'start',
136
-				'categories' => function (string $value) : array {
136
+				'categories' => function(string $value) : array {
137 137
 					$parts = \explode(' ', $value);
138 138
 					return [
139 139
 						'type' => 'human',
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 			],
155 155
 			'Tizen' => [
156 156
 				'match' => 'start',
157
-				'categories' => function (string $value) : array {
157
+				'categories' => function(string $value) : array {
158 158
 					$parts = \explode(' ', $value, 2);
159 159
 					return [
160 160
 						'type' => 'human',
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			],
258 258
 			'AmigaOS' => [
259 259
 				'match' => 'any',
260
-				'categories' => function (string $value) : array {
260
+				'categories' => function(string $value) : array {
261 261
 					if (($pos = \mb_stripos($value, 'AmigaOS')) !== false) {
262 262
 						$value = \mb_substr($value, $pos);
263 263
 					}
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 			],
274 274
 			'Fuchsia' => [
275 275
 				'match' => 'exact',
276
-				'categories' => function (string $value, int $i, array $tokens) : array {
276
+				'categories' => function(string $value, int $i, array $tokens) : array {
277 277
 					$os = \explode(' ', $tokens[++$i], 2);
278 278
 					return [
279 279
 						'type' => 'human',
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 			],
287 287
 			'Maemo' => [
288 288
 				'match' => 'exact',
289
-				'categories' => function (string $value, int $i, array $tokens) : array {
289
+				'categories' => function(string $value, int $i, array $tokens) : array {
290 290
 					$os = \explode(' ', $tokens[++$i], 2);
291 291
 					return [
292 292
 						'type' => 'human',
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 			],
309 309
 			'Haiku' => [
310 310
 				'match' => 'any',
311
-				'categories' => function (string $value) : array {
311
+				'categories' => function(string $value) : array {
312 312
 					$parts = \explode('/', $value, 2);
313 313
 					return [
314 314
 						'type' => 'human',
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 			],
322 322
 			'BeOS' => [
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
 			'Android' => [
336 336
 				'match' => 'start',
337
-				'categories' => function (string $value, int $i, array $tokens) : ?array {
337
+				'categories' => function(string $value, int $i, array $tokens) : ?array {
338 338
 					$os = \explode(' ', $value, 3);
339 339
 					$device = empty($tokens[++$i]) ? [] : devices::getDevice($tokens[$i]);
340 340
 					return \array_merge($device, [
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			],
356 356
 			'X11' => [
357 357
 				'match' => 'exact',
358
-				'categories' => function (string $value, int $i, array $tokens) : array {
358
+				'categories' => function(string $value, int $i, array $tokens) : array {
359 359
 					$os = \explode(' ', $tokens[++$i], 2);
360 360
 					return [
361 361
 						'type' => 'human',
Please login to merge, or discard this patch.
src/mappings/languages.php 1 patch
Spacing   +2 added lines, -2 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
 class languages {
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		];
211 211
 		$fn = [
212 212
 			'match' => 'start',
213
-			'categories' => function (string $value) : ?array {
213
+			'categories' => function(string $value) : ?array {
214 214
 				$len = \strlen($value);
215 215
 				if ($len === 2) {
216 216
 					return ['language' => $value];
Please login to merge, or discard this patch.
src/mappings/crawlers.php 1 patch
Spacing   +4 added lines, -4 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
 class crawlers {
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 			'crawler' => fn (string $value) : array => self::getApp($value, ['category' => 'crawler']),
32 32
 			'monitor' => fn (string $value) : array => self::getApp($value, ['category' => 'monitor']),
33 33
 			'scraper' => fn (string $value) : array => self::getApp($value, ['category' => 'scraper']),
34
-			'map' => function (string $value, int $i, array $tokens) : ?array {
34
+			'map' => function(string $value, int $i, array $tokens) : ?array {
35 35
 				if (!\str_contains($value, '://')) { // bot will be in the URL
36 36
 					$parts = \explode('/', $value, 2);
37 37
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 			],
167 167
 			'Pingdom.com' => [
168 168
 				'match' => 'start',
169
-				'categories' => function (string $value) : array {
169
+				'categories' => function(string $value) : array {
170 170
 					$version = \explode('_', \trim($value, '_'));
171 171
 					return [
172 172
 						'type' => 'robot',
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 			],
252 252
 			'Microsoft Office' => [
253 253
 				'match' => 'start',
254
-				'categories' => function (string $value, int $i, array $tokens) : array {
254
+				'categories' => function(string $value, int $i, array $tokens) : array {
255 255
 					$data = [
256 256
 						'type' => 'robot',
257 257
 						'category' => 'feed'
Please login to merge, or discard this patch.
src/mappings/apps.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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
 class apps {
6 6
 
7 7
 	public static function get() {
8 8
 		$fn = [
9
-			'appslash' => function (string $value) : ?array {
9
+			'appslash' => function(string $value) : ?array {
10 10
 				if (!\str_starts_with($value, 'AppleWebKit') && !\str_contains($value, '://')) {
11 11
 					$parts = \explode('/', $value, 2);
12 12
 					return [
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 			],
25 25
 			'Instagram' => [
26 26
 				'match' => 'any',
27
-				'categories' => function (string $value, int $i, array $tokens) : array {
27
+				'categories' => function(string $value, int $i, array $tokens) : array {
28 28
 					$data = [
29 29
 						'app' => 'Instagram',
30 30
 						'appversion' => \explode(' ', $value, 3)[1] ?? null
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 			// special parser for Facebook app because it is completely different to any other
65 65
 			'FBAN/' => [
66 66
 				'match' => 'start',
67
-				'categories' => function (string $value) : array {
67
+				'categories' => function(string $value) : array {
68 68
 					$map = [
69 69
 						'FBAN/MessengerLiteForiOS' => [
70 70
 							'type' => 'human',
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 			],
138 138
 			'FBDM/' => [
139 139
 				'match' => 'start',
140
-				'categories' => function (string $value) : array {
140
+				'categories' => function(string $value) : array {
141 141
 					$data = [];
142 142
 					foreach (\explode(',', \trim(\mb_substr($value, 5), '{}')) AS $item) {
143 143
 						$parts = \explode('=', $item);
Please login to merge, or discard this patch.