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:
-rw-r--r--.gitignore1
-rw-r--r--core/Common.php6
-rw-r--r--core/DataAccess/ArchiveWriter.php2
-rw-r--r--core/Db/Adapter/Pdo/Mssql.php2
-rw-r--r--core/EventDispatcher.php4
-rw-r--r--core/Period/Range.php6
-rw-r--r--core/PluginsManager.php2
-rw-r--r--core/Tracker/Cache.php2
-rw-r--r--core/Translate.php3
-rw-r--r--core/TranslationWriter.php1
-rw-r--r--plugins/CoreAdminHome/API.php4
-rw-r--r--plugins/CoreHome/Controller.php2
-rw-r--r--plugins/LanguagesManager/API.php3
-rw-r--r--plugins/Live/API.php8
-rw-r--r--plugins/UserCountry/Archiver.php2
-rwxr-xr-xplugins/UserCountry/LocationProvider/GeoIp.php1
-rw-r--r--plugins/Zeitgeist/templates/_jsGlobalVariables.twig2
17 files changed, 31 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore
index ac561c35ed..0ae42c673e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,6 @@ tmp/*
*.buildpath
config/config.ini.php
.DS_Store
-tests/PHPUnit/Integration/processed/
js/yui*
misc/*.dat
tests/javascript/enable_sqlite
diff --git a/core/Common.php b/core/Common.php
index e9a4625573..5eeb94ffaf 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -970,7 +970,7 @@ class Piwik_Common
/**
* Returns the browser language code, eg. "en-gb,en;q=0.5"
*
- * @param string $browserLang Optional browser language, otherwise taken from the request header
+ * @param string|null $browserLang Optional browser language, otherwise taken from the request header
* @return string
*/
public static function getBrowserLanguage($browserLang = NULL)
@@ -1075,8 +1075,8 @@ class Piwik_Common
/**
* Returns the visitor language based only on the Browser 'accepted language' information
*
- * @param $browserLanguage Browser's accepted langauge header
- * @param $validLanguages array of valid language codes
+ * @param string $browserLanguage Browser's accepted langauge header
+ * @param array $validLanguages array of valid language codes
* @return string 2 letter ISO 639 code
*/
public static function extractLanguageCodeFromBrowserLanguage($browserLanguage, $validLanguages)
diff --git a/core/DataAccess/ArchiveWriter.php b/core/DataAccess/ArchiveWriter.php
index 3f36252fdc..bb10fe7a44 100644
--- a/core/DataAccess/ArchiveWriter.php
+++ b/core/DataAccess/ArchiveWriter.php
@@ -231,7 +231,7 @@ class Piwik_DataAccess_ArchiveWriter
if (is_numeric($value)) {
return $this->getTableNumeric();
}
- return Piwik_DataAccess_ArchiveTableCreator::getBlobTable($this->dateStart);;
+ return Piwik_DataAccess_ArchiveTableCreator::getBlobTable($this->dateStart);
}
protected function getTableNumeric()
diff --git a/core/Db/Adapter/Pdo/Mssql.php b/core/Db/Adapter/Pdo/Mssql.php
index 6754962e6d..54a156295b 100644
--- a/core/Db/Adapter/Pdo/Mssql.php
+++ b/core/Db/Adapter/Pdo/Mssql.php
@@ -246,7 +246,7 @@ class Piwik_Db_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Mssql implements Piwik_Db_A
$version = $this->_connection->getAttribute(PDO::ATTR_CLIENT_VERSION);
$requiredVersion = Piwik_Config::getInstance()->General['minimum_mssql_client_version'];
if (version_compare($version['DriverVer'], $requiredVersion) === -1) {
- throw new Exception(Piwik_TranslateException('General_ExceptionDatabaseVersion', array('MSSQL', $serverVersion, $requiredVersion)));
+ throw new Exception(Piwik_TranslateException('General_ExceptionDatabaseVersion', array('MSSQL', $version['DriverVer'], $requiredVersion)));
} else {
return $version['DriverVer'];
}
diff --git a/core/EventDispatcher.php b/core/EventDispatcher.php
index b1bc3daa1c..f11107d56e 100644
--- a/core/EventDispatcher.php
+++ b/core/EventDispatcher.php
@@ -117,7 +117,7 @@ class Piwik_EventDispatcher
* name.
*
* @param string $eventName
- * @param array $callback This can be a normal PHP callback or an array
+ * @param array|callable $callback This can be a normal PHP callback or an array
* that looks like this:
* array(
* 'function' => $callback,
@@ -200,7 +200,7 @@ function Piwik_PostEvent($eventName, $params = array(), $pending = false, $plugi
* Register an action to execute for a given event
*
* @param string $eventName Name of event
- * @param function $function Callback hook
+ * @param callable $function Callback hook
*/
function Piwik_AddAction($eventName, $function)
{
diff --git a/core/Period/Range.php b/core/Period/Range.php
index c73f10b4fe..27ef4bd015 100644
--- a/core/Period/Range.php
+++ b/core/Period/Range.php
@@ -19,6 +19,12 @@ class Piwik_Period_Range extends Piwik_Period
{
protected $label = 'range';
+ /**
+ * @param string $strPeriod
+ * @param string $strDate
+ * @param string $timezone
+ * @param bool|Piwik_Date $today
+ */
public function __construct($strPeriod, $strDate, $timezone = 'UTC', $today = false)
{
$this->strPeriod = $strPeriod;
diff --git a/core/PluginsManager.php b/core/PluginsManager.php
index f003859a39..c09988452f 100644
--- a/core/PluginsManager.php
+++ b/core/PluginsManager.php
@@ -424,7 +424,7 @@ class Piwik_PluginsManager
/**
* Unload plugin
*
- * @param Piwik_Plugin $plugin
+ * @param Piwik_Plugin|string $plugin
* @throws Exception
*/
public function unloadPlugin($plugin)
diff --git a/core/Tracker/Cache.php b/core/Tracker/Cache.php
index d277d94f84..f529b1d874 100644
--- a/core/Tracker/Cache.php
+++ b/core/Tracker/Cache.php
@@ -119,7 +119,7 @@ class Piwik_Tracker_Cache
/**
* Regenerate Tracker cache files
*
- * @param array $idSites Array of idSites to clear cache for
+ * @param array|int $idSites Array of idSites to clear cache for
*/
static public function regenerateCacheWebsiteAttributes($idSites = array())
{
diff --git a/core/Translate.php b/core/Translate.php
index 807638357c..d2b95e700b 100644
--- a/core/Translate.php
+++ b/core/Translate.php
@@ -69,6 +69,7 @@ class Piwik_Translate
private function loadTranslation($language)
{
+ $translations = array();
$path = PIWIK_INCLUDE_PATH . '/lang/' . $language . '.php';
if (!Piwik_Common::isValidFilename($language) || !is_readable($path)) {
throw new Exception(Piwik_TranslateException('General_ExceptionLanguageFileNotFound', array($language)));
@@ -181,7 +182,7 @@ class Piwik_Translate
* Returns translated string or given message if translation is not found.
*
* @param string $string Translation string index
- * @param array $args sprintf arguments
+ * @param array|string|int $args sprintf arguments
* @return string
*/
function Piwik_Translate($string, $args = array())
diff --git a/core/TranslationWriter.php b/core/TranslationWriter.php
index e2fbb9578c..e47ae10f89 100644
--- a/core/TranslationWriter.php
+++ b/core/TranslationWriter.php
@@ -69,6 +69,7 @@ class Piwik_TranslationWriter
*/
static public function loadTranslation($lang)
{
+ $translations = array();
$path = self::getTranslationPath($lang);
if (!is_readable($path)) {
throw new Exception(Piwik_TranslateException('General_ExceptionLanguageFileNotFound', array($lang)));
diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php
index 27a2293bcd..a2e272ffb3 100644
--- a/plugins/CoreAdminHome/API.php
+++ b/plugins/CoreAdminHome/API.php
@@ -129,8 +129,8 @@ class Piwik_CoreAdminHome_API
// but also weeks overlapping several months stored in the month where the week is starting
/* @var $week Piwik_Period_Week */
$week = Piwik_Period::factory('week', $date);
- $week = $week->getDateStart()->toString('Y_m');
- $datesByMonth[$week][] = $date->toString();
+ $weekAsString = $week->getDateStart()->toString('Y_m');
+ $datesByMonth[$weekAsString][] = $date->toString();
// Keep track of the minimum date for each website
if ($minDate === false
diff --git a/plugins/CoreHome/Controller.php b/plugins/CoreHome/Controller.php
index 724bb1f472..fe9875c3d0 100644
--- a/plugins/CoreHome/Controller.php
+++ b/plugins/CoreHome/Controller.php
@@ -226,7 +226,7 @@ class Piwik_CoreHome_Controller extends Piwik_Controller
public function redirectToPaypal()
{
$parameters = Piwik_API_Request::getRequestArrayFromString($request = null);
- foreach ($paramaters as $name => $param) {
+ foreach ($parameters as $name => $param) {
if ($name == 'idSite'
|| $name == 'module'
|| $name == 'action'
diff --git a/plugins/LanguagesManager/API.php b/plugins/LanguagesManager/API.php
index 484065f4e1..658deb886c 100644
--- a/plugins/LanguagesManager/API.php
+++ b/plugins/LanguagesManager/API.php
@@ -116,7 +116,7 @@ class Piwik_LanguagesManager_API
}
$filenames = $this->getAvailableLanguages();
- $languagesInfo = array();
+ $translations = $languagesInfo = array();
foreach ($filenames as $filename) {
require PIWIK_INCLUDE_PATH . "/lang/$filename.php";
$languagesInfo[] = array(
@@ -140,6 +140,7 @@ class Piwik_LanguagesManager_API
if (!$this->isLanguageAvailable($languageCode)) {
return false;
}
+ $translations = array();
require PIWIK_INCLUDE_PATH . "/lang/$languageCode.php";
$languageInfo = array();
foreach ($translations as $key => $value) {
diff --git a/plugins/Live/API.php b/plugins/Live/API.php
index 62c0b5c7be..074f1f7a05 100644
--- a/plugins/Live/API.php
+++ b/plugins/Live/API.php
@@ -84,8 +84,12 @@ class Piwik_Live_API
$data = Piwik_FetchAll($query['sql'], $query['bind']);
// These could be unset for some reasons, ensure they are set to 0
- empty($data[0]['actions']) ? $data[0]['actions'] = 0 : '';
- empty($data[0]['visitsConverted']) ? $data[0]['visitsConverted'] = 0 : '';
+ if (empty($data[0]['actions'])) {
+ $data[0]['actions'] = 0;
+ }
+ if (empty($data[0]['visitsConverted'])) {
+ $data[0]['visitsConverted'] = 0;
+ }
return $data;
}
diff --git a/plugins/UserCountry/Archiver.php b/plugins/UserCountry/Archiver.php
index 2fa2573d55..deac72405c 100644
--- a/plugins/UserCountry/Archiver.php
+++ b/plugins/UserCountry/Archiver.php
@@ -21,8 +21,6 @@ class Piwik_UserCountry_Archiver extends Piwik_PluginsArchiver
private $latLongForCities = array();
- private $dataArrays = array();
-
protected $maximumRows;
const COUNTRY_FIELD = 'location_country';
diff --git a/plugins/UserCountry/LocationProvider/GeoIp.php b/plugins/UserCountry/LocationProvider/GeoIp.php
index f7a9029797..5cf139ac12 100755
--- a/plugins/UserCountry/LocationProvider/GeoIp.php
+++ b/plugins/UserCountry/LocationProvider/GeoIp.php
@@ -168,6 +168,7 @@ abstract class Piwik_UserCountry_LocationProvider_GeoIp extends Piwik_UserCountr
public static function getRegionNames()
{
if (is_null(self::$regionNames)) {
+ $GEOIP_REGION_NAME = array();
require_once PIWIK_INCLUDE_PATH . '/libs/MaxMindGeoIP/geoipregionvars.php';
self::$regionNames = $GEOIP_REGION_NAME;
}
diff --git a/plugins/Zeitgeist/templates/_jsGlobalVariables.twig b/plugins/Zeitgeist/templates/_jsGlobalVariables.twig
index 3667f2169f..0ec9e5478d 100644
--- a/plugins/Zeitgeist/templates/_jsGlobalVariables.twig
+++ b/plugins/Zeitgeist/templates/_jsGlobalVariables.twig
@@ -1,5 +1,5 @@
<script type="text/javascript">
- var piwik = {}
+ var piwik = {};
piwik.token_auth = "{{ token_auth }}";
piwik.piwik_url = "{{ piwikUrl }}";
{% if userLogin %}piwik.userLogin = "{{ userLogin|e('js')}}";