Skip to content
Permalink
Browse files

improve mapping and detection (#157)

* improve mapping and detection

* add empty line

* improve mapping

* update mappings

* fix coding style
  • Loading branch information...
mimmi20 authored and jaydiablo committed Sep 20, 2019
1 parent 42c69c9 commit aeb0774522f68cf73c252e2a08c2e6c7b2d8a0b9

Large diffs are not rendered by default.

@@ -60,7 +60,7 @@
'version' => ($r->Platform_Version === '0.0' ? null : $r->Platform_Version),
],
'device' => [
'name' => $r->Device_Code_Name,
'name' => $r->Device_Name,
'brand' => $r->Device_Brand_Name,
'type' => $r->Device_Type,
'ismobile' => $r->isMobileDevice ? true : false,
@@ -59,7 +59,7 @@
'version' => ($r->platform_version === '0.0' ? null : $r->platform_version),
],
'device' => [
'name' => $r->device_code_name,
'name' => $r->device_name,
'brand' => $r->device_brand_name,
'type' => $r->device_type,
'ismobile' => $r->ismobiledevice ? true : false,
@@ -60,7 +60,7 @@
'version' => ($r->platform_version === '0.0' ? null : $r->platform_version),
],
'device' => [
'name' => $r->device_code_name,
'name' => $r->device_name,
'brand' => $r->device_brand_name,
'type' => $r->device_type,
'ismobile' => $r->ismobiledevice ? true : false,
@@ -61,7 +61,7 @@
'version' => $r->getOs()->getVersion()->getVersion(),
],
'device' => [
'name' => $r->getDevice()->getDeviceName(),
'name' => $r->getDevice()->getMarketingName(),
'brand' => $r->getDevice()->getBrand()->getBrandName(),
'type' => $r->getDevice()->getType()->getName(),
'ismobile' => $r->getDevice()->getType()->isMobile() ? 'true' : 'false',
@@ -84,4 +84,4 @@
'init_time' => $initTime,
'memory_used' => $memory,
'version' => $package->getVersion(),
], JSON_UNESCAPED_SLASHES);
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
@@ -61,11 +61,11 @@
'parsed' => [
'browser' => [
'name' => $clientInfo['name'] ?? null,
'version' => $clientInfo['version'] ?? null,
'version' => (!empty($clientInfo['version']) ? $clientInfo['version'] : null),
],
'platform' => [
'name' => $osInfo['name'] ?? null,
'version' => $osInfo['version'] ?? null,
'version' => (!empty($osInfo['version']) ? $osInfo['version'] : null),
],
'device' => [
'name' => $model ? $model : null,
@@ -2,6 +2,10 @@
"require": {
"ua-parser/uap-php": "^3.4.6",
"thadafinser/package-info": "^1.0",
"mimmi20/json-class": "~2.0.1"
"mimmi20/json-class": "~2.0.1",
"symfony/yaml": "^4.2",
"symfony/filesystem": "^4.2",
"symfony/finder": "^4.2",
"symfony/console": "^4.2"
}
}
@@ -53,7 +53,7 @@
],
'platform' => [
'name' => $r->os->family,
'version' => $r->ua->toVersion(),
'version' => $r->os->toVersion() === '0' ? null : $r->os->toVersion(),
],
'device' => [
'name' => $r->device->model,
@@ -58,7 +58,7 @@
'version' => ($data['properties']['Platform_Version'] === '0.0' ? null : $data['properties']['Platform_Version']),
],
'device' => [
'name' => $data['properties']['Device_Code_Name'],
'name' => $data['properties']['Device_Name'],
'brand' => $data['properties']['Device_Brand_Name'],
'type' => $data['properties']['Device_Type'],
'ismobile' => $isMobile,
@@ -79,7 +79,7 @@
'version' => ($osVersion === '0.0.0' ? null : $osVersion),
],
'device' => [
'name' => $expectedResult->getDevice()->getDeviceName(),
'name' => $expectedResult->getDevice()->getMarketingName(),
'brand' => $expectedResult->getDevice()->getBrand()->getBrandName(),
'type' => $expectedResult->getDevice()->getType()->getName(),
'ismobile' => $expectedResult->getDevice()->getType()->isMobile(),
@@ -94,4 +94,4 @@
echo json_encode([
'tests' => $allTests,
'version' => $package->getVersion(),
]);
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

0 comments on commit aeb0774

Please sign in to comment.
You can’t perform that action at this time.