Passed
Push — main ( 9a8bf5...c4a646 )
by Will
03:55 queued 01:57
created
src/config.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 config {
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	/**
8 8
 	 * @var ?array $config An array of configuration values
9 9
 	 */
10
-	protected static ?array $config = null;
10
+	protected static ? array $config = null;
11 11
 
12 12
 	/**
13 13
 	 * Retrieves the configuration
Please login to merge, or discard this patch.
src/agentzero.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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 agentzero {
Please login to merge, or discard this patch.
src/mappings/crawlers.php 1 patch
Spacing   +3 added lines, -3 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
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			],
161 161
 			'Pingdom.com' => [
162 162
 				'match' => 'start',
163
-				'categories' => function (string $value) : array {
163
+				'categories' => function(string $value) : array {
164 164
 					$version = \explode('_', \trim($value, '_'));
165 165
 					return [
166 166
 						'type' => 'robot',
Please login to merge, or discard this patch.
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.