@@ -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 languages { |
@@ -210,7 +210,7 @@ discard block |
||
| 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]; |
@@ -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 { |
@@ -31,7 +31,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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' |
@@ -1,12 +1,12 @@ 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 { |
| 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 |
||
| 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 |
||
| 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 |
||
| 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); |