Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-10-08 09:31:49 +0400
committermattab <matthieu.aubry@gmail.com>2013-10-08 09:31:49 +0400
commit84eba85074891bfa6a718ae413a1d87ced4f28ca (patch)
tree6df358670aba14da2883dd68434b326edc6a50fe /plugins/DevicesDetection
parent1fa8da9b963e99e08c829fe6491e8ccf2d1054e2 (diff)
Applying phpstorm code style PSR refs #3771
Diffstat (limited to 'plugins/DevicesDetection')
-rw-r--r--plugins/DevicesDetection/DevicesDetection.php24
-rw-r--r--plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php218
-rw-r--r--plugins/DevicesDetection/functions.php13
3 files changed, 127 insertions, 128 deletions
diff --git a/plugins/DevicesDetection/DevicesDetection.php b/plugins/DevicesDetection/DevicesDetection.php
index 9fe65c7951..a2f2c60de3 100644
--- a/plugins/DevicesDetection/DevicesDetection.php
+++ b/plugins/DevicesDetection/DevicesDetection.php
@@ -13,8 +13,8 @@ namespace Piwik\Plugins\DevicesDetection;
use Exception;
use Piwik\ArchiveProcessor;
-use Piwik\Common;
+use Piwik\Common;
use Piwik\Config;
use Piwik\Db;
use Piwik\WidgetsList;
@@ -335,9 +335,9 @@ class DevicesDetection extends \Piwik\Plugin
return array(
'show_search' => false,
'show_exclude_low_population' => false,
- 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelSystemFamily")),
- 'title' => Piwik_Translate('DevicesDetection_OperatingSystemFamilies'),
- 'related_reports' => $this->getOsRelatedReports()
+ 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelSystemFamily")),
+ 'title' => Piwik_Translate('DevicesDetection_OperatingSystemFamilies'),
+ 'related_reports' => $this->getOsRelatedReports()
);
}
@@ -346,9 +346,9 @@ class DevicesDetection extends \Piwik\Plugin
return array(
'show_search' => false,
'show_exclude_low_population' => false,
- 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelSystemVersion")),
- 'title' => Piwik_Translate('DevicesDetection_OperatingSystemVersions'),
- 'related_reports' => $this->getOsRelatedReports()
+ 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelSystemVersion")),
+ 'title' => Piwik_Translate('DevicesDetection_OperatingSystemVersions'),
+ 'related_reports' => $this->getOsRelatedReports()
);
}
@@ -357,9 +357,9 @@ class DevicesDetection extends \Piwik\Plugin
return array(
'show_search' => false,
'show_exclude_low_population' => false,
- 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelBrowserFamily")),
- 'title' => Piwik_Translate('DevicesDetection_BrowsersFamily'),
- 'related_reports' => $this->getBrowserRelatedReports()
+ 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelBrowserFamily")),
+ 'title' => Piwik_Translate('DevicesDetection_BrowsersFamily'),
+ 'related_reports' => $this->getBrowserRelatedReports()
);
}
@@ -368,8 +368,8 @@ class DevicesDetection extends \Piwik\Plugin
return array(
'show_search' => false,
'show_exclude_low_population' => false,
- 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelBrowserVersion")),
- 'related_reports' => $this->getBrowserRelatedReports()
+ 'translations' => array('label' => Piwik_Translate("DevicesDetection_dataTableLabelBrowserVersion")),
+ 'related_reports' => $this->getBrowserRelatedReports()
);
}
diff --git a/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php b/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php
index a8ec8e2204..aea7f6bfc1 100644
--- a/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php
+++ b/plugins/DevicesDetection/UserAgentParserEnhanced/UserAgentParserEnhanced.php
@@ -10,11 +10,11 @@
* @package DevicesDetection
*/
//yml parser
-require_once(PIWIK_INCLUDE_PATH.'/libs/spyc.php');
+require_once(PIWIK_INCLUDE_PATH . '/libs/spyc.php');
class UserAgentParserEnhanced
{
- public static $deviceTypes = array( 'desktop', 'smartphone', 'tablet', 'feature phone', 'console', 'tv', 'car browser' );
+ public static $deviceTypes = array('desktop', 'smartphone', 'tablet', 'feature phone', 'console', 'tv', 'car browser');
public static $deviceBrands = array(
'AC' => 'Acer',
@@ -124,118 +124,118 @@ class UserAgentParserEnhanced
'ZT' => 'ZTE',
);
public static $osShorts = array(
- 'AIX' => 'AIX',
- 'Android' => 'AND',
- 'Apple TV' => 'ATV',
- 'Arch Linux' => 'ARL',
- 'BackTrack' => 'BTR',
- 'Bada' => 'SBA',
- 'BlackBerry OS' => 'BLB',
+ 'AIX' => 'AIX',
+ 'Android' => 'AND',
+ 'Apple TV' => 'ATV',
+ 'Arch Linux' => 'ARL',
+ 'BackTrack' => 'BTR',
+ 'Bada' => 'SBA',
+ 'BlackBerry OS' => 'BLB',
'BlackBerry Tablet OS' => 'QNX',
- 'Bot' => 'BOT',
- 'Brew' => 'BMP',
- 'CentOS' => 'CES',
- 'Chrome OS' => 'COS',
- 'Debian' => 'DEB',
- 'DragonFly' => 'DFB',
- 'Fedora' => 'FED',
- 'Firefox OS' => 'FOS',
- 'FreeBSD' => 'BSD',
- 'Gentoo' => 'GNT',
- 'Google TV' => 'GTV',
- 'HP-UX' => 'HPX',
- 'IRIX' => 'IRI',
- 'Knoppix' => 'KNO',
- 'Kubuntu' => 'KBT',
- 'Linux' => 'LIN',
- 'Lubuntu' => 'LBT',
- 'Mac' => 'MAC',
- 'Mandriva' => 'MDR',
- 'MeeGo' => 'SMG',
- 'Mint' => 'MIN',
- 'NetBSD' => 'NBS',
- 'Nintendo' => 'WII',
- 'Nintendo Mobile' => 'NDS',
- 'OS/2' => 'OS2',
- 'OSF1' => 'T64',
- 'OpenBSD' => 'OBS',
- 'PlayStation' => 'PSP',
- 'PlayStation 3' => 'PS3',
- 'Presto' => 'PRS',
- 'Puppy' => 'PPY',
- 'Red Hat' => 'RHT',
- 'SUSE' => 'SSE',
- 'Slackware' => 'SLW',
- 'Solaris' => 'SOS',
- 'Syllable' => 'SYL',
- 'Symbian' => 'SYM',
- 'Symbian OS' => 'SYS',
+ 'Bot' => 'BOT',
+ 'Brew' => 'BMP',
+ 'CentOS' => 'CES',
+ 'Chrome OS' => 'COS',
+ 'Debian' => 'DEB',
+ 'DragonFly' => 'DFB',
+ 'Fedora' => 'FED',
+ 'Firefox OS' => 'FOS',
+ 'FreeBSD' => 'BSD',
+ 'Gentoo' => 'GNT',
+ 'Google TV' => 'GTV',
+ 'HP-UX' => 'HPX',
+ 'IRIX' => 'IRI',
+ 'Knoppix' => 'KNO',
+ 'Kubuntu' => 'KBT',
+ 'Linux' => 'LIN',
+ 'Lubuntu' => 'LBT',
+ 'Mac' => 'MAC',
+ 'Mandriva' => 'MDR',
+ 'MeeGo' => 'SMG',
+ 'Mint' => 'MIN',
+ 'NetBSD' => 'NBS',
+ 'Nintendo' => 'WII',
+ 'Nintendo Mobile' => 'NDS',
+ 'OS/2' => 'OS2',
+ 'OSF1' => 'T64',
+ 'OpenBSD' => 'OBS',
+ 'PlayStation' => 'PSP',
+ 'PlayStation 3' => 'PS3',
+ 'Presto' => 'PRS',
+ 'Puppy' => 'PPY',
+ 'Red Hat' => 'RHT',
+ 'SUSE' => 'SSE',
+ 'Slackware' => 'SLW',
+ 'Solaris' => 'SOS',
+ 'Syllable' => 'SYL',
+ 'Symbian' => 'SYM',
+ 'Symbian OS' => 'SYS',
'Symbian OS Series 40' => 'S40',
'Symbian OS Series 60' => 'S60',
- 'Symbian^3' => 'SY3',
- 'Talkatone' => 'TKT',
- 'Tizen' => 'TIZ',
- 'Ubuntu' => 'UBT',
- 'WebTV' => 'WTV',
- 'WinWAP' => 'WWP',
- 'Windows' => 'WIN',
- 'Windows 2000' => 'W2K',
- 'Windows 3.1' => 'W31',
- 'Windows 7' => 'WI7',
- 'Windows 8' => 'WI8',
- 'Windows 95' => 'W95',
- 'Windows 98' => 'W98',
- 'Windows CE' => 'WCE',
- 'Windows ME' => 'WME',
- 'Windows Mobile' => 'WMO',
- 'Windows NT' => 'WNT',
- 'Windows Phone' => 'WPH',
- 'Windows RT' => 'WRT',
- 'Windows Server 2003' => 'WS3',
- 'Windows Vista' => 'WVI',
- 'Windows XP' => 'WXP',
- 'Xbox' => 'XBX',
- 'Xubuntu' => 'XBT',
- 'YunOs' => 'YNS',
- 'iOS' => 'IOS',
- 'palmOS' => 'POS',
- 'webOS' => 'WOS'
+ 'Symbian^3' => 'SY3',
+ 'Talkatone' => 'TKT',
+ 'Tizen' => 'TIZ',
+ 'Ubuntu' => 'UBT',
+ 'WebTV' => 'WTV',
+ 'WinWAP' => 'WWP',
+ 'Windows' => 'WIN',
+ 'Windows 2000' => 'W2K',
+ 'Windows 3.1' => 'W31',
+ 'Windows 7' => 'WI7',
+ 'Windows 8' => 'WI8',
+ 'Windows 95' => 'W95',
+ 'Windows 98' => 'W98',
+ 'Windows CE' => 'WCE',
+ 'Windows ME' => 'WME',
+ 'Windows Mobile' => 'WMO',
+ 'Windows NT' => 'WNT',
+ 'Windows Phone' => 'WPH',
+ 'Windows RT' => 'WRT',
+ 'Windows Server 2003' => 'WS3',
+ 'Windows Vista' => 'WVI',
+ 'Windows XP' => 'WXP',
+ 'Xbox' => 'XBX',
+ 'Xubuntu' => 'XBT',
+ 'YunOs' => 'YNS',
+ 'iOS' => 'IOS',
+ 'palmOS' => 'POS',
+ 'webOS' => 'WOS'
);
protected static $desktopOsArray = array('IBM', 'Linux', 'Mac', 'Unix', 'Windows');
public static $osFamilies = array(
- 'Android' => array('AND'),
- 'Apple TV' => array('ATV'),
- 'BlackBerry' => array('BLB'),
- 'Bot' => array('BOT'),
- 'Brew' => array('BMP'),
- 'Chrome OS' => array('COS'),
- 'Firefox OS' => array('FOS'),
- 'Gaming Console' => array('WII', 'PS3'),
- 'Google TV' => array('GTV'),
- 'IBM' => array('OS2'),
- 'iOS' => array('IOS'),
- 'Linux' => array('LIN', 'ARL', 'DEB', 'KNO', 'MIN', 'UBT', 'KBT', 'XBT', 'LBT', 'FED', 'RHT', 'MDR', 'GNT', 'SLW', 'SSE', 'PPY', 'CES', 'BTR', 'YNS', 'PRS'),
- 'Mac' => array('MAC'),
+ 'Android' => array('AND'),
+ 'Apple TV' => array('ATV'),
+ 'BlackBerry' => array('BLB'),
+ 'Bot' => array('BOT'),
+ 'Brew' => array('BMP'),
+ 'Chrome OS' => array('COS'),
+ 'Firefox OS' => array('FOS'),
+ 'Gaming Console' => array('WII', 'PS3'),
+ 'Google TV' => array('GTV'),
+ 'IBM' => array('OS2'),
+ 'iOS' => array('IOS'),
+ 'Linux' => array('LIN', 'ARL', 'DEB', 'KNO', 'MIN', 'UBT', 'KBT', 'XBT', 'LBT', 'FED', 'RHT', 'MDR', 'GNT', 'SLW', 'SSE', 'PPY', 'CES', 'BTR', 'YNS', 'PRS'),
+ 'Mac' => array('MAC'),
'Mobile Gaming Console' => array('PSP', 'NDS', 'XBX'),
- 'Other Mobile' => array('WOS', 'POS', 'QNX', 'SBA', 'TIZ'),
- 'Simulator' => array('TKT', 'WWP'),
- 'Symbian' => array('SYM', 'SYS', 'SY3', 'S60', 'S40', 'SMG'),
- 'Unix' => array('SOS', 'AIX', 'HPX', 'BSD', 'NBS', 'OBS', 'DFB', 'SYL', 'IRI', 'T64'),
- 'WebTV' => array('WTV'),
- 'Windows' => array('WI8', 'WI7', 'WVI', 'WS3', 'WXP', 'W2K', 'WNT', 'WME', 'W98', 'W95', 'WRT', 'W31', 'WIN'),
- 'Windows Mobile' => array('WPH', 'WMO', 'WCE')
+ 'Other Mobile' => array('WOS', 'POS', 'QNX', 'SBA', 'TIZ'),
+ 'Simulator' => array('TKT', 'WWP'),
+ 'Symbian' => array('SYM', 'SYS', 'SY3', 'S60', 'S40', 'SMG'),
+ 'Unix' => array('SOS', 'AIX', 'HPX', 'BSD', 'NBS', 'OBS', 'DFB', 'SYL', 'IRI', 'T64'),
+ 'WebTV' => array('WTV'),
+ 'Windows' => array('WI8', 'WI7', 'WVI', 'WS3', 'WXP', 'W2K', 'WNT', 'WME', 'W98', 'W95', 'WRT', 'W31', 'WIN'),
+ 'Windows Mobile' => array('WPH', 'WMO', 'WCE')
);
public static $browserFamilies = array(
- 'Android Browser' => array('AN'),
+ 'Android Browser' => array('AN'),
'BlackBerry Browser' => array('BB'),
- 'Chrome' => array('CH', 'CM', 'CI', 'CF', 'CR', 'RM'),
- 'Firefox' => array('FF', 'FE', 'SX', 'FB', 'PX', 'MB'),
- 'Internet Explorer' => array('IE', 'IM'),
- 'Konqueror' => array('KO'),
- 'NetFront' => array('NF'),
- 'Nokia Browser' => array('NB'),
- 'Opera' => array('OP', 'OM', 'OI'),
- 'Safari' => array('SF', 'MF')
+ 'Chrome' => array('CH', 'CM', 'CI', 'CF', 'CR', 'RM'),
+ 'Firefox' => array('FF', 'FE', 'SX', 'FB', 'PX', 'MB'),
+ 'Internet Explorer' => array('IE', 'IM'),
+ 'Konqueror' => array('KO'),
+ 'NetFront' => array('NF'),
+ 'Nokia Browser' => array('NB'),
+ 'Opera' => array('OP', 'OM', 'OI'),
+ 'Safari' => array('SF', 'MF')
);
public static $browsers = array(
'AB' => 'ABrowse',
@@ -384,9 +384,9 @@ class UserAgentParserEnhanced
}
$this->os = array(
- 'name' => $this->buildOsName($osRegex['name'], $matches),
+ 'name' => $this->buildOsName($osRegex['name'], $matches),
'short_name' => $short,
- 'version' => $this->buildOsVersion($osRegex['version'], $matches)
+ 'version' => $this->buildOsVersion($osRegex['version'], $matches)
);
if (array_key_exists($this->os['name'], self::$osShorts)) {
@@ -412,9 +412,9 @@ class UserAgentParserEnhanced
}
$this->browser = array(
- 'name' => $this->buildBrowserName($browserRegex['name'], $matches),
+ 'name' => $this->buildBrowserName($browserRegex['name'], $matches),
'short_name' => $short,
- 'version' => $this->buildBrowserVersion($browserRegex['version'], $matches)
+ 'version' => $this->buildBrowserVersion($browserRegex['version'], $matches)
);
}
@@ -439,7 +439,7 @@ class UserAgentParserEnhanced
$this->fullName = $brand;
if (isset($mobileRegex['device'])) {
- $this->device = array_search($mobileRegex['device'],self::$deviceTypes);
+ $this->device = array_search($mobileRegex['device'], self::$deviceTypes);
}
if (isset($mobileRegex['model'])) {
diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php
index 92a4b3e84e..56be9c7a0e 100644
--- a/plugins/DevicesDetection/functions.php
+++ b/plugins/DevicesDetection/functions.php
@@ -85,12 +85,12 @@ function getDeviceTypeLabel($label)
function getDeviceTypeLogo($label)
{
$deviceTypeLogos = Array(
- "Desktop" => "normal.gif",
- "Smartphone" => "smartphone.png",
- "Tablet" => "tablet.png",
- "Tv" => "tv.png",
+ "Desktop" => "normal.gif",
+ "Smartphone" => "smartphone.png",
+ "Tablet" => "tablet.png",
+ "Tv" => "tv.png",
"Feature phone" => "mobile.gif",
- "Console" => "console.gif");
+ "Console" => "console.gif");
if (!array_key_exists($label, $deviceTypeLogos) || $label == "Unknown") {
$label = 'unknown.gif';
@@ -135,7 +135,7 @@ function getOsFullNameExtended($label)
$os = substr($label, 0, 3);
$ver = substr($label, 4, 15);
$name = UserAgentParserEnhanced::getOsNameFromId($os, $ver);
- if(!empty($name)) {
+ if (!empty($name)) {
return $name;
}
}
@@ -143,7 +143,6 @@ function getOsFullNameExtended($label)
}
-
function getOsLogoExtended($label)
{
$short = substr($label, 0, 3);