@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class architectures { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class engines { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class categories { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | -\spl_autoload_register(function (string $class) : void { |
|
4 | +\spl_autoload_register(function(string $class) : void { |
|
5 | 5 | $classes = [ |
6 | 6 | 'hexydec\\agentzero\\apps' => __DIR__.'/mappings/apps.php', |
7 | 7 | 'hexydec\\agentzero\\architectures' => __DIR__.'/mappings/architectures.php', |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class agentzero { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class props { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class apps { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public static function get() : array { |
13 | 13 | $fn = [ |
14 | - 'appslash' => function (string $value, int $i, array $tokens, string $match) : array { |
|
14 | + 'appslash' => function(string $value, int $i, array $tokens, string $match) : array { |
|
15 | 15 | if (\mb_stripos($value, 'AppleWebKit') !== 0 && !\str_contains($value, '://')) { |
16 | 16 | $parts = \explode('/', $value, 4); |
17 | 17 | $offset = isset($parts[2]) ? 1 : 0; |
@@ -45,7 +45,7 @@ discard block |
||
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 [ |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | } |
55 | 55 | ]; |
56 | 56 | return [ |
57 | - 'com.google.GoogleMobile/' => new props('start', function (string $value, int $i, array $tokens, string $match) use ($fn) : array { |
|
57 | + 'com.google.GoogleMobile/' => new props('start', function(string $value, int $i, array $tokens, string $match) use ($fn) : array { |
|
58 | 58 | return \array_merge($fn['appslash']($value, $i, $tokens, $match), [ |
59 | 59 | 'category' => 'mobile' |
60 | 60 | ]); |
61 | 61 | }), |
62 | 62 | 'com.google.' => new props('start', $fn['appslash']), |
63 | - 'OcIdWebView' => new props('exact', function (string $value) : array { |
|
63 | + 'OcIdWebView' => new props('exact', function(string $value) : array { |
|
64 | 64 | $data = [ |
65 | 65 | 'app' => 'Google App Web View', |
66 | 66 | 'appname' => $value |
67 | 67 | ]; |
68 | 68 | return $data; |
69 | 69 | }), |
70 | - 'Instagram' => new props('any', function (string $value, int $i, array $tokens) : array { |
|
70 | + 'Instagram' => new props('any', function(string $value, int $i, array $tokens) : array { |
|
71 | 71 | $parts = \explode(' ', $value, 4); |
72 | 72 | $data = [ |
73 | 73 | 'type' => 'human', |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | 'Viber/' => new props('start', $fn['appslash']), |
161 | 161 | |
162 | 162 | // special parser for Facebook app because it is completely different to any other |
163 | - 'FBAN/' => new props('any', function (string $value) : array { |
|
163 | + 'FBAN/' => new props('any', function(string $value) : array { |
|
164 | 164 | $map = [ |
165 | 165 | 'FBAN/MessengerLiteForiOS' => [ |
166 | 166 | 'type' => 'human', |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | 'model' => \mb_substr($value, 5) |
217 | 217 | ]), |
218 | 218 | 'FBLC/' => new props('start', $fn['langslash']), |
219 | - 'FBDM/' => new props('start', function (string $value) : array { |
|
219 | + 'FBDM/' => new props('start', function(string $value) : array { |
|
220 | 220 | $data = []; |
221 | 221 | foreach (\explode(',', \trim(\mb_substr($value, 5), '{}')) AS $item) { |
222 | 222 | $parts = \explode('=', $item); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | 'FBSV' => new props('start', fn (string $value) : array => [ |
245 | 245 | 'platformversion' => \mb_substr($value, 5) |
246 | 246 | ]), |
247 | - 'isDarkMode/' => new props('start', function (string $value) : array { |
|
247 | + 'isDarkMode/' => new props('start', function(string $value) : array { |
|
248 | 248 | $mode = \mb_substr($value, 11); |
249 | 249 | return [ |
250 | 250 | 'darkmode' => \in_array($mode, ['0', '1'], true) ? \boolval($mode) : null |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | 'NetType/' => new props('start', fn (string $value) : array => [ |
255 | 255 | 'nettype' => \mb_convert_case(\mb_substr($value, 8), MB_CASE_UPPER) |
256 | 256 | ]), |
257 | - 'Microsoft Office' => new props('start', function (string $value, int $i, array $tokens) : array { |
|
257 | + 'Microsoft Office' => new props('start', function(string $value, int $i, array $tokens) : array { |
|
258 | 258 | $data = [ |
259 | 259 | 'type' => 'human' |
260 | 260 | ]; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class crawlers { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | 'category' => 'feed' |
49 | 49 | ] |
50 | 50 | )), |
51 | - 'crawler' => function (string $value) : array { |
|
51 | + 'crawler' => function(string $value) : array { |
|
52 | 52 | $parts = \explode('/', $value, 2); |
53 | 53 | $map = [ |
54 | 54 | 'baiduspider' => 'search', |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | }, |
65 | 65 | 'monitor' => fn (string $value) : array => self::getApp($value, ['category' => 'monitor']), |
66 | 66 | 'scraper' => fn (string $value) : array => self::getApp($value, ['category' => 'scraper']), |
67 | - 'map' => function (string $value) : ?array { |
|
67 | + 'map' => function(string $value) : ?array { |
|
68 | 68 | if (!\str_contains($value, '://') && \strcasecmp('Cubot', $value) !== 0 && \strcasecmp('Power bot', $value) !== 0) { // bot will be in the URL |
69 | 69 | $parts = \explode('/', $value, 2); |
70 | 70 | $category = [ |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | 'Uptime/' => new props('start', $fn['monitor']), |
283 | 283 | 'HostTracker/' => new props('start', $fn['monitor']), |
284 | 284 | 'NCSC Web Check [email protected]' => new props('exact', $fn['map']), |
285 | - 'Pingdom.com' => new props('start', function (string $value) : array { |
|
285 | + 'Pingdom.com' => new props('start', function(string $value) : array { |
|
286 | 286 | $version = \explode('_', \trim($value, '_')); |
287 | 287 | return [ |
288 | 288 | 'type' => 'robot', |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace hexydec\agentzero; |
4 | 4 | |
5 | 5 | class other { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public static function get() : array { |
13 | 13 | return [ |
14 | - '{' => new props('any', function (string $value) : ?array { |
|
14 | + '{' => new props('any', function(string $value) : ?array { |
|
15 | 15 | if (($start = \mb_strpos($value, '{')) === false) { |
16 | 16 | |
17 | 17 | } elseif (($end = \mb_strpos($value, '}', $start)) !== false) { |