@@ -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 { |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | return [ |
| 9 | 9 | '{' => [ |
| 10 | 10 | 'match' => 'any', |
| 11 | - 'categories' => function (string $value) : ?array { |
|
| 11 | + 'categories' => function(string $value) : ?array { |
|
| 12 | 12 | $start = \mb_strpos($value, '{'); |
| 13 | 13 | if (($end = \mb_strpos($value, '}', $start)) !== false) { |
| 14 | 14 | $json = \mb_substr($value, $start, $end - $start + 1); |
@@ -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 devices { |
| 6 | 6 | |
| 7 | 7 | public static function get() { |
| 8 | 8 | $fn = [ |
| 9 | - 'ios' => function (string $value, int $i, array $tokens) : array { |
|
| 9 | + 'ios' => function(string $value, int $i, array $tokens) : array { |
|
| 10 | 10 | $version = null; |
| 11 | 11 | $model = null; |
| 12 | 12 | foreach ($tokens AS $item) { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | 'category' => 'console', |
| 38 | 38 | 'vendor' => 'Microsoft', |
| 39 | 39 | ], |
| 40 | - 'playstation' => function (string $value) : array { |
|
| 40 | + 'playstation' => function(string $value) : array { |
|
| 41 | 41 | $parts = \explode(' ', $value); |
| 42 | 42 | if (\str_contains($parts[1], '/')) { |
| 43 | 43 | list($parts[1], $parts[2]) = \explode('/', $parts[1]); |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | ], |
| 260 | 260 | 'SAMSUNG-' => [ |
| 261 | 261 | 'match' => 'start', |
| 262 | - 'categories' => function (string $value) : array { |
|
| 262 | + 'categories' => function(string $value) : array { |
|
| 263 | 263 | $parts = \explode('/', $value, 2); |
| 264 | 264 | return [ |
| 265 | 265 | 'device' => \mb_substr($parts[0], 8), |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | ], |
| 285 | 285 | 'SonyEricsson' => [ |
| 286 | 286 | 'match' => 'start', |
| 287 | - 'categories' => function (string $value) : array { |
|
| 287 | + 'categories' => function(string $value) : array { |
|
| 288 | 288 | $parts = \explode('/', $value, 2); |
| 289 | 289 | return [ |
| 290 | 290 | 'type' => 'human', |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | ], |
| 298 | 298 | 'LGE' => [ |
| 299 | 299 | 'match' => 'exact', |
| 300 | - 'categories' => function (string $value, int $i, array $tokens) : array { |
|
| 300 | + 'categories' => function(string $value, int $i, array $tokens) : array { |
|
| 301 | 301 | $device = $tokens[++$i] ?? null; |
| 302 | 302 | $platformversion = $tokens[++$i] ?? null; |
| 303 | 303 | $build = $tokens[++$i] ?? null; |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | ], |
| 314 | 314 | 'NOKIA' => [ |
| 315 | 315 | 'match' => 'start', |
| 316 | - 'categories' => function (string $value) : array { |
|
| 316 | + 'categories' => function(string $value) : array { |
|
| 317 | 317 | $parts = \explode('/', $value, 2); |
| 318 | 318 | $device = \trim(\mb_substr($parts[0], 5, \str_ends_with($parts[0], ' Build') ? -6 : null)); |
| 319 | 319 | return [ |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | ], |
| 351 | 351 | 'Build/' => [ |
| 352 | 352 | 'match' => 'any', |
| 353 | - 'categories' => function (string $value) : array { |
|
| 353 | + 'categories' => function(string $value) : array { |
|
| 354 | 354 | return self::getDevice($value); |
| 355 | 355 | } |
| 356 | 356 | ], |
@@ -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,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 browsers { |
| 6 | 6 | |
| 7 | 7 | public static function get() { |
| 8 | 8 | $fn = [ |
| 9 | - 'browserslash' => function (string $value) : array { |
|
| 9 | + 'browserslash' => function(string $value) : array { |
|
| 10 | 10 | if (($browser = \mb_strrchr($value, ' ')) !== false) { |
| 11 | 11 | $value = \ltrim($browser); |
| 12 | 12 | } |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | 'browserversion' => $parts[1] ?? null |
| 24 | 24 | ]; |
| 25 | 25 | }, |
| 26 | - 'presto' => function (string $value) : array { |
|
| 26 | + 'presto' => function(string $value) : array { |
|
| 27 | 27 | $parts = \explode('/', $value, 2); |
| 28 | 28 | return [ |
| 29 | 29 | 'type' => 'human', |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | ], |
| 192 | 192 | 'Midori' => [ |
| 193 | 193 | 'match' => 'start', |
| 194 | - 'categories' => function (string $value) : array { |
|
| 194 | + 'categories' => function(string $value) : array { |
|
| 195 | 195 | $parts = \explode('/', $value, 2); |
| 196 | 196 | return [ |
| 197 | 197 | 'browser' => 'Midori', |
@@ -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,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | namespace hexydec\agentzero; |
| 4 | 4 | |
| 5 | 5 | class urls { |
| 6 | 6 | |
| 7 | 7 | public static function get() { |
| 8 | - $fn = function (string $value, int $i, array $tokens) : ?array { |
|
| 8 | + $fn = function(string $value, int $i, array $tokens) : ?array { |
|
| 9 | 9 | if (($start = \stripos($value, 'http://')) === false) { |
| 10 | 10 | if (($start = \stripos($value, 'https://')) === false) { |
| 11 | 11 | $start = \stripos($value, 'www.'); |
@@ -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 @@ 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 config { |
@@ -7,7 +7,7 @@ discard block |
||
| 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 |