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:
authorfabiocarneiro <fahecs@gmail.com>2015-05-27 12:56:17 +0300
committerfabiocarneiro <fahecs@gmail.com>2015-05-27 12:56:17 +0300
commita2a63d34ebb460174e1a3e8d8022fe3e3ab4b469 (patch)
treefbfc480352bc711bc03f12849824507e56b5034a
parentb2f5b5489ceca056217fc6663ec6c2c6b052cd42 (diff)
fix core folder with php-cs-fixer for psr-2
-rw-r--r--core/API/ApiRenderer.php5
-rw-r--r--core/API/CORSHandler.php2
-rw-r--r--core/API/DataTableGenericFilter.php5
-rw-r--r--core/API/DataTableManipulator.php7
-rw-r--r--core/API/DataTableManipulator/ReportTotalsCalculator.php5
-rw-r--r--core/API/DataTablePostProcessor.php2
-rw-r--r--core/API/Inconsistencies.php2
-rw-r--r--core/API/Proxy.php3
-rw-r--r--core/API/Request.php1
-rw-r--r--core/API/ResponseBuilder.php1
-rw-r--r--core/Access.php3
-rw-r--r--core/Application/Environment.php2
-rw-r--r--core/Application/Kernel/EnvironmentValidator.php3
-rw-r--r--core/Application/Kernel/GlobalSettingsProvider.php2
-rw-r--r--core/Application/Kernel/PluginList.php2
-rw-r--r--core/Archive.php5
-rw-r--r--core/Archive/ArchiveInvalidator.php7
-rw-r--r--core/Archive/ArchivePurger.php3
-rw-r--r--core/Archive/DataCollection.php3
-rw-r--r--core/Archive/DataTableFactory.php2
-rw-r--r--core/Archive/Parameters.php1
-rw-r--r--core/ArchiveProcessor.php13
-rw-r--r--core/ArchiveProcessor/Loader.php4
-rw-r--r--core/ArchiveProcessor/PluginsArchiver.php4
-rw-r--r--core/ArchiveProcessor/Rules.php2
-rw-r--r--core/AssetManager.php29
-rw-r--r--core/AssetManager/UIAsset/OnDiskUIAsset.php11
-rw-r--r--core/AssetManager/UIAssetCatalog.php2
-rw-r--r--core/AssetManager/UIAssetCatalogSorter.php7
-rw-r--r--core/AssetManager/UIAssetFetcher.php6
-rw-r--r--core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php6
-rw-r--r--core/AssetManager/UIAssetFetcher/StaticUIAssetFetcher.php3
-rw-r--r--core/AssetManager/UIAssetMerger.php12
-rw-r--r--core/AssetManager/UIAssetMerger/JScriptUIAssetMerger.php5
-rw-r--r--core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php6
-rw-r--r--core/AssetManager/UIAssetMinifier.php4
-rw-r--r--core/Auth.php2
-rw-r--r--core/BaseFactory.php6
-rw-r--r--core/CacheId.php1
-rw-r--r--core/CliMulti.php12
-rw-r--r--core/CliMulti/CliPhp.php2
-rw-r--r--core/CliMulti/Output.php4
-rw-r--r--core/CliMulti/Process.php14
-rw-r--r--core/CliMulti/RequestCommand.php2
-rw-r--r--core/Columns/Dimension.php3
-rw-r--r--core/Columns/Updater.php4
-rw-r--r--core/Common.php41
-rw-r--r--core/Concurrency/DistributedList.php2
-rw-r--r--core/Config/IniFileChain.php16
-rw-r--r--core/Console.php5
-rw-r--r--core/Container/ContainerDoesNotExistException.php2
-rw-r--r--core/Container/ContainerFactory.php1
-rw-r--r--core/Cookie.php4
-rw-r--r--core/CronArchive.php36
-rw-r--r--core/CronArchive/FixedSiteIds.php3
-rw-r--r--core/CronArchive/SegmentArchivingRequestUrlProvider.php4
-rw-r--r--core/CronArchive/SharedSiteIds.php2
-rw-r--r--core/CronArchive/SitesToReprocessDistributedList.php2
-rw-r--r--core/DataAccess/Actions.php2
-rw-r--r--core/DataAccess/ArchiveSelector.php7
-rw-r--r--core/DataAccess/ArchiveTableCreator.php1
-rw-r--r--core/DataAccess/ArchiveWriter.php1
-rw-r--r--core/DataAccess/LogAggregator.php4
-rw-r--r--core/DataAccess/LogQueryBuilder.php19
-rw-r--r--core/DataAccess/Model.php4
-rw-r--r--core/DataAccess/RawLogDao.php2
-rw-r--r--core/DataAccess/TableMetadata.php2
-rw-r--r--core/DataArray.php4
-rw-r--r--core/DataFiles/SearchEngines.php16
-rw-r--r--core/DataTable.php25
-rw-r--r--core/DataTable/BaseFilter.php1
-rw-r--r--core/DataTable/Bridges.php1
-rw-r--r--core/DataTable/Filter/AddColumnsProcessedMetrics.php3
-rw-r--r--core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php3
-rw-r--r--core/DataTable/Filter/AddSegmentByLabel.php4
-rw-r--r--core/DataTable/Filter/AddSegmentValue.php1
-rw-r--r--core/DataTable/Filter/BeautifyTimeRangeLabels.php2
-rwxr-xr-xcore/DataTable/Filter/CalculateEvolutionFilter.php4
-rw-r--r--core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php2
-rw-r--r--core/DataTable/Filter/ColumnCallbackAddMetadata.php3
-rw-r--r--core/DataTable/Filter/ColumnCallbackReplace.php1
-rw-r--r--core/DataTable/Filter/ColumnDelete.php1
-rw-r--r--core/DataTable/Filter/ExcludeLowPopulation.php1
-rwxr-xr-xcore/DataTable/Filter/GroupBy.php3
-rw-r--r--core/DataTable/Filter/PatternRecursive.php4
-rw-r--r--core/DataTable/Filter/PivotByDimension.php2
-rw-r--r--core/DataTable/Filter/ReplaceSummaryRowLabel.php1
-rw-r--r--core/DataTable/Filter/Sort.php7
-rw-r--r--core/DataTable/Manager.php4
-rw-r--r--core/DataTable/Renderer.php1
-rw-r--r--core/DataTable/Renderer/Console.php20
-rw-r--r--core/DataTable/Renderer/Csv.php12
-rw-r--r--core/DataTable/Renderer/Html.php14
-rw-r--r--core/DataTable/Renderer/Json.php1
-rw-r--r--core/DataTable/Renderer/Php.php5
-rw-r--r--core/DataTable/Renderer/Rss.php2
-rw-r--r--core/DataTable/Renderer/Tsv.php4
-rw-r--r--core/DataTable/Renderer/Xml.php8
-rw-r--r--core/DataTable/Row.php30
-rw-r--r--core/DataTable/TableNotFoundException.php1
-rw-r--r--core/Date.php1
-rw-r--r--core/Db.php1
-rw-r--r--core/Db/Adapter.php2
-rw-r--r--core/Db/BatchInsert.php18
-rw-r--r--core/Db/Schema/Mysql.php4
-rw-r--r--core/Db/Settings.php1
-rw-r--r--core/DbHelper.php3
-rw-r--r--core/Development.php4
-rw-r--r--core/DeviceDetectorCache.php2
-rw-r--r--core/DeviceDetectorFactory.php2
-rw-r--r--core/EventDispatcher.php8
-rw-r--r--core/Exception/AuthenticationFailedException.php2
-rw-r--r--core/Exception/DatabaseSchemaIsNewerThanCodebaseException.php3
-rw-r--r--core/Exception/Exception.php2
-rw-r--r--core/Exception/InvalidRequestParameterException.php2
-rw-r--r--core/Exception/MissingFilePermissionException.php2
-rw-r--r--core/Exception/NoPrivilegesException.php2
-rw-r--r--core/Exception/NoWebsiteFoundException.php2
-rw-r--r--core/Exception/UnexpectedWebsiteFoundException.php2
-rw-r--r--core/Filechecks.php5
-rw-r--r--core/Filesystem.php19
-rw-r--r--core/FrontController.php5
-rw-r--r--core/Http.php13
-rw-r--r--core/Http/ControllerResolver.php1
-rw-r--r--core/Mail.php2
-rw-r--r--core/Menu/Group.php2
-rw-r--r--core/Menu/MenuAbstract.php7
-rw-r--r--core/Menu/MenuReporting.php2
-rw-r--r--core/Menu/MenuTop.php1
-rw-r--r--core/Metrics.php9
-rw-r--r--core/Metrics/Formatter.php2
-rw-r--r--core/Metrics/Formatter/Html.php2
-rw-r--r--core/Period/Factory.php1
-rw-r--r--core/Period/Month.php2
-rw-r--r--core/Period/Range.php8
-rw-r--r--core/Period/Year.php2
-rw-r--r--core/Piwik.php21
-rw-r--r--core/Plugin.php1
-rw-r--r--core/Plugin/API.php3
-rw-r--r--core/Plugin/AggregatedMetric.php3
-rw-r--r--core/Plugin/ComponentFactory.php2
-rw-r--r--core/Plugin/Controller.php13
-rw-r--r--core/Plugin/ControllerAdmin.php1
-rw-r--r--core/Plugin/Dependency.php6
-rw-r--r--core/Plugin/Dimension/ActionDimension.php3
-rw-r--r--core/Plugin/Dimension/ConversionDimension.php3
-rw-r--r--core/Plugin/Dimension/VisitDimension.php3
-rw-r--r--core/Plugin/Manager.php10
-rw-r--r--core/Plugin/Menu.php1
-rw-r--r--core/Plugin/MetadataLoader.php1
-rw-r--r--core/Plugin/Metric.php7
-rw-r--r--core/Plugin/ProcessedMetric.php2
-rw-r--r--core/Plugin/Report.php9
-rw-r--r--core/Plugin/Segment.php6
-rw-r--r--core/Plugin/Settings.php1
-rw-r--r--core/Plugin/Tasks.php2
-rw-r--r--core/Plugin/ViewDataTable.php3
-rw-r--r--core/Plugin/Visualization.php6
-rw-r--r--core/Plugin/Widgets.php1
-rw-r--r--core/Profiler.php10
-rw-r--r--core/ProxyHttp.php4
-rw-r--r--core/QuickForm2.php10
-rw-r--r--core/ReportRenderer.php4
-rw-r--r--core/ReportRenderer/Html.php1
-rw-r--r--core/ReportRenderer/Pdf.php3
-rw-r--r--core/Scheduler/Schedule/Daily.php2
-rw-r--r--core/Scheduler/Schedule/Hourly.php4
-rw-r--r--core/Scheduler/Schedule/Monthly.php7
-rw-r--r--core/Scheduler/Schedule/Schedule.php2
-rw-r--r--core/Scheduler/Schedule/Weekly.php2
-rw-r--r--core/Scheduler/TaskLoader.php1
-rw-r--r--core/Segment.php4
-rw-r--r--core/Segment/SegmentExpression.php2
-rw-r--r--core/Session.php2
-rw-r--r--core/Session/SaveHandler/DbTable.php2
-rw-r--r--core/Settings/Manager.php2
-rw-r--r--core/Settings/Setting.php1
-rw-r--r--core/Settings/Storage.php3
-rw-r--r--core/Settings/Storage/Factory.php1
-rw-r--r--core/Settings/Storage/StaticStorage.php2
-rw-r--r--core/Settings/UserSetting.php4
-rw-r--r--core/SettingsPiwik.php2
-rw-r--r--core/Singleton.php11
-rw-r--r--core/Site.php2
-rw-r--r--core/TCPDF.php10
-rw-r--r--core/Theme.php8
-rw-r--r--core/Timer.php1
-rw-r--r--core/Tracker.php7
-rw-r--r--core/Tracker/Action.php3
-rw-r--r--core/Tracker/ActionPageview.php4
-rw-r--r--core/Tracker/Cache.php4
-rw-r--r--core/Tracker/Db/Mysqli.php11
-rw-r--r--core/Tracker/Db/Pdo/Mysql.php6
-rw-r--r--core/Tracker/GoalManager.php4
-rw-r--r--core/Tracker/Handler.php1
-rw-r--r--core/Tracker/Handler/Factory.php1
-rw-r--r--core/Tracker/Model.php8
-rw-r--r--core/Tracker/PageUrl.php12
-rw-r--r--core/Tracker/Request.php6
-rw-r--r--core/Tracker/RequestSet.php3
-rw-r--r--core/Tracker/Response.php3
-rw-r--r--core/Tracker/ScheduledTasksRunner.php4
-rw-r--r--core/Tracker/Settings.php9
-rw-r--r--core/Tracker/SettingsStorage.php1
-rw-r--r--core/Tracker/TableLogAction.php5
-rw-r--r--core/Tracker/Visit.php7
-rw-r--r--core/Tracker/Visit/Factory.php1
-rw-r--r--core/Tracker/Visit/ReferrerSpamFilter.php2
-rw-r--r--core/Tracker/VisitExcluded.php1
-rw-r--r--core/Tracker/Visitor.php2
-rw-r--r--core/Tracker/VisitorNotFoundInDb.php1
-rw-r--r--core/Translation/Loader/JsonFileLoader.php1
-rw-r--r--core/Translation/Transifex/API.php4
-rwxr-xr-xcore/Twig.php69
-rw-r--r--core/Unzip.php6
-rw-r--r--core/Updater.php5
-rw-r--r--core/Updater/UpdateObserver.php2
-rw-r--r--core/Updates.php4
-rw-r--r--core/Updates/0.2.10.php4
-rw-r--r--core/Updates/0.2.12.php4
-rw-r--r--core/Updates/0.2.13.php4
-rw-r--r--core/Updates/0.2.24.php4
-rw-r--r--core/Updates/0.2.27.php4
-rw-r--r--core/Updates/0.2.32.php4
-rw-r--r--core/Updates/0.2.33.php4
-rw-r--r--core/Updates/0.2.35.php4
-rw-r--r--core/Updates/0.2.37.php4
-rw-r--r--core/Updates/0.4.1.php4
-rw-r--r--core/Updates/0.4.2.php4
-rw-r--r--core/Updates/0.4.4.php2
-rw-r--r--core/Updates/0.4.php4
-rw-r--r--core/Updates/0.5.4.php4
-rw-r--r--core/Updates/0.5.5.php5
-rw-r--r--core/Updates/0.5.php4
-rw-r--r--core/Updates/0.6-rc1.php6
-rw-r--r--core/Updates/0.6.3.php4
-rw-r--r--core/Updates/0.7.php4
-rw-r--r--core/Updates/0.9.1.php4
-rw-r--r--core/Updates/1.1.php2
-rwxr-xr-xcore/Updates/1.10-b4.php4
-rwxr-xr-xcore/Updates/1.10.1.php4
-rwxr-xr-xcore/Updates/1.10.2-b1.php4
-rw-r--r--core/Updates/1.10.2-b2.php4
-rw-r--r--core/Updates/1.11-b1.php4
-rw-r--r--core/Updates/1.12-b1.php7
-rw-r--r--core/Updates/1.12-b15.php2
-rw-r--r--core/Updates/1.12-b16.php4
-rw-r--r--core/Updates/1.2-rc1.php6
-rw-r--r--core/Updates/1.2-rc2.php3
-rw-r--r--core/Updates/1.2.3.php5
-rw-r--r--core/Updates/1.2.5-rc1.php5
-rw-r--r--core/Updates/1.2.5-rc7.php5
-rw-r--r--core/Updates/1.4-rc1.php4
-rw-r--r--core/Updates/1.4-rc2.php4
-rw-r--r--core/Updates/1.5-b1.php4
-rw-r--r--core/Updates/1.5-b2.php4
-rw-r--r--core/Updates/1.5-b3.php4
-rw-r--r--core/Updates/1.5-b4.php4
-rw-r--r--core/Updates/1.5-b5.php4
-rw-r--r--core/Updates/1.5-rc6.php3
-rw-r--r--core/Updates/1.6-b1.php4
-rw-r--r--core/Updates/1.6-rc1.php3
-rw-r--r--core/Updates/1.7-b1.php4
-rw-r--r--core/Updates/1.7.2-rc5.php4
-rwxr-xr-xcore/Updates/1.7.2-rc7.php4
-rw-r--r--core/Updates/1.8.3-b1.php6
-rw-r--r--core/Updates/1.8.4-b1.php6
-rwxr-xr-xcore/Updates/1.9-b16.php7
-rwxr-xr-xcore/Updates/1.9-b19.php5
-rwxr-xr-xcore/Updates/1.9-b9.php7
-rw-r--r--core/Updates/1.9.1-b2.php4
-rwxr-xr-xcore/Updates/1.9.3-b10.php4
-rw-r--r--core/Updates/1.9.3-b3.php2
-rwxr-xr-xcore/Updates/1.9.3-b8.php4
-rw-r--r--core/Updates/2.0-a13.php2
-rw-r--r--core/Updates/2.0-a17.php4
-rw-r--r--core/Updates/2.0-a7.php4
-rw-r--r--core/Updates/2.0-b10.php2
-rw-r--r--core/Updates/2.0-b13.php3
-rw-r--r--core/Updates/2.0-b3.php6
-rw-r--r--core/Updates/2.0-b9.php4
-rw-r--r--core/Updates/2.0-rc1.php2
-rw-r--r--core/Updates/2.0.3-b7.php6
-rw-r--r--core/Updates/2.0.4-b5.php6
-rw-r--r--core/Updates/2.0.4-b7.php5
-rw-r--r--core/Updates/2.0.4-b8.php6
-rw-r--r--core/Updates/2.1.1-b11.php2
-rw-r--r--core/Updates/2.10.0-b10.php10
-rw-r--r--core/Updates/2.10.0-b4.php4
-rw-r--r--core/Updates/2.10.0-b5.php19
-rw-r--r--core/Updates/2.10.0-b7.php8
-rw-r--r--core/Updates/2.10.0-b8.php5
-rw-r--r--core/Updates/2.11.0-b2.php11
-rw-r--r--core/Updates/2.11.0-b4.php10
-rw-r--r--core/Updates/2.11.0-b5.php2
-rw-r--r--core/Updates/2.11.1-b4.php2
-rw-r--r--core/Updates/2.13.0-b3.php3
-rw-r--r--core/Updates/2.13.1.php4
-rw-r--r--core/Updates/2.14.0-b1.php3
-rw-r--r--core/Updates/2.2.0-b15.php3
-rw-r--r--core/Updates/2.2.3-b6.php2
-rw-r--r--core/Updates/2.3.0-rc2.php1
-rw-r--r--core/Updates/2.4.0-b1.php4
-rw-r--r--core/Updates/2.4.0-b3.php6
-rw-r--r--core/Updates/2.4.0-b4.php4
-rw-r--r--core/Updates/2.4.0-b6.php2
-rw-r--r--core/Updates/2.4.0-b8.php4
-rw-r--r--core/Updates/2.5.0-b1.php1
-rw-r--r--core/Updates/2.5.0-rc2.php2
-rw-r--r--core/Updates/2.5.0-rc4.php2
-rw-r--r--core/Updates/2.6.0-b1.php2
-rw-r--r--core/Updates/2.7.0-b2.php5
-rw-r--r--core/Updates/2.7.0-b4.php7
-rw-r--r--core/Updates/2.9.0-b1.php8
-rw-r--r--core/Updates/2.9.0-b7.php5
-rw-r--r--core/Url.php9
-rw-r--r--core/UrlHelper.php6
-rw-r--r--core/Version.php1
-rw-r--r--core/View.php2
-rw-r--r--core/View/RenderTokenParser.php2
-rw-r--r--core/View/UIControl.php2
-rw-r--r--core/View/ViewInterface.php2
-rw-r--r--core/ViewDataTable/Config.php1
-rw-r--r--core/ViewDataTable/Request.php1
-rw-r--r--core/ViewDataTable/RequestConfig.php2
-rw-r--r--core/dispatch.php2
-rw-r--r--core/testMinimumPhpVersion.php2
327 files changed, 689 insertions, 908 deletions
diff --git a/core/API/ApiRenderer.php b/core/API/ApiRenderer.php
index 4a75f3d6e6..36f84e63c2 100644
--- a/core/API/ApiRenderer.php
+++ b/core/API/ApiRenderer.php
@@ -28,7 +28,9 @@ abstract class ApiRenderer
$this->init();
}
- protected function init() {}
+ protected function init()
+ {
+ }
abstract public function sendHeader();
@@ -126,5 +128,4 @@ abstract class ApiRenderer
return strtolower(end($klass));
}
-
}
diff --git a/core/API/CORSHandler.php b/core/API/CORSHandler.php
index aeee2ad39d..779794dfcc 100644
--- a/core/API/CORSHandler.php
+++ b/core/API/CORSHandler.php
@@ -38,4 +38,4 @@ class CORSHandler
}
}
}
-}
+}
diff --git a/core/API/DataTableGenericFilter.php b/core/API/DataTableGenericFilter.php
index 1554703910..5d4ba49422 100644
--- a/core/API/DataTableGenericFilter.php
+++ b/core/API/DataTableGenericFilter.php
@@ -11,7 +11,6 @@ namespace Piwik\API;
use Exception;
use Piwik\Common;
use Piwik\DataTable;
-use Piwik\Plugin;
use Piwik\Plugin\ProcessedMetric;
use Piwik\Plugin\Report;
@@ -39,7 +38,7 @@ class DataTableGenericFilter
*
* @param $request
*/
- function __construct($request, $report)
+ public function __construct($request, $report)
{
$this->request = $request;
$this->report = $report;
@@ -225,4 +224,4 @@ class DataTableGenericFilter
}
return false;
}
-} \ No newline at end of file
+}
diff --git a/core/API/DataTableManipulator.php b/core/API/DataTableManipulator.php
index 862f2db087..76c52f4958 100644
--- a/core/API/DataTableManipulator.php
+++ b/core/API/DataTableManipulator.php
@@ -10,7 +10,6 @@ namespace Piwik\API;
use Exception;
use Piwik\Archive\DataTableFactory;
-use Piwik\Common;
use Piwik\DataTable\Row;
use Piwik\DataTable;
use Piwik\Period\Range;
@@ -63,7 +62,7 @@ abstract class DataTableManipulator
{
if ($dataTable instanceof DataTable\Map) {
return $this->manipulateDataTableMap($dataTable);
- } else if ($dataTable instanceof DataTable) {
+ } elseif ($dataTable instanceof DataTable) {
return $this->manipulateDataTable($dataTable);
} else {
return $dataTable;
@@ -90,7 +89,7 @@ abstract class DataTableManipulator
* Manipulates a single DataTable instance. Derived classes must define
* this function.
*/
- protected abstract function manipulateDataTable($dataTable);
+ abstract protected function manipulateDataTable($dataTable);
/**
* Load the subtable for a row.
@@ -136,7 +135,7 @@ abstract class DataTableManipulator
* @param $request
* @return
*/
- protected abstract function manipulateSubtableRequest($request);
+ abstract protected function manipulateSubtableRequest($request);
/**
* Extract the API method for loading subtables from the meta data
diff --git a/core/API/DataTableManipulator/ReportTotalsCalculator.php b/core/API/DataTableManipulator/ReportTotalsCalculator.php
index 2631b43d5a..a77b96d51c 100644
--- a/core/API/DataTableManipulator/ReportTotalsCalculator.php
+++ b/core/API/DataTableManipulator/ReportTotalsCalculator.php
@@ -10,7 +10,6 @@ namespace Piwik\API\DataTableManipulator;
use Piwik\API\DataTableManipulator;
use Piwik\DataTable;
-use Piwik\DataTable\Row;
use Piwik\Metrics;
use Piwik\Period;
use Piwik\Plugin\Report;
@@ -62,7 +61,7 @@ class ReportTotalsCalculator extends DataTableManipulator
try {
return $this->manipulate($table);
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
// eg. requests with idSubtable may trigger this exception
// (where idSubtable was removed in
// ?module=API&method=Events.getNameFromCategoryId&idSubtable=1&secondaryDimension=eventName&format=XML&idSite=1&period=day&date=yesterday&flat=0
@@ -89,7 +88,7 @@ class ReportTotalsCalculator extends DataTableManipulator
$metricNames = array();
foreach ($metricsToCalculate as $metricId) {
- $metricNames[$metricId] = Metrics::getReadableColumnName($metricId);;
+ $metricNames[$metricId] = Metrics::getReadableColumnName($metricId);
}
foreach ($firstLevelTable->getRows() as $row) {
diff --git a/core/API/DataTablePostProcessor.php b/core/API/DataTablePostProcessor.php
index 24d8cf8b6c..6c63e5e08b 100644
--- a/core/API/DataTablePostProcessor.php
+++ b/core/API/DataTablePostProcessor.php
@@ -432,4 +432,4 @@ class DataTablePostProcessor
{
$dataTable->filter(array($this, 'computeProcessedMetrics'));
}
-} \ No newline at end of file
+}
diff --git a/core/API/Inconsistencies.php b/core/API/Inconsistencies.php
index 5d0c20d418..36c85bb994 100644
--- a/core/API/Inconsistencies.php
+++ b/core/API/Inconsistencies.php
@@ -39,4 +39,4 @@ class Inconsistencies
'/goal_.*_conversion_rate/'
);
}
-} \ No newline at end of file
+}
diff --git a/core/API/Proxy.php b/core/API/Proxy.php
index 0f8667d0d8..1576df9ba0 100644
--- a/core/API/Proxy.php
+++ b/core/API/Proxy.php
@@ -78,7 +78,7 @@ class Proxy extends Singleton
$this->checkClassIsSingleton($className);
$rClass = new ReflectionClass($className);
- if(!$this->shouldHideAPIMethod($rClass->getDocComment())) {
+ if (!$this->shouldHideAPIMethod($rClass->getDocComment())) {
foreach ($rClass->getMethods() as $method) {
$this->loadMethodMetadata($className, $method);
}
@@ -388,7 +388,6 @@ class Proxy extends Singleton
$requestValue = Common::getRequestVar($name, null, null, $parametersRequest);
} else {
try {
-
if ($name == 'segment' && !empty($parametersRequest['segment'])) {
// segment parameter is an exception: we do not want to sanitize user input or it would break the segment encoding
$requestValue = ($parametersRequest['segment']);
diff --git a/core/API/Request.php b/core/API/Request.php
index a21212e729..bb0a323565 100644
--- a/core/API/Request.php
+++ b/core/API/Request.php
@@ -238,7 +238,6 @@ class Request
$returnedValue = Proxy::getInstance()->call($apiClassName, $method, $this->request);
$toReturn = $response->getResponse($returnedValue, $module, $method);
-
} catch (Exception $e) {
Log::debug($e);
diff --git a/core/API/ResponseBuilder.php b/core/API/ResponseBuilder.php
index f12f1f494b..3fe13f9631 100644
--- a/core/API/ResponseBuilder.php
+++ b/core/API/ResponseBuilder.php
@@ -15,7 +15,6 @@ use Piwik\DataTable\Renderer;
use Piwik\DataTable\DataTableInterface;
use Piwik\DataTable\Filter\ColumnDelete;
use Piwik\DataTable\Filter\Pattern;
-use Piwik\Plugin\Report;
/**
*/
diff --git a/core/Access.php b/core/Access.php
index 8a3e89ae44..ba0e662810 100644
--- a/core/Access.php
+++ b/core/Access.php
@@ -9,7 +9,6 @@
namespace Piwik;
use Exception;
-use Piwik\Db;
/**
* Singleton that manages user access to Piwik resources.
@@ -226,7 +225,7 @@ class Access
}
$this->idsitesByAccess['superuser'] = $allSitesId;
}
- } else if (isset($this->login)) {
+ } elseif (isset($this->login)) {
if (empty($this->idsitesByAccess['view'])
&& empty($this->idsitesByAccess['admin'])) {
diff --git a/core/Application/Environment.php b/core/Application/Environment.php
index 0e0e4d3678..854410df8c 100644
--- a/core/Application/Environment.php
+++ b/core/Application/Environment.php
@@ -185,4 +185,4 @@ class Environment
return null;
}
-} \ No newline at end of file
+}
diff --git a/core/Application/Kernel/EnvironmentValidator.php b/core/Application/Kernel/EnvironmentValidator.php
index c416f189d0..c8960c48eb 100644
--- a/core/Application/Kernel/EnvironmentValidator.php
+++ b/core/Application/Kernel/EnvironmentValidator.php
@@ -8,7 +8,6 @@
namespace Piwik\Application\Kernel;
-use Piwik\Application\Kernel\GlobalSettingsProvider;
use Piwik\Common;
use Piwik\Piwik;
use Piwik\SettingsServer;
@@ -78,4 +77,4 @@ class EnvironmentValidator
throw $exception;
}
}
-} \ No newline at end of file
+}
diff --git a/core/Application/Kernel/GlobalSettingsProvider.php b/core/Application/Kernel/GlobalSettingsProvider.php
index 2e69fa9d78..f459e7939e 100644
--- a/core/Application/Kernel/GlobalSettingsProvider.php
+++ b/core/Application/Kernel/GlobalSettingsProvider.php
@@ -108,4 +108,4 @@ class GlobalSettingsProvider
{
return $this->pathCommon;
}
-} \ No newline at end of file
+}
diff --git a/core/Application/Kernel/PluginList.php b/core/Application/Kernel/PluginList.php
index 1e9c63dcb4..a79a974a40 100644
--- a/core/Application/Kernel/PluginList.php
+++ b/core/Application/Kernel/PluginList.php
@@ -54,4 +54,4 @@ class PluginList
$section = $this->settings->getIniFileChain()->getFrom($pathGlobal, 'Plugins');
return $section['Plugins'];
}
-} \ No newline at end of file
+}
diff --git a/core/Archive.php b/core/Archive.php
index 257aa5315e..a5d6c29609 100644
--- a/core/Archive.php
+++ b/core/Archive.php
@@ -8,7 +8,6 @@
*/
namespace Piwik;
-use Piwik\Archive\Chunk;
use Piwik\Archive\Parameters;
use Piwik\ArchiveProcessor\Rules;
use Piwik\Archive\ArchiveInvalidator;
@@ -889,9 +888,9 @@ class Archive
if (in_array($report, Metrics::getVisitsMetricNames())) {
$report = 'VisitsSummary_CoreMetrics';
} // Goal_* metrics are processed by the Goals plugin (HACK)
- else if (strpos($report, 'Goal_') === 0) {
+ elseif (strpos($report, 'Goal_') === 0) {
$report = 'Goals_Metrics';
- } else if (strrpos($report, '_returning') === strlen($report) - strlen('_returning')) { // HACK
+ } elseif (strrpos($report, '_returning') === strlen($report) - strlen('_returning')) { // HACK
$report = 'VisitFrequency_Metrics';
}
diff --git a/core/Archive/ArchiveInvalidator.php b/core/Archive/ArchiveInvalidator.php
index e9ce777cc4..b4523db9d0 100644
--- a/core/Archive/ArchiveInvalidator.php
+++ b/core/Archive/ArchiveInvalidator.php
@@ -13,7 +13,6 @@ use Piwik\CronArchive\SitesToReprocessDistributedList;
use Piwik\DataAccess\ArchiveTableCreator;
use Piwik\DataAccess\Model;
use Piwik\Date;
-use Piwik\Db;
use Piwik\Option;
use Piwik\Plugins\CoreAdminHome\Tasks\ArchivesToPurgeDistributedList;
use Piwik\Plugins\PrivacyManager\PrivacyManager;
@@ -193,7 +192,7 @@ class ArchiveInvalidator
// In each table, invalidate day/week/month/year containing this date
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
- $archiveNumericTables = array_filter($archiveTables, function($name) {
+ $archiveNumericTables = array_filter($archiveTables, function ($name) {
return ArchiveTableCreator::getTypeFromTableName($name) == ArchiveTableCreator::NUMERIC_TABLE;
});
@@ -287,7 +286,6 @@ class ArchiveInvalidator
$week = Period\Factory::build('week', $date);
$weekAsString = $week->getDateStart()->toString('Y_m');
$datesByMonth[$weekAsString][] = $date->toString();
-
}
return $datesByMonth;
}
@@ -346,5 +344,4 @@ class ArchiveInvalidator
{
return new Model();
}
-
-} \ No newline at end of file
+}
diff --git a/core/Archive/ArchivePurger.php b/core/Archive/ArchivePurger.php
index f326558eb2..078203cb8f 100644
--- a/core/Archive/ArchivePurger.php
+++ b/core/Archive/ArchivePurger.php
@@ -14,7 +14,6 @@ use Piwik\Container\StaticContainer;
use Piwik\DataAccess\ArchiveTableCreator;
use Piwik\DataAccess\Model;
use Piwik\Date;
-use Piwik\Db;
use Piwik\Piwik;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
@@ -270,4 +269,4 @@ class ArchivePurger
{
$this->now = $now;
}
-} \ No newline at end of file
+}
diff --git a/core/Archive/DataCollection.php b/core/Archive/DataCollection.php
index 7973d01481..36ba553f52 100644
--- a/core/Archive/DataCollection.php
+++ b/core/Archive/DataCollection.php
@@ -331,7 +331,7 @@ class DataCollection
if ($metadataName == DataTableFactory::TABLE_METADATA_SITE_INDEX) {
$indexKeyValues = array_values($this->sitesId);
- } else if ($metadataName == DataTableFactory::TABLE_METADATA_PERIOD_INDEX) {
+ } elseif ($metadataName == DataTableFactory::TABLE_METADATA_PERIOD_INDEX) {
$indexKeyValues = array_keys($this->periods);
}
@@ -342,7 +342,6 @@ class DataCollection
$result[$key] = $this->createOrderedIndex($metadataNamesToIndexBy);
}
}
-
}
return $result;
diff --git a/core/Archive/DataTableFactory.php b/core/Archive/DataTableFactory.php
index a82b43bb74..e8b17b6731 100644
--- a/core/Archive/DataTableFactory.php
+++ b/core/Archive/DataTableFactory.php
@@ -542,4 +542,4 @@ class DataTableFactory
return $table;
}
-} \ No newline at end of file
+}
diff --git a/core/Archive/Parameters.php b/core/Archive/Parameters.php
index ad7bef9eb6..905166debf 100644
--- a/core/Archive/Parameters.php
+++ b/core/Archive/Parameters.php
@@ -57,4 +57,3 @@ class Parameters
return $this->idSites;
}
}
-
diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php
index ccfa939d94..66c0e68806 100644
--- a/core/ArchiveProcessor.php
+++ b/core/ArchiveProcessor.php
@@ -17,9 +17,6 @@ use Piwik\DataAccess\LogAggregator;
use Piwik\DataTable\Manager;
use Piwik\DataTable\Map;
use Piwik\DataTable\Row;
-use Piwik\Db;
-use Piwik\Period;
-
/**
* Used by {@link Piwik\Plugin\Archiver} instances to insert and aggregate archive data.
*
@@ -258,7 +255,7 @@ class ArchiveProcessor
{
$metrics = $this->getAggregatedNumericMetrics($columns, $operationToApply);
- foreach($metrics as $column => $value) {
+ foreach ($metrics as $column => $value) {
$value = Common::forceDotAsSeparatorForDecimalPoint($value);
$this->archiveWriter->insertRecord($column, $value);
}
@@ -432,10 +429,10 @@ class ArchiveProcessor
Metrics::INDEX_NB_USERS
);
- if($this->getParams()->isSingleSite()) {
+ if ($this->getParams()->isSingleSite()) {
$uniqueVisitorsMetric = Metrics::INDEX_NB_UNIQ_VISITORS;
} else {
- if(!SettingsPiwik::isSameFingerprintAcrossWebsites()) {
+ if (!SettingsPiwik::isSameFingerprintAcrossWebsites()) {
throw new Exception("Processing unique visitors across websites is enabled for this instance,
but to process this metric you must first set enable_fingerprinting_across_websites=1
in the config file, under the [Tracker] section.");
@@ -444,7 +441,7 @@ class ArchiveProcessor
}
$metrics[] = $uniqueVisitorsMetric;
- $uniques = $this->computeNbUniques( $metrics );
+ $uniques = $this->computeNbUniques($metrics);
$row->setColumn('nb_uniq_visitors', $uniques[$uniqueVisitorsMetric]);
$row->setColumn('nb_users', $uniques[Metrics::INDEX_NB_USERS]);
}
@@ -573,4 +570,4 @@ class ArchiveProcessor
return $metrics;
}
-} \ No newline at end of file
+}
diff --git a/core/ArchiveProcessor/Loader.php b/core/ArchiveProcessor/Loader.php
index b684d8fee1..f4c139b1ea 100644
--- a/core/ArchiveProcessor/Loader.php
+++ b/core/ArchiveProcessor/Loader.php
@@ -7,8 +7,8 @@
*
*/
namespace Piwik\ArchiveProcessor;
+
use Piwik\Archive;
-use Piwik\ArchiveProcessor;
use Piwik\Config;
use Piwik\DataAccess\ArchiveSelector;
use Piwik\Date;
@@ -223,6 +223,4 @@ class Loader
return $this->temporaryArchive;
}
-
}
-
diff --git a/core/ArchiveProcessor/PluginsArchiver.php b/core/ArchiveProcessor/PluginsArchiver.php
index 7487128728..fe35aa4f2b 100644
--- a/core/ArchiveProcessor/PluginsArchiver.php
+++ b/core/ArchiveProcessor/PluginsArchiver.php
@@ -9,7 +9,6 @@
namespace Piwik\ArchiveProcessor;
-use Piwik\Archive;
use Piwik\ArchiveProcessor;
use Piwik\DataAccess\ArchiveWriter;
use Piwik\DataTable\Manager;
@@ -130,7 +129,7 @@ class PluginsArchiver
public function finalizeArchive()
{
- $this->params->logStatusDebug( $this->archiveWriter->isArchiveTemporary );
+ $this->params->logStatusDebug($this->archiveWriter->isArchiveTemporary);
$this->archiveWriter->finalizeArchive();
return $this->archiveWriter->getIdArchive();
}
@@ -212,5 +211,4 @@ class PluginsArchiver
$metrics = $this->archiveProcessor->aggregateNumericMetrics($toSum);
return $metrics;
}
-
}
diff --git a/core/ArchiveProcessor/Rules.php b/core/ArchiveProcessor/Rules.php
index 4ad2fd1b25..caa5a627fb 100644
--- a/core/ArchiveProcessor/Rules.php
+++ b/core/ArchiveProcessor/Rules.php
@@ -277,4 +277,4 @@ class Rules
return $possibleValues;
}
-} \ No newline at end of file
+}
diff --git a/core/AssetManager.php b/core/AssetManager.php
index 28f8407b79..a1a1762a4b 100644
--- a/core/AssetManager.php
+++ b/core/AssetManager.php
@@ -19,10 +19,8 @@ use Piwik\AssetManager\UIAssetFetcher\StylesheetUIAssetFetcher;
use Piwik\AssetManager\UIAssetFetcher;
use Piwik\AssetManager\UIAssetMerger\JScriptUIAssetMerger;
use Piwik\AssetManager\UIAssetMerger\StylesheetUIAssetMerger;
-use Piwik\Config as PiwikConfig;
use Piwik\Container\StaticContainer;
use Piwik\Plugin\Manager;
-use Piwik\Translate;
/**
* AssetManager is the class used to manage the inclusion of UI assets:
@@ -67,7 +65,7 @@ class AssetManager extends Singleton
*/
private $theme;
- function __construct()
+ public function __construct()
{
$this->cacheBuster = UIAssetCacheBuster::getInstance();
$this->minimalStylesheetFetcher = new StaticUIAssetFetcher(array('plugins/Morpheus/stylesheets/base.less', 'plugins/Morpheus/stylesheets/general/_forms.less'), array(), $this->theme);
@@ -122,14 +120,11 @@ class AssetManager extends Singleton
$result = "<script type=\"text/javascript\">\n" . Translate::getJavascriptTranslations() . "\n</script>";
if ($this->isMergedAssetsDisabled()) {
-
$this->getMergedCoreJSAsset()->delete();
$this->getMergedNonCoreJSAsset()->delete();
$result .= $this->getIndividualJsIncludes();
-
} else {
-
$result .= sprintf(self::JS_IMPORT_DIRECTIVE, self::GET_CORE_JS_MODULE_ACTION);
$result .= sprintf(self::JS_IMPORT_DIRECTIVE, self::GET_NON_CORE_JS_MODULE_ACTION);
}
@@ -202,13 +197,13 @@ class AssetManager extends Singleton
{
$loadedPlugins = array();
- foreach(Manager::getInstance()->getPluginsLoadedAndActivated() as $plugin) {
-
+ foreach (Manager::getInstance()->getPluginsLoadedAndActivated() as $plugin) {
$pluginName = $plugin->getPluginName();
$pluginIsCore = Manager::getInstance()->isPluginBundledWithCore($pluginName);
- if (($pluginIsCore && $core) || (!$pluginIsCore && !$core))
+ if (($pluginIsCore && $core) || (!$pluginIsCore && !$core)) {
$loadedPlugins[] = $pluginName;
+ }
}
return $loadedPlugins;
@@ -222,21 +217,14 @@ class AssetManager extends Singleton
$assetsToRemove = array($this->getMergedStylesheetAsset());
if ($pluginName) {
-
if ($this->pluginContainsJScriptAssets($pluginName)) {
-
if (Manager::getInstance()->isPluginBundledWithCore($pluginName)) {
-
$assetsToRemove[] = $this->getMergedCoreJSAsset();
-
} else {
-
$assetsToRemove[] = $this->getMergedNonCoreJSAsset();
}
}
-
} else {
-
$assetsToRemove[] = $this->getMergedCoreJSAsset();
$assetsToRemove[] = $this->getMergedNonCoreJSAsset();
}
@@ -310,7 +298,6 @@ class AssetManager extends Singleton
$jsIncludeString = '';
foreach ($assetFetcher->getCatalog()->getAssets() as $jsFile) {
-
$jsFile->validateFile();
$jsIncludeString = $jsIncludeString . sprintf(self::JS_IMPORT_DIRECTIVE, $jsFile->getRelativeLocation());
}
@@ -338,7 +325,7 @@ class AssetManager extends Singleton
try {
$assets = $fetcher->getCatalog()->getAssets();
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
// This can happen when a plugin is not valid (eg. Piwik 1.x format)
// When posting the event to the plugin, it returns an exception "Plugin has not been loaded"
return false;
@@ -347,13 +334,13 @@ class AssetManager extends Singleton
$plugin = Manager::getInstance()->getLoadedPlugin($pluginName);
if ($plugin->isTheme()) {
-
$theme = Manager::getInstance()->getTheme($pluginName);
$javaScriptFiles = $theme->getJavaScriptFiles();
- if (!empty($javaScriptFiles))
+ if (!empty($javaScriptFiles)) {
$assets = array_merge($assets, $javaScriptFiles);
+ }
}
return !empty($assets);
@@ -364,7 +351,7 @@ class AssetManager extends Singleton
*/
public function removeAssets($uiAssets)
{
- foreach($uiAssets as $uiAsset) {
+ foreach ($uiAssets as $uiAsset) {
$uiAsset->delete();
}
}
diff --git a/core/AssetManager/UIAsset/OnDiskUIAsset.php b/core/AssetManager/UIAsset/OnDiskUIAsset.php
index fc4b834342..cbd702a691 100644
--- a/core/AssetManager/UIAsset/OnDiskUIAsset.php
+++ b/core/AssetManager/UIAsset/OnDiskUIAsset.php
@@ -28,7 +28,7 @@ class OnDiskUIAsset extends UIAsset
* @param string $baseDirectory
* @param string $fileLocation
*/
- function __construct($baseDirectory, $fileLocation)
+ public function __construct($baseDirectory, $fileLocation)
{
$this->baseDirectory = $baseDirectory;
$this->relativeLocation = $fileLocation;
@@ -51,14 +51,14 @@ class OnDiskUIAsset extends UIAsset
public function validateFile()
{
- if (!$this->assetIsReadable())
+ if (!$this->assetIsReadable()) {
throw new Exception("The ui asset with 'href' = " . $this->getAbsoluteLocation() . " is not readable");
+ }
}
public function delete()
{
if ($this->exists()) {
-
try {
Filesystem::remove($this->getAbsoluteLocation());
} catch (Exception $e) {
@@ -81,8 +81,9 @@ class OnDiskUIAsset extends UIAsset
$newFile = @fopen($this->getAbsoluteLocation(), "w");
- if (!$newFile)
- throw new Exception ("The file : " . $newFile . " can not be opened in write mode.");
+ if (!$newFile) {
+ throw new Exception("The file : " . $newFile . " can not be opened in write mode.");
+ }
fwrite($newFile, $content);
diff --git a/core/AssetManager/UIAssetCatalog.php b/core/AssetManager/UIAssetCatalog.php
index 826259ecb3..18af99778a 100644
--- a/core/AssetManager/UIAssetCatalog.php
+++ b/core/AssetManager/UIAssetCatalog.php
@@ -28,7 +28,7 @@ class UIAssetCatalog
/**
* @param UIAssetCatalogSorter $catalogSorter
*/
- function __construct($catalogSorter)
+ public function __construct($catalogSorter)
{
$this->catalogSorter = $catalogSorter;
}
diff --git a/core/AssetManager/UIAssetCatalogSorter.php b/core/AssetManager/UIAssetCatalogSorter.php
index b6d00b359a..fece3da0d8 100644
--- a/core/AssetManager/UIAssetCatalogSorter.php
+++ b/core/AssetManager/UIAssetCatalogSorter.php
@@ -18,7 +18,7 @@ class UIAssetCatalogSorter
/**
* @param string[] $priorityOrder
*/
- function __construct($priorityOrder)
+ public function __construct($priorityOrder)
{
$this->priorityOrder = $priorityOrder;
}
@@ -31,12 +31,11 @@ class UIAssetCatalogSorter
{
$sortedCatalog = new UIAssetCatalog($this);
foreach ($this->priorityOrder as $filePattern) {
-
- $assetsMatchingPattern = array_filter($uiAssetCatalog->getAssets(), function($uiAsset) use ($filePattern) {
+ $assetsMatchingPattern = array_filter($uiAssetCatalog->getAssets(), function ($uiAsset) use ($filePattern) {
return preg_match('~^' . $filePattern . '~', $uiAsset->getRelativeLocation());
});
- foreach($assetsMatchingPattern as $assetMatchingPattern) {
+ foreach ($assetsMatchingPattern as $assetMatchingPattern) {
$sortedCatalog->addUIAsset($assetMatchingPattern);
}
}
diff --git a/core/AssetManager/UIAssetFetcher.php b/core/AssetManager/UIAssetFetcher.php
index 3bd34c118e..6d710e1387 100644
--- a/core/AssetManager/UIAssetFetcher.php
+++ b/core/AssetManager/UIAssetFetcher.php
@@ -37,7 +37,7 @@ abstract class UIAssetFetcher
* @param string[] $plugins
* @param Theme $theme
*/
- function __construct($plugins, $theme)
+ public function __construct($plugins, $theme)
{
$this->plugins = $plugins;
$this->theme = $theme;
@@ -56,8 +56,9 @@ abstract class UIAssetFetcher
*/
public function getCatalog()
{
- if ($this->catalog == null)
+ if ($this->catalog == null) {
$this->createCatalog();
+ }
return $this->catalog;
}
@@ -89,7 +90,6 @@ abstract class UIAssetFetcher
private function populateCatalog()
{
foreach ($this->fileLocations as $fileLocation) {
-
$newUIAsset = new OnDiskUIAsset($this->getBaseDirectory(), $fileLocation);
$this->catalog->addUIAsset($newUIAsset);
}
diff --git a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php
index f916772e2f..d8ec05ca53 100644
--- a/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php
+++ b/core/AssetManager/UIAssetFetcher/JScriptUIAssetFetcher.php
@@ -16,7 +16,6 @@ class JScriptUIAssetFetcher extends UIAssetFetcher
protected function retrieveFileLocations()
{
-
if (!empty($this->plugins)) {
/**
@@ -56,13 +55,10 @@ class JScriptUIAssetFetcher extends UIAssetFetcher
return;
}
if (in_array($theme->getThemeName(), $this->plugins)) {
-
$jsInThemes = $this->getTheme()->getJavaScriptFiles();
if (!empty($jsInThemes)) {
-
- foreach($jsInThemes as $jsFile) {
-
+ foreach ($jsInThemes as $jsFile) {
$this->fileLocations[] = $jsFile;
}
}
diff --git a/core/AssetManager/UIAssetFetcher/StaticUIAssetFetcher.php b/core/AssetManager/UIAssetFetcher/StaticUIAssetFetcher.php
index 984282e4a7..cdebbb1eb5 100644
--- a/core/AssetManager/UIAssetFetcher/StaticUIAssetFetcher.php
+++ b/core/AssetManager/UIAssetFetcher/StaticUIAssetFetcher.php
@@ -17,7 +17,7 @@ class StaticUIAssetFetcher extends UIAssetFetcher
*/
private $priorityOrder;
- function __construct($fileLocations, $priorityOrder, $theme)
+ public function __construct($fileLocations, $priorityOrder, $theme)
{
parent::__construct(array(), $theme);
@@ -27,7 +27,6 @@ class StaticUIAssetFetcher extends UIAssetFetcher
protected function retrieveFileLocations()
{
-
}
protected function getPriorityOrder()
diff --git a/core/AssetManager/UIAssetMerger.php b/core/AssetManager/UIAssetMerger.php
index 42b5ce0cfe..645f003d7c 100644
--- a/core/AssetManager/UIAssetMerger.php
+++ b/core/AssetManager/UIAssetMerger.php
@@ -8,9 +8,6 @@
*/
namespace Piwik\AssetManager;
-use Piwik\AssetManager\PiwikLessCompiler;
-use Piwik\AssetManager\UIAsset\StylesheetUIAsset;
-use Piwik\AssetManager;
abstract class UIAssetMerger
{
@@ -39,7 +36,7 @@ abstract class UIAssetMerger
* @param UIAssetFetcher $assetFetcher
* @param UIAssetCacheBuster $cacheBuster
*/
- function __construct($mergedAsset, $assetFetcher, $cacheBuster)
+ public function __construct($mergedAsset, $assetFetcher, $cacheBuster)
{
$this->mergedAsset = $mergedAsset;
$this->assetFetcher = $assetFetcher;
@@ -48,8 +45,9 @@ abstract class UIAssetMerger
public function generateFile()
{
- if (!$this->shouldGenerate())
+ if (!$this->shouldGenerate()) {
return;
+ }
$this->mergedContent = $this->getMergedAssets();
@@ -107,7 +105,6 @@ abstract class UIAssetMerger
$mergedContent = '';
foreach ($this->getAssetCatalog()->getAssets() as $uiAsset) {
-
$uiAsset->validateFile();
$content = $this->processFileContent($uiAsset);
@@ -182,8 +179,9 @@ abstract class UIAssetMerger
*/
protected function getCacheBusterValue()
{
- if (empty($this->cacheBusterValue))
+ if (empty($this->cacheBusterValue)) {
$this->cacheBusterValue = $this->generateCacheBuster();
+ }
return $this->cacheBusterValue;
}
diff --git a/core/AssetManager/UIAssetMerger/JScriptUIAssetMerger.php b/core/AssetManager/UIAssetMerger/JScriptUIAssetMerger.php
index 935018c580..1b738e8de5 100644
--- a/core/AssetManager/UIAssetMerger/JScriptUIAssetMerger.php
+++ b/core/AssetManager/UIAssetMerger/JScriptUIAssetMerger.php
@@ -28,7 +28,7 @@ class JScriptUIAssetMerger extends UIAssetMerger
* @param JScriptUIAssetFetcher $assetFetcher
* @param UIAssetCacheBuster $cacheBuster
*/
- function __construct($mergedAsset, $assetFetcher, $cacheBuster)
+ public function __construct($mergedAsset, $assetFetcher, $cacheBuster)
{
parent::__construct($mergedAsset, $assetFetcher, $cacheBuster);
@@ -81,8 +81,9 @@ class JScriptUIAssetMerger extends UIAssetMerger
{
$content = $uiAsset->getContent();
- if (!$this->assetMinifier->isMinifiedJs($content))
+ if (!$this->assetMinifier->isMinifiedJs($content)) {
$content = $this->assetMinifier->minifyJs($content);
+ }
return $content;
}
diff --git a/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php b/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php
index 232b1ab825..5161b2f1df 100644
--- a/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php
+++ b/core/AssetManager/UIAssetMerger/StylesheetUIAssetMerger.php
@@ -21,7 +21,7 @@ class StylesheetUIAssetMerger extends UIAssetMerger
*/
private $lessCompiler;
- function __construct($mergedAsset, $assetFetcher, $cacheBuster)
+ public function __construct($mergedAsset, $assetFetcher, $cacheBuster)
{
parent::__construct($mergedAsset, $assetFetcher, $cacheBuster);
@@ -97,7 +97,7 @@ class StylesheetUIAssetMerger extends UIAssetMerger
*/
private function rewriteCssImagePaths($content, $pathsRewriter)
{
- $content = preg_replace_callback( "/(url\(['\"]?)([^'\")]*)/", $pathsRewriter, $content );
+ $content = preg_replace_callback("/(url\(['\"]?)([^'\")]*)/", $pathsRewriter, $content);
return $content;
}
@@ -110,7 +110,7 @@ class StylesheetUIAssetMerger extends UIAssetMerger
*/
private function rewriteCssImportPaths($content, $pathsRewriter)
{
- $content = preg_replace_callback( "/(@import \")([^\")]*)/", $pathsRewriter, $content );
+ $content = preg_replace_callback("/(@import \")([^\")]*)/", $pathsRewriter, $content);
return $content;
}
diff --git a/core/AssetManager/UIAssetMinifier.php b/core/AssetManager/UIAssetMinifier.php
index 07dd3c769d..99eebe0a6c 100644
--- a/core/AssetManager/UIAssetMinifier.php
+++ b/core/AssetManager/UIAssetMinifier.php
@@ -59,8 +59,8 @@ class UIAssetMinifier extends Singleton
private static function validateDependency()
{
- if (!class_exists("JShrink\\Minifier"))
+ if (!class_exists("JShrink\\Minifier")) {
throw new Exception("JShrink could not be found, maybe you are using Piwik from git and need to update Composer. $ php composer.phar update");
+ }
}
-
}
diff --git a/core/Auth.php b/core/Auth.php
index 45bc22062b..0ea9503a2b 100644
--- a/core/Auth.php
+++ b/core/Auth.php
@@ -218,4 +218,4 @@ class AuthResult
{
return $this->code > self::FAILURE;
}
-} \ No newline at end of file
+}
diff --git a/core/BaseFactory.php b/core/BaseFactory.php
index 0bc8716eb2..24425c8fee 100644
--- a/core/BaseFactory.php
+++ b/core/BaseFactory.php
@@ -12,13 +12,13 @@ use Exception;
/**
* Base class for all factory types.
- *
+ *
* Factory types are base classes that contain a **factory** method. This method is used to instantiate
* concrete instances by a specified string ID. Fatal errors do not occur if a class does not exist.
* Instead an exception is thrown.
*
* Derived classes should override the **getClassNameFromClassId** and **getInvalidClassIdExceptionMessage**
- * static methods.
+ * static methods.
*/
abstract class BaseFactory
{
@@ -57,4 +57,4 @@ abstract class BaseFactory
{
return "Invalid class ID '$id' for " . get_called_class() . "::factory().";
}
-} \ No newline at end of file
+}
diff --git a/core/CacheId.php b/core/CacheId.php
index e445424009..cc346bee54 100644
--- a/core/CacheId.php
+++ b/core/CacheId.php
@@ -8,7 +8,6 @@
*/
namespace Piwik;
-use Piwik\Translate;
use Piwik\Plugin\Manager;
class CacheId
diff --git a/core/CliMulti.php b/core/CliMulti.php
index 6b463aec0d..bd310dcddc 100644
--- a/core/CliMulti.php
+++ b/core/CliMulti.php
@@ -16,7 +16,8 @@ use Piwik\Container\StaticContainer;
/**
* Class CliMulti.
*/
-class CliMulti {
+class CliMulti
+{
/**
* If set to true or false it will overwrite whether async is supported or not.
@@ -70,11 +71,11 @@ class CliMulti {
{
$chunks = array($piwikUrls);
if ($this->concurrentProcessesLimit) {
- $chunks = array_chunk( $piwikUrls, $this->concurrentProcessesLimit);
+ $chunks = array_chunk($piwikUrls, $this->concurrentProcessesLimit);
}
$results = array();
- foreach($chunks as $urlsChunk) {
+ foreach ($chunks as $urlsChunk) {
$results = array_merge($results, $this->requestUrls($urlsChunk));
}
@@ -159,7 +160,6 @@ class CliMulti {
// ==> declare the process as finished
$process->finishProcess();
continue;
-
} elseif (!$hasStarted) {
return false;
}
@@ -236,7 +236,7 @@ class CliMulti {
if (file_exists($file)) {
$timeLastModified = filemtime($file);
- if ($timeLastModified !== FALSE && $timeOneWeekAgo > $timeLastModified) {
+ if ($timeLastModified !== false && $timeOneWeekAgo > $timeLastModified) {
unlink($file);
}
}
@@ -344,7 +344,7 @@ class CliMulti {
/**
* Used to be in CronArchive, moved to CliMulti.
- *
+ *
* @ignore
*/
Piwik::postEvent('CronArchive.getTokenAuth', array(&$tokens));
diff --git a/core/CliMulti/CliPhp.php b/core/CliMulti/CliPhp.php
index 101f9277c6..c405d66aba 100644
--- a/core/CliMulti/CliPhp.php
+++ b/core/CliMulti/CliPhp.php
@@ -7,7 +7,6 @@
*/
namespace Piwik\CliMulti;
-use Piwik\CliMulti;
use Piwik\Common;
class CliPhp
@@ -16,7 +15,6 @@ class CliPhp
public function findPhpBinary()
{
if (defined('PHP_BINARY')) {
-
if ($this->isHhvmBinary(PHP_BINARY)) {
return PHP_BINARY . ' --php';
}
diff --git a/core/CliMulti/Output.php b/core/CliMulti/Output.php
index e4feb1a805..b97df74692 100644
--- a/core/CliMulti/Output.php
+++ b/core/CliMulti/Output.php
@@ -10,7 +10,8 @@ namespace Piwik\CliMulti;
use Piwik\CliMulti;
use Piwik\Filesystem;
-class Output {
+class Output
+{
private $tmpFile = '';
private $outputId = null;
@@ -64,5 +65,4 @@ class Output {
{
Filesystem::deleteFileIfExists($this->tmpFile);
}
-
}
diff --git a/core/CliMulti/Process.php b/core/CliMulti/Process.php
index 58d3b0978d..e1d702fdf1 100644
--- a/core/CliMulti/Process.php
+++ b/core/CliMulti/Process.php
@@ -243,15 +243,15 @@ class Process
/**
* @return int[] The ids of the currently running processes
*/
- static function getRunningProcesses()
- {
- $ids = explode("\n", trim(`ps ex 2>/dev/null | awk '{print $1}' 2>/dev/null`));
+ public static function getRunningProcesses()
+ {
+ $ids = explode("\n", trim(`ps ex 2>/dev/null | awk '{print $1}' 2>/dev/null`));
- $ids = array_map('intval', $ids);
- $ids = array_filter($ids, function ($id) {
+ $ids = array_map('intval', $ids);
+ $ids = array_filter($ids, function ($id) {
return $id > 0;
});
- return $ids;
- }
+ return $ids;
+ }
}
diff --git a/core/CliMulti/RequestCommand.php b/core/CliMulti/RequestCommand.php
index 36c5b89c75..d2dbb1eafb 100644
--- a/core/CliMulti/RequestCommand.php
+++ b/core/CliMulti/RequestCommand.php
@@ -10,13 +10,11 @@ namespace Piwik\CliMulti;
use Piwik\Application\Environment;
use Piwik\Access;
-use Piwik\Config;
use Piwik\Container\StaticContainer;
use Piwik\Db;
use Piwik\Log;
use Piwik\Option;
use Piwik\Plugin\ConsoleCommand;
-use Piwik\Tests\Framework\Mock\TestConfig;
use Piwik\Url;
use Piwik\UrlHelper;
use Symfony\Component\Console\Input\InputArgument;
diff --git a/core/Columns/Dimension.php b/core/Columns/Dimension.php
index e760a09083..8da3822fa9 100644
--- a/core/Columns/Dimension.php
+++ b/core/Columns/Dimension.php
@@ -15,7 +15,6 @@ use Piwik\Plugin\Dimension\ActionDimension;
use Piwik\Plugin\Dimension\ConversionDimension;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Plugin\Segment;
-use Piwik\Translate;
/**
* @api
@@ -240,4 +239,4 @@ abstract class Dimension
$parts = explode('.', $id);
return reset($parts);
}
-} \ No newline at end of file
+}
diff --git a/core/Columns/Updater.php b/core/Columns/Updater.php
index e1345a2dc2..f6121165bb 100644
--- a/core/Columns/Updater.php
+++ b/core/Columns/Updater.php
@@ -226,7 +226,7 @@ class Updater extends \Piwik\Updates
// maps names of core dimension columns that were part of the original dimension refactor with their
// initial "version" strings. The '1' that is sometimes appended to the end of the string (sometimes seen as
// NULL1) is from individual dimension "versioning" logic (eg, see VisitDimension::getVersion())
- $initialCoreDimensionVersions = array (
+ $initialCoreDimensionVersions = array(
'log_visit.config_resolution' => 'VARCHAR(9) NOT NULL',
'log_visit.config_device_brand' => 'VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL',
'log_visit.config_device_model' => 'VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL',
@@ -339,4 +339,4 @@ class Updater extends \Piwik\Updates
return array();
}
-} \ No newline at end of file
+}
diff --git a/core/Common.php b/core/Common.php
index 22f8cac2f1..64213d1318 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -13,7 +13,6 @@ use Piwik\Container\StaticContainer;
use Piwik\Intl\Data\Provider\LanguageDataProvider;
use Piwik\Intl\Data\Provider\RegionDataProvider;
use Piwik\Plugins\UserCountry\LocationProvider\DefaultProvider;
-use Piwik\Tracker;
use Piwik\Tracker\Cache as TrackerCache;
/**
@@ -269,8 +268,9 @@ class Common
} elseif (is_string($value)) {
$value = self::sanitizeString($value);
- if (!$alreadyStripslashed) // a JSON array was already stripslashed, don't do it again for each value
- {
+ if (!$alreadyStripslashed) {
+ // a JSON array was already stripslashed, don't do it again for each value
+
$value = self::undoMagicQuotes($value);
}
} elseif (is_array($value)) {
@@ -480,20 +480,25 @@ class Common
if ($varType === 'string') {
if (is_string($value) || is_int($value)) {
$ok = true;
- } else if (is_float($value)) {
+ } elseif (is_float($value)) {
$value = Common::forceDotAsSeparatorForDecimalPoint($value);
$ok = true;
}
-
} elseif ($varType === 'integer') {
- if ($value == (string)(int)$value) $ok = true;
+ if ($value == (string)(int)$value) {
+ $ok = true;
+ }
} elseif ($varType === 'float') {
$valueToCompare = (string)(float)$value;
$valueToCompare = Common::forceDotAsSeparatorForDecimalPoint($valueToCompare);
- if ($value == $valueToCompare) $ok = true;
+ if ($value == $valueToCompare) {
+ $ok = true;
+ }
} elseif ($varType === 'array') {
- if (is_array($value)) $ok = true;
+ if (is_array($value)) {
+ $ok = true;
+ }
} else {
throw new Exception("\$varType specified is not known. It should be one of the following: array, int, integer, float, string");
}
@@ -552,7 +557,6 @@ class Common
if ($hashAlgorithm) {
$hash = @hash($hashAlgorithm, $str, $raw_output);
if ($hash !== false) {
-
return $hash;
}
}
@@ -818,7 +822,6 @@ class Common
$searchEngines = $cache->fetch($cacheId);
if (empty($searchEngines)) {
-
require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/SearchEngines.php';
$searchEngines = $GLOBALS['Piwik_SearchEngines'];
@@ -845,7 +848,6 @@ class Common
$nameToUrl = $cache->fetch($cacheId);
if (empty($nameToUrl)) {
-
$searchEngines = self::getSearchEngineUrls();
$nameToUrl = array();
@@ -874,7 +876,6 @@ class Common
$socialUrls = $cache->fetch($cacheId);
if (empty($socialUrls)) {
-
require_once PIWIK_INCLUDE_PATH . '/core/DataFiles/Socials.php';
$socialUrls = $GLOBALS['Piwik_socialUrl'];
@@ -1025,12 +1026,12 @@ class Common
$validLanguages = self::checkValidLanguagesIsSet($validLanguages);
$languageRegionCode = self::extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages);
- if(strlen($languageRegionCode) == 2) {
+ if (strlen($languageRegionCode) == 2) {
$languageCode = $languageRegionCode;
} else {
$languageCode = substr($languageRegionCode, 0, 2);
}
- if(in_array($languageCode, $validLanguages)) {
+ if (in_array($languageCode, $validLanguages)) {
return $languageCode;
}
return self::LANGUAGE_CODE_INVALID;
@@ -1045,16 +1046,16 @@ class Common
* @param array $validLanguages array of valid language codes. Note that if the array includes "fr" then it will consider all regional variants of this language valid, such as "fr-ca" etc.
* @return string 2 letter ISO 639 code 'es' (Spanish) or if found, includes the region as well: 'es-ar'
*/
- public static function extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages = array() )
+ public static function extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages = array())
{
$validLanguages = self::checkValidLanguagesIsSet($validLanguages);
- if(!preg_match_all('/(?:^|,)([a-z]{2,3})([-][a-z]{2})?/', $browserLanguage, $matches, PREG_SET_ORDER)) {
+ if (!preg_match_all('/(?:^|,)([a-z]{2,3})([-][a-z]{2})?/', $browserLanguage, $matches, PREG_SET_ORDER)) {
return self::LANGUAGE_CODE_INVALID;
}
foreach ($matches as $parts) {
$langIso639 = $parts[1];
- if(empty($langIso639)) {
+ if (empty($langIso639)) {
continue;
}
@@ -1219,7 +1220,6 @@ class Common
&& strlen($_SERVER['SERVER_PROTOCOL']) > 1) {
$key = $_SERVER['SERVER_PROTOCOL'];
}
-
} else {
// FastCGI
$key = 'Status:';
@@ -1261,11 +1261,10 @@ class Common
* @todo This method is weird, it's debugging statements but seem to only work for the tracker, maybe it
* should be moved elsewhere
*/
- public static function printDebug($info = '')
+ public static function printDebug($info = '')
{
if (isset($GLOBALS['PIWIK_TRACKER_DEBUG']) && $GLOBALS['PIWIK_TRACKER_DEBUG']) {
-
- if(!headers_sent()) {
+ if (!headers_sent()) {
// prevent XSS in tracker debug output
header('Content-type: text/plain');
}
diff --git a/core/Concurrency/DistributedList.php b/core/Concurrency/DistributedList.php
index 723fda6c76..572b25d6ff 100644
--- a/core/Concurrency/DistributedList.php
+++ b/core/Concurrency/DistributedList.php
@@ -167,4 +167,4 @@ class DistributedList
}
return $result;
}
-} \ No newline at end of file
+}
diff --git a/core/Config/IniFileChain.php b/core/Config/IniFileChain.php
index 3f6f076cd8..e8384a4f3a 100644
--- a/core/Config/IniFileChain.php
+++ b/core/Config/IniFileChain.php
@@ -175,12 +175,12 @@ class IniFileChain
if ($lhsIndexInFile == $rhsIndexInFile) {
return 0;
- } else if ($lhsIndexInFile < $rhsIndexInFile) {
+ } elseif ($lhsIndexInFile < $rhsIndexInFile) {
return -1;
} else {
return 1;
}
- } else if ($lhsIndex < $rhsIndex) {
+ } elseif ($lhsIndex < $rhsIndex) {
return -1;
} else {
return 1;
@@ -219,7 +219,7 @@ class IniFileChain
}
$this->mergedSettings = $this->mergeFileSettings();
- }
+ }
private function resetSettingsChain($defaultSettingsFiles, $userSettingsFile)
{
@@ -355,12 +355,12 @@ class IniFileChain
* @author Daniel <daniel (at) danielsmedegaardbuus (dot) dk>
* @author Gabriel Sobrinho <gabriel (dot) sobrinho (at) gmail (dot) com>
*/
- private function array_merge_recursive_distinct ( array &$array1, array &$array2 )
+ private function array_merge_recursive_distinct(array &$array1, array &$array2)
{
$merged = $array1;
- foreach ( $array2 as $key => &$value ) {
- if ( is_array ( $value ) && isset ( $merged [$key] ) && is_array ( $merged [$key] ) ) {
- $merged [$key] = $this->array_merge_recursive_distinct ( $merged [$key], $value );
+ foreach ($array2 as $key => &$value) {
+ if (is_array($value) && isset($merged [$key]) && is_array($merged [$key])) {
+ $merged [$key] = $this->array_merge_recursive_distinct($merged [$key], $value);
} else {
$merged [$key] = $value;
}
@@ -451,4 +451,4 @@ class IniFileChain
$writer = new IniWriter();
return $writer->writeToString($values, $header);
}
-} \ No newline at end of file
+}
diff --git a/core/Console.php b/core/Console.php
index 988034362f..5a3ff2f541 100644
--- a/core/Console.php
+++ b/core/Console.php
@@ -82,7 +82,7 @@ class Console extends Application
{
if (!class_exists($command)) {
Log::warning(sprintf('Cannot add command %s, class does not exist', $command));
- } else if (!is_subclass_of($command, 'Piwik\Plugin\ConsoleCommand')) {
+ } elseif (!is_subclass_of($command, 'Piwik\Plugin\ConsoleCommand')) {
Log::warning(sprintf('Cannot add command %s, class does not extend Piwik\Plugin\ConsoleCommand', $command));
} else {
/** @var Command $commandInstance */
@@ -144,7 +144,7 @@ class Console extends Application
}
if (!defined('STDIN')) {
- define('STDIN', fopen('php://stdin','r'));
+ define('STDIN', fopen('php://stdin', 'r'));
}
}
}
@@ -213,5 +213,4 @@ class Console extends Application
return $commands;
}
-
}
diff --git a/core/Container/ContainerDoesNotExistException.php b/core/Container/ContainerDoesNotExistException.php
index 9577d51624..4d1d33ed1d 100644
--- a/core/Container/ContainerDoesNotExistException.php
+++ b/core/Container/ContainerDoesNotExistException.php
@@ -15,4 +15,4 @@ use RuntimeException;
*/
class ContainerDoesNotExistException extends RuntimeException
{
-} \ No newline at end of file
+}
diff --git a/core/Container/ContainerFactory.php b/core/Container/ContainerFactory.php
index bc15fe9e6f..0c36e3ba82 100644
--- a/core/Container/ContainerFactory.php
+++ b/core/Container/ContainerFactory.php
@@ -13,7 +13,6 @@ use DI\ContainerBuilder;
use Doctrine\Common\Cache\ArrayCache;
use Piwik\Application\Kernel\GlobalSettingsProvider;
use Piwik\Application\Kernel\PluginList;
-use Piwik\Config\IniFileChainFactory;
use Piwik\Development;
use Piwik\Plugin\Manager;
diff --git a/core/Cookie.php b/core/Cookie.php
index 39c0de95e4..24f8a3f6c1 100644
--- a/core/Cookie.php
+++ b/core/Cookie.php
@@ -143,7 +143,9 @@ class Cookie
// Remove port information.
$Port = strpos($Domain, ':');
- if ($Port !== false) $Domain = substr($Domain, 0, $Port);
+ if ($Port !== false) {
+ $Domain = substr($Domain, 0, $Port);
+ }
}
$header = 'Set-Cookie: ' . rawurlencode($Name) . '=' . rawurlencode($Value)
diff --git a/core/CronArchive.php b/core/CronArchive.php
index 2904586ac4..ee103e8aa3 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -493,7 +493,7 @@ class CronArchive
try {
$shouldProceed = $this->processArchiveDays($idSite, $lastTimestampWebsiteProcessedDay, $shouldArchivePeriods, $timerWebsite);
- } catch(UnexpectedWebsiteFoundException $e) {
+ } catch (UnexpectedWebsiteFoundException $e) {
// this website was deleted in the meantime
$shouldProceed = false;
$this->logger->info("Skipped website id $idSite, got: UnexpectedWebsiteFoundException, " . $timerWebsite->__toString());
@@ -519,9 +519,9 @@ class CronArchive
Option::set($this->lastRunKey($idSite, "periods"), time());
}
- if(!$success) {
+ if (!$success) {
// cancel marking the site as reprocessed
- if($websiteInvalidatedShouldReprocess) {
+ if ($websiteInvalidatedShouldReprocess) {
$store = new SitesToReprocessDistributedList();
$store->add($idSite);
}
@@ -550,7 +550,6 @@ class CronArchive
$success = true;
foreach (array('week', 'month', 'year') as $period) {
-
if (!$this->shouldProcessPeriod($period)) {
// if any period was skipped, we do not mark the Periods archiving as successful
$success = false;
@@ -578,8 +577,9 @@ class CronArchive
private function getVisitsRequestUrl($idSite, $period, $date, $segment = false)
{
$request = "?module=API&method=API.get&idSite=$idSite&period=$period&date=" . $date . "&format=php";
- if($segment) {
- $request .= '&segment=' . urlencode($segment);;
+ if ($segment) {
+ $request .= '&segment=' . urlencode($segment);
+ ;
}
return $request;
}
@@ -649,7 +649,7 @@ class CronArchive
Option::set($this->lastRunKey($idSite, "day"), 0);
// cancel marking the site as reprocessed
- if($websiteInvalidatedShouldReprocess) {
+ if ($websiteInvalidatedShouldReprocess) {
$store = new SitesToReprocessDistributedList();
$store->add($idSite);
}
@@ -731,7 +731,7 @@ class CronArchive
}
$segmentRequestsCount = 0;
- if($archiveSegments) {
+ if ($archiveSegments) {
$urlsWithSegment = $this->getUrlsWithSegment($idSite, $period, $date);
$urls = array_merge($urls, $urlsWithSegment);
$segmentRequestsCount = count($urlsWithSegment);
@@ -753,13 +753,12 @@ class CronArchive
$success = $success && $this->checkResponse($content, $url);
if ($noSegmentUrl === $url && $success) {
-
$stats = @unserialize($content);
if (!is_array($stats)) {
$this->logError("Error unserializing the following response from $url: " . $content);
}
- if($period == 'range') {
+ if ($period == 'range') {
// range returns one dataset (the sum of data between the two dates),
// whereas other periods return lastN which is N datasets in an array. Here we make our period=range dataset look like others:
$stats = array($stats);
@@ -826,14 +825,12 @@ class CronArchive
}
try {
-
$cliMulti = new CliMulti();
$cliMulti->setAcceptInvalidSSLCertificate($this->acceptInvalidSSLCertificate);
$cliMulti->runAsSuperUser();
$responses = $cliMulti->request(array($url));
$response = !empty($responses) ? array_shift($responses) : null;
-
} catch (Exception $e) {
return $this->logNetworkError($url, $e->getMessage());
}
@@ -874,7 +871,7 @@ class CronArchive
// there was a previous successful run
$this->shouldArchiveOnlySitesWithTrafficSince = time() - $this->lastSuccessRunTimestamp;
}
- } else {
+ } else {
// force-all-periods is set here
$this->archiveAndRespectTTL = false;
@@ -996,7 +993,7 @@ class CronArchive
{
$sitesIdWithVisits = APISitesManager::getInstance()->getSitesIdWithVisits(time() - $this->shouldArchiveOnlySitesWithTrafficSince);
$websiteIds = !empty($sitesIdWithVisits) ? ", IDs: " . implode(", ", $sitesIdWithVisits) : "";
- $prettySeconds = $this->formatter->getPrettyTimeFromSeconds( $this->shouldArchiveOnlySitesWithTrafficSince, true);
+ $prettySeconds = $this->formatter->getPrettyTimeFromSeconds($this->shouldArchiveOnlySitesWithTrafficSince, true);
$this->logger->info("- Will process " . count($sitesIdWithVisits) . " websites with new visits since "
. $prettySeconds
. " "
@@ -1155,7 +1152,7 @@ class CronArchive
}
$visits = 0;
- foreach($stats as $metrics) {
+ foreach ($stats as $metrics) {
if (empty($metrics['nb_visits'])) {
continue;
}
@@ -1344,10 +1341,10 @@ class CronArchive
private function getCustomDateRangeToPreProcess($idSite)
{
static $cache = null;
- if(is_null($cache)) {
+ if (is_null($cache)) {
$cache = $this->loadCustomDateRangeToPreProcess();
}
- if(empty($cache[$idSite])) {
+ if (empty($cache[$idSite])) {
return array();
}
$dates = array_unique($cache[$idSite]);
@@ -1370,7 +1367,6 @@ class CronArchive
));
foreach ($allUsersPreferences as $userLogin => $userPreferences) {
-
if (!isset($userPreferences[APIUsersManager::PREFERENCE_DEFAULT_REPORT_DATE])) {
continue;
}
@@ -1458,7 +1454,7 @@ class CronArchive
}
return new SharedSiteIds($websitesIds);
- }
+ }
/**
* @param $idSite
@@ -1473,4 +1469,4 @@ class CronArchive
));
$this->logger->info('- pre-processing all visits');
}
-} \ No newline at end of file
+}
diff --git a/core/CronArchive/FixedSiteIds.php b/core/CronArchive/FixedSiteIds.php
index 8a48fb24cc..685d7ebe10 100644
--- a/core/CronArchive/FixedSiteIds.php
+++ b/core/CronArchive/FixedSiteIds.php
@@ -8,7 +8,6 @@
*/
namespace Piwik\CronArchive;
-use Piwik\CronArchive;
class FixedSiteIds
{
@@ -63,6 +62,4 @@ class FixedSiteIds
return null;
}
-
}
-
diff --git a/core/CronArchive/SegmentArchivingRequestUrlProvider.php b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
index e2c9c3a570..f60b7e073a 100644
--- a/core/CronArchive/SegmentArchivingRequestUrlProvider.php
+++ b/core/CronArchive/SegmentArchivingRequestUrlProvider.php
@@ -102,7 +102,7 @@ class SegmentArchivingRequestUrlProvider
$this->logger->debug("process_new_segments_from set to segment_creation_time, oldest date to process is {time}", array('time' => $segmentCreatedTime));
return $segmentCreatedTime;
- } else if (preg_match("/^last([0-9]+)$/", $this->processNewSegmentsFrom, $matches)) {
+ } elseif (preg_match("/^last([0-9]+)$/", $this->processNewSegmentsFrom, $matches)) {
$lastN = $matches[1];
list($lastDate, $lastPeriod) = Range::getDateXPeriodsAgo($lastN, $segmentCreatedTime, 'day');
@@ -166,4 +166,4 @@ class SegmentArchivingRequestUrlProvider
return $segment['enable_only_idsite'] == 0
|| $segment['enable_only_idsite'] == $idSite;
}
-} \ No newline at end of file
+}
diff --git a/core/CronArchive/SharedSiteIds.php b/core/CronArchive/SharedSiteIds.php
index facc331a6d..f77f3d3fdc 100644
--- a/core/CronArchive/SharedSiteIds.php
+++ b/core/CronArchive/SharedSiteIds.php
@@ -181,6 +181,4 @@ class SharedSiteIds
{
return Process::isSupported();
}
-
}
-
diff --git a/core/CronArchive/SitesToReprocessDistributedList.php b/core/CronArchive/SitesToReprocessDistributedList.php
index 0257d98702..ad58cc3a14 100644
--- a/core/CronArchive/SitesToReprocessDistributedList.php
+++ b/core/CronArchive/SitesToReprocessDistributedList.php
@@ -37,4 +37,4 @@ class SitesToReprocessDistributedList extends DistributedList
parent::setAll($items);
}
-} \ No newline at end of file
+}
diff --git a/core/DataAccess/Actions.php b/core/DataAccess/Actions.php
index 9efc4fc2a5..1a47a70549 100644
--- a/core/DataAccess/Actions.php
+++ b/core/DataAccess/Actions.php
@@ -31,4 +31,4 @@ class Actions
$sql = "DELETE FROM $table WHERE idaction IN (" . implode(",", $idActions) . ")";
Db::query($sql);
}
-} \ No newline at end of file
+}
diff --git a/core/DataAccess/ArchiveSelector.php b/core/DataAccess/ArchiveSelector.php
index a500ef66e6..7be972bdb8 100644
--- a/core/DataAccess/ArchiveSelector.php
+++ b/core/DataAccess/ArchiveSelector.php
@@ -80,7 +80,6 @@ class ArchiveSelector
list($visits, $visitsConverted) = self::getVisitsMetricsFromResults($idArchive, $idArchiveVisitsSummary, $results);
if (false === $visits && false === $idArchive) {
-
return false;
}
@@ -236,7 +235,6 @@ class ArchiveSelector
// create the SQL to select archive data
$loadAllSubtables = $idSubtable == Archive::ID_SUBTABLE_LOAD_ALL_SUBTABLES;
if ($loadAllSubtables) {
-
$name = reset($recordNames);
// select blobs w/ name like "$name_[0-9]+" w/o using RLIKE
@@ -252,7 +250,6 @@ class ArchiveSelector
$whereNameIs = "(name = ? OR (name LIKE ? AND ( $checkForChunkBlob OR $checkForSubtableId ) ))";
$bind = array($name, $name . '%');
} else {
-
if ($idSubtable === null) {
// select root table or specific record names
$bind = array_values($recordNames);
@@ -279,7 +276,6 @@ class ArchiveSelector
// get data from every table we're querying
$rows = array();
foreach ($archiveIds as $period => $ids) {
-
if (empty($ids)) {
throw new Exception("Unexpected: id archive not found for period '$period' '");
}
@@ -301,7 +297,6 @@ class ArchiveSelector
if ($isNumeric) {
$rows[] = $row;
} else {
-
$row['value'] = self::uncompress($row['value']);
if ($chunk->isRecordNameAChunk($row['name'])) {
@@ -371,6 +366,4 @@ class ArchiveSelector
// create the SQL to find archives that are DONE
return "((name IN ($allDoneFlags)) AND (value IN (" . implode(',', $possibleValues) . ")))";
}
-
-
}
diff --git a/core/DataAccess/ArchiveTableCreator.php b/core/DataAccess/ArchiveTableCreator.php
index 230c7da05a..c6b958449b 100644
--- a/core/DataAccess/ArchiveTableCreator.php
+++ b/core/DataAccess/ArchiveTableCreator.php
@@ -11,7 +11,6 @@ namespace Piwik\DataAccess;
use Piwik\Common;
use Piwik\Date;
-use Piwik\Db;
use Piwik\DbHelper;
class ArchiveTableCreator
diff --git a/core/DataAccess/ArchiveWriter.php b/core/DataAccess/ArchiveWriter.php
index 56c0927496..2ef614990f 100644
--- a/core/DataAccess/ArchiveWriter.php
+++ b/core/DataAccess/ArchiveWriter.php
@@ -86,7 +86,6 @@ class ArchiveWriter
public function insertBlobRecord($name, $values)
{
if (is_array($values)) {
-
$clean = array();
if (isset($values[0])) {
diff --git a/core/DataAccess/LogAggregator.php b/core/DataAccess/LogAggregator.php
index 8b8d5175ff..ec6748040d 100644
--- a/core/DataAccess/LogAggregator.php
+++ b/core/DataAccess/LogAggregator.php
@@ -447,8 +447,8 @@ class LogAggregator
protected function isMetricRequested($metricId, $metricsRequested)
{
// do not process INDEX_NB_UNIQ_FINGERPRINTS unless specifically asked for
- if($metricsRequested === false) {
- if($metricId == Metrics::INDEX_NB_UNIQ_FINGERPRINTS) {
+ if ($metricsRequested === false) {
+ if ($metricId == Metrics::INDEX_NB_UNIQ_FINGERPRINTS) {
return false;
}
return true;
diff --git a/core/DataAccess/LogQueryBuilder.php b/core/DataAccess/LogQueryBuilder.php
index a6486520b3..3417c1d545 100644
--- a/core/DataAccess/LogQueryBuilder.php
+++ b/core/DataAccess/LogQueryBuilder.php
@@ -9,7 +9,6 @@
namespace Piwik\DataAccess;
-
use Exception;
use Piwik\Common;
use Piwik\Segment\SegmentExpression;
@@ -27,7 +26,7 @@ class LogQueryBuilder
$from = array($from);
}
- if(!$this->segmentExpression->isEmpty()) {
+ if (!$this->segmentExpression->isEmpty()) {
$this->segmentExpression->parseSubExpressionsIntoSqlExpressions($from);
$segmentSql = $this->segmentExpression->getSql();
$where = $this->getWhereMatchBoth($where, $segmentSql['where']);
@@ -105,18 +104,18 @@ class LogQueryBuilder
// have actions, need conversions => join on idlink_va
$join = "log_conversion.idlink_va = log_link_visit_action.idlink_va "
. "AND log_conversion.idsite = log_link_visit_action.idsite";
- } else if ($actionsAvailable && $table == "log_visit") {
+ } elseif ($actionsAvailable && $table == "log_visit") {
// have actions, need visits => join on idvisit
$join = "log_visit.idvisit = log_link_visit_action.idvisit";
- } else if ($visitsAvailable && $table == "log_link_visit_action") {
+ } elseif ($visitsAvailable && $table == "log_link_visit_action") {
// have visits, need actions => we have to use a more complex join
// we don't hande this here, we just return joinWithSubSelect=true in this case
$joinWithSubSelect = true;
$join = "log_link_visit_action.idvisit = log_visit.idvisit";
- } else if ($conversionsAvailable && $table == "log_link_visit_action") {
+ } elseif ($conversionsAvailable && $table == "log_link_visit_action") {
// have conversions, need actions => join on idlink_va
$join = "log_conversion.idlink_va = log_link_visit_action.idlink_va";
- } else if (($visitsAvailable && $table == "log_conversion")
+ } elseif (($visitsAvailable && $table == "log_conversion")
|| ($conversionsAvailable && $table == "log_visit")
) {
// have visits, need conversion (or vice versa) => join on idvisit
@@ -154,7 +153,6 @@ class LogQueryBuilder
'joinWithSubSelect' => $joinWithSubSelect
);
return $return;
-
}
@@ -188,11 +186,11 @@ class LogQueryBuilder
$innerLimit = $limit;
$innerGroupBy = "log_visit.idvisit";
$innerOrderBy = "NULL";
- if($innerLimit && $orderBy) {
+ if ($innerLimit && $orderBy) {
// only When LIMITing we can apply to the inner query the same ORDER BY as the parent query
$innerOrderBy = $orderBy;
}
- if($innerLimit) {
+ if ($innerLimit) {
// When LIMITing, no need to GROUP BY (GROUPing by is done before the LIMIT which is super slow when large amount of rows is matched)
$innerGroupBy = false;
}
@@ -296,5 +294,4 @@ class LogQueryBuilder
AND
($segmentWhere)";
}
-
-} \ No newline at end of file
+}
diff --git a/core/DataAccess/Model.php b/core/DataAccess/Model.php
index 8df49d16a3..2a5bfa5f86 100644
--- a/core/DataAccess/Model.php
+++ b/core/DataAccess/Model.php
@@ -223,7 +223,6 @@ class Model
$sequence->create();
}
} catch (Exception $e) {
-
}
}
@@ -233,7 +232,7 @@ class Model
try {
$idarchive = $sequence->getNextId();
- } catch(Exception $e) {
+ } catch (Exception $e) {
// edge case: sequence was not found, create it now
$sequence->create();
@@ -312,5 +311,4 @@ class Model
{
Db::releaseDbLock($dbLockName);
}
-
}
diff --git a/core/DataAccess/RawLogDao.php b/core/DataAccess/RawLogDao.php
index 28f2a07978..0105a1047f 100644
--- a/core/DataAccess/RawLogDao.php
+++ b/core/DataAccess/RawLogDao.php
@@ -106,4 +106,4 @@ class RawLogDao
{
return Db::query($sql, array_merge(array_values($values), array($idVisit)));
}
-} \ No newline at end of file
+}
diff --git a/core/DataAccess/TableMetadata.php b/core/DataAccess/TableMetadata.php
index 92e1e8b34e..a07d378058 100644
--- a/core/DataAccess/TableMetadata.php
+++ b/core/DataAccess/TableMetadata.php
@@ -53,4 +53,4 @@ class TableMetadata
return array_values($columns);
}
-} \ No newline at end of file
+}
diff --git a/core/DataArray.php b/core/DataArray.php
index 2eab0bbab5..386eae29a3 100644
--- a/core/DataArray.php
+++ b/core/DataArray.php
@@ -100,7 +100,7 @@ class DataArray
}
// Edge case fail safe
- if(!isset($oldRowToUpdate[Metrics::INDEX_NB_VISITS])) {
+ if (!isset($oldRowToUpdate[Metrics::INDEX_NB_VISITS])) {
return;
}
@@ -121,7 +121,7 @@ class DataArray
Metrics::INDEX_BOUNCE_COUNT,
Metrics::INDEX_NB_VISITS_CONVERTED
);
- foreach($toZero as $metric) {
+ foreach ($toZero as $metric) {
$oldRowToUpdate[$metric] = 0;
}
}
diff --git a/core/DataFiles/SearchEngines.php b/core/DataFiles/SearchEngines.php
index 084c00e5e1..c72a6503cd 100644
--- a/core/DataFiles/SearchEngines.php
+++ b/core/DataFiles/SearchEngines.php
@@ -190,7 +190,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
'search.tb.ask.com' => array('Ask'),
'nortonsafe.search.ask.com' => array('Ask'),
'safesearch.avira.com' => array('Ask'),
- 'avira.search.ask.com' => array('Ask'),
+ 'avira.search.ask.com' => array('Ask'),
// Atlas
'searchatlas.centrum.cz' => array('Atlas', 'q', '?q={k}'),
@@ -285,7 +285,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
// DasOertliche
'www.dasoertliche.de' => array('DasOertliche', 'kw'),
- 'www2.dasoertliche.de' => array('DasOertliche', array('ph', 'kw')),
+ 'www2.dasoertliche.de' => array('DasOertliche', array('ph', 'kw')),
// DasTelefonbuch
'www1.dastelefonbuch.de' => array('DasTelefonbuch', 'kw'),
@@ -456,7 +456,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
'suche.gmx.net' => array('Google', 'q', 'web?q={k}'),
'search.incredibar.com' => array('Google', 'q', 'search.php?q={k}'),
'www.delta-search.com' => array('Google', 'q'),
- 'www1.delta-search.com' => array('Google', 'q'),
+ 'www1.delta-search.com' => array('Google', 'q'),
'search.1und1.de' => array('Google', 'q', 'web?q={k}'),
'search.zonealarm.com' => array('Google'),
'start.lenovo.com' => array('Google', 'q', 'search/index.php?q={k}'),
@@ -621,7 +621,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
's8-eu.ixquick.com' => array('Ixquick'),
's1-eu.ixquick.de' => array('Ixquick'),
's2-eu4.ixquick.com' => array('Ixquick'),
- 's5-eu4.ixquick.com' => array('Ixquick'),
+ 's5-eu4.ixquick.com' => array('Ixquick'),
// Jyxo
'jyxo.1188.cz' => array('Jyxo', 'q', 's?q={k}'),
@@ -683,7 +683,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
// Metager
'meta.rrzn.uni-hannover.de' => array('Metager', 'eingabe', 'meta/cgi-bin/meta.ger1?eingabe={k}'),
'www.metager.de' => array('Metager'),
- 'metager.de' => array('Metager'),
+ 'metager.de' => array('Metager'),
// Metager2
'metager2.de' => array('Metager2', 'q', 'search/index.php?q={k}'),
@@ -760,9 +760,9 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
// PeoplePC
'search.peoplepc.com' => array('PeoplePC', 'q', 'search?q={k}'),
- // PeopleCheck
+ // PeopleCheck
'extern.peoplecheck.de' => array('PeopleCheck', 'q', 'link.php?q={k}'),
-
+
// Picsearch
'www.picsearch.com' => array('Picsearch', 'q', 'index.cgi?q={k}'),
@@ -784,7 +784,7 @@ if (!isset($GLOBALS['Piwik_SearchEngines'])) {
'www.qualigo.de' => array('Qualigo'),
'www.qualigo.nl' => array('Qualigo'),
- // Qwant
+ // Qwant
'www.qwant.com' => array('Qwant', 'q'),
// Rakuten
diff --git a/core/DataTable.php b/core/DataTable.php
index 884100b53a..f55bc42a1a 100644
--- a/core/DataTable.php
+++ b/core/DataTable.php
@@ -392,7 +392,6 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
if ($this->isSortRecursiveEnabled()) {
foreach ($this->getRowsWithoutSummaryRow() as $row) {
-
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->enableRecursiveSort();
@@ -772,8 +771,9 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
if ($this->maximumAllowedRows > 0
&& $this->getRowsCount() >= $this->maximumAllowedRows - 1
) {
- if ($this->summaryRow === null) // create the summary row if necessary
- {
+ if ($this->summaryRow === null) {
+ // create the summary row if necessary
+
$columns = array('label' => self::LABEL_SUMMARY_ROW) + $row->getColumns();
$this->addSummaryRow(new Row(array(Row::COLUMNS => $columns)));
} else {
@@ -1657,15 +1657,17 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
// if there is no table to advance to, and we're not adding missing rows, return false
if ($missingRowColumns === false) {
return array(false, $i);
- } else // if we're adding missing rows, add a new row
- {
+ } else {
+ // if we're adding missing rows, add a new row
+
$row = new DataTableSummaryRow();
$row->setColumns(array('label' => $segment) + $missingRowColumns);
$next = $table->addRow($row);
- if ($next !== $row) // if the row wasn't added, the table is full
- {
+ if ($next !== $row) {
+ // if the row wasn't added, the table is full
+
// Summary row, has no metadata
$next->deleteMetadata();
return array($next, $i);
@@ -1679,8 +1681,9 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
// missing rows, return false
if ($missingRowColumns === false) {
return array(false, $i);
- } else if ($i != $pathLength - 1) // create subtable if missing, but only if not on the last segment
- {
+ } elseif ($i != $pathLength - 1) {
+ // create subtable if missing, but only if not on the last segment
+
$table = new DataTable();
$table->setMaximumAllowedRows($maxSubtableRows);
$table->metadata[self::COLUMN_AGGREGATION_OPS_METADATA_NAME]
@@ -1829,7 +1832,6 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
{
if ($row === false) {
return;
-
}
$thisRow = $this->getFirstRow();
if ($thisRow === false) {
@@ -1850,7 +1852,8 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess
/**
* @return \ArrayIterator|Row[]
*/
- public function getIterator() {
+ public function getIterator()
+ {
return new \ArrayIterator($this->getRows());
}
diff --git a/core/DataTable/BaseFilter.php b/core/DataTable/BaseFilter.php
index 52a4863d0c..ce423112ff 100644
--- a/core/DataTable/BaseFilter.php
+++ b/core/DataTable/BaseFilter.php
@@ -9,7 +9,6 @@
namespace Piwik\DataTable;
use Piwik\DataTable;
-use Piwik\DataTable\Row;
/**
* A filter is set of logic that manipulates a DataTable. Existing filters do things like,
diff --git a/core/DataTable/Bridges.php b/core/DataTable/Bridges.php
index 6b3e722fce..ccc25736fc 100644
--- a/core/DataTable/Bridges.php
+++ b/core/DataTable/Bridges.php
@@ -32,4 +32,3 @@ namespace {
}
}
-
diff --git a/core/DataTable/Filter/AddColumnsProcessedMetrics.php b/core/DataTable/Filter/AddColumnsProcessedMetrics.php
index a3a9bd9776..de4b1320dc 100644
--- a/core/DataTable/Filter/AddColumnsProcessedMetrics.php
+++ b/core/DataTable/Filter/AddColumnsProcessedMetrics.php
@@ -9,7 +9,6 @@
namespace Piwik\DataTable\Filter;
use Piwik\DataTable\BaseFilter;
-use Piwik\DataTable\Row;
use Piwik\DataTable;
use Piwik\Plugin\Metric;
use Piwik\Plugins\CoreHome\Columns\Metrics\ActionsPerVisit;
@@ -93,4 +92,4 @@ class AddColumnsProcessedMetrics extends BaseFilter
}
}
}
-} \ No newline at end of file
+}
diff --git a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
index d63d9b9bc5..7bdb7c7985 100644
--- a/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
+++ b/core/DataTable/Filter/AddColumnsProcessedMetricsGoal.php
@@ -10,7 +10,6 @@ namespace Piwik\DataTable\Filter;
use Piwik\Archive\DataTableFactory;
use Piwik\DataTable;
-use Piwik\DataTable\Row;
use Piwik\Piwik;
use Piwik\Plugin\Metric;
use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecific\AverageOrderRevenue;
@@ -163,4 +162,4 @@ class AddColumnsProcessedMetricsGoal extends AddColumnsProcessedMetrics
}
return array_unique($result);
}
-} \ No newline at end of file
+}
diff --git a/core/DataTable/Filter/AddSegmentByLabel.php b/core/DataTable/Filter/AddSegmentByLabel.php
index d13eef97c5..1eacd4f72f 100644
--- a/core/DataTable/Filter/AddSegmentByLabel.php
+++ b/core/DataTable/Filter/AddSegmentByLabel.php
@@ -64,19 +64,17 @@ class AddSegmentByLabel extends BaseFilter
$segment = reset($this->segments);
foreach ($table->getRowsWithoutSummaryRow() as $key => $row) {
-
$label = $row->getColumn('label');
if (!empty($label)) {
$row->setMetadata('segment', $segment . '==' . urlencode($label));
}
}
- } else if (!empty($this->delimiter)) {
+ } elseif (!empty($this->delimiter)) {
$numSegments = count($this->segments);
$conditionAnd = ';';
foreach ($table->getRowsWithoutSummaryRow() as $key => $row) {
-
$label = $row->getColumn('label');
if (!empty($label)) {
$parts = explode($this->delimiter, $label);
diff --git a/core/DataTable/Filter/AddSegmentValue.php b/core/DataTable/Filter/AddSegmentValue.php
index 857bf02ce3..886db60df8 100644
--- a/core/DataTable/Filter/AddSegmentValue.php
+++ b/core/DataTable/Filter/AddSegmentValue.php
@@ -29,5 +29,4 @@ class AddSegmentValue extends ColumnCallbackAddMetadata
{
parent::__construct($table, 'label', 'segmentValue', $callback, null, false);
}
-
}
diff --git a/core/DataTable/Filter/BeautifyTimeRangeLabels.php b/core/DataTable/Filter/BeautifyTimeRangeLabels.php
index aed7af7d8d..7cc21699e4 100644
--- a/core/DataTable/Filter/BeautifyTimeRangeLabels.php
+++ b/core/DataTable/Filter/BeautifyTimeRangeLabels.php
@@ -70,7 +70,7 @@ class BeautifyTimeRangeLabels extends BeautifyRangeLabels
{
if ($lowerBound < 60) {
return sprintf($this->labelSecondsPlural, $lowerBound, $lowerBound);
- } else if ($lowerBound == 60) {
+ } elseif ($lowerBound == 60) {
return $this->labelSingular;
} else {
return sprintf($this->labelPlural, ceil($lowerBound / 60));
diff --git a/core/DataTable/Filter/CalculateEvolutionFilter.php b/core/DataTable/Filter/CalculateEvolutionFilter.php
index a8bd04d08d..5af658bad6 100755
--- a/core/DataTable/Filter/CalculateEvolutionFilter.php
+++ b/core/DataTable/Filter/CalculateEvolutionFilter.php
@@ -102,7 +102,9 @@ class CalculateEvolutionFilter extends ColumnCallbackAddColumnPercentage
protected function getDivisor($row)
{
$pastRow = $this->getPastRowFromCurrent($row);
- if (!$pastRow) return 0;
+ if (!$pastRow) {
+ return 0;
+ }
return $pastRow->getColumn($this->columnNameUsedAsDivisor);
}
diff --git a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php
index 81d8eadf04..5745167587 100644
--- a/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php
+++ b/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php
@@ -136,7 +136,7 @@ class ColumnCallbackAddColumnQuotient extends BaseFilter
{
if (!is_null($this->totalValueUsedAsDivisor)) {
return $this->totalValueUsedAsDivisor;
- } else if ($this->getDivisorFromSummaryRow) {
+ } elseif ($this->getDivisorFromSummaryRow) {
$summaryRow = $this->table->getRowFromId(DataTable::ID_SUMMARY_ROW);
return $summaryRow->getColumn($this->columnNameUsedAsDivisor);
} else {
diff --git a/core/DataTable/Filter/ColumnCallbackAddMetadata.php b/core/DataTable/Filter/ColumnCallbackAddMetadata.php
index a241cf4b5d..d302e641fa 100644
--- a/core/DataTable/Filter/ColumnCallbackAddMetadata.php
+++ b/core/DataTable/Filter/ColumnCallbackAddMetadata.php
@@ -70,7 +70,6 @@ class ColumnCallbackAddMetadata extends BaseFilter
}
foreach ($rows as $key => $row) {
-
$parameters = array();
foreach ($this->columnsToRead as $columnsToRead) {
$parameters[] = $row->getColumn($columnsToRead);
@@ -89,4 +88,4 @@ class ColumnCallbackAddMetadata extends BaseFilter
}
}
}
-} \ No newline at end of file
+}
diff --git a/core/DataTable/Filter/ColumnCallbackReplace.php b/core/DataTable/Filter/ColumnCallbackReplace.php
index 84397d7a2c..b850b7a6ad 100644
--- a/core/DataTable/Filter/ColumnCallbackReplace.php
+++ b/core/DataTable/Filter/ColumnCallbackReplace.php
@@ -74,7 +74,6 @@ class ColumnCallbackReplace extends BaseFilter
public function filter($table)
{
foreach ($table->getRows() as $row) {
-
$extraColumnParameters = array();
foreach ($this->extraColumnParameters as $columnName) {
$extraColumnParameters[] = $row->getColumn($columnName);
diff --git a/core/DataTable/Filter/ColumnDelete.php b/core/DataTable/Filter/ColumnDelete.php
index 743f5afd86..a0fba5a963 100644
--- a/core/DataTable/Filter/ColumnDelete.php
+++ b/core/DataTable/Filter/ColumnDelete.php
@@ -121,7 +121,6 @@ class ColumnDelete extends BaseFilter
if (!empty($this->columnsToKeep)) {
foreach ($table as $index => $row) {
foreach ($row as $name => $value) {
-
$keep = false;
// @see self::APPEND_TO_COLUMN_NAME_TO_KEEP
foreach ($this->columnsToKeep as $nameKeep => $true) {
diff --git a/core/DataTable/Filter/ExcludeLowPopulation.php b/core/DataTable/Filter/ExcludeLowPopulation.php
index cf54c5c7eb..27d19fa86b 100644
--- a/core/DataTable/Filter/ExcludeLowPopulation.php
+++ b/core/DataTable/Filter/ExcludeLowPopulation.php
@@ -10,7 +10,6 @@ namespace Piwik\DataTable\Filter;
use Piwik\DataTable;
use Piwik\DataTable\BaseFilter;
-use Piwik\Plugin\Metric;
/**
* Deletes all rows for which a specific column has a value that is lower than
diff --git a/core/DataTable/Filter/GroupBy.php b/core/DataTable/Filter/GroupBy.php
index 07597fe6b5..b00c66142b 100755
--- a/core/DataTable/Filter/GroupBy.php
+++ b/core/DataTable/Filter/GroupBy.php
@@ -77,12 +77,11 @@ class GroupBy extends BaseFilter
$nonGroupByRowIds = array();
foreach ($table->getRowsWithoutSummaryRow() as $rowId => $row) {
-
$groupByColumnValue = $row->getColumn($this->groupByColumn);
$groupByValue = $groupByColumnValue;
// reduce the group by column of this row
- if($this->reduceFunction) {
+ if ($this->reduceFunction) {
$parameters = array_merge(array($groupByColumnValue), $this->parameters);
$groupByValue = call_user_func_array($this->reduceFunction, $parameters);
}
diff --git a/core/DataTable/Filter/PatternRecursive.php b/core/DataTable/Filter/PatternRecursive.php
index f383a13260..62a8b26bd9 100644
--- a/core/DataTable/Filter/PatternRecursive.php
+++ b/core/DataTable/Filter/PatternRecursive.php
@@ -8,10 +8,8 @@
*/
namespace Piwik\DataTable\Filter;
-use Exception;
use Piwik\DataTable\BaseFilter;
use Piwik\DataTable;
-use Piwik\DataTable\Manager;
/**
* Deletes rows that do not contain a column that matches a regex pattern and do not contain a
@@ -63,7 +61,7 @@ class PatternRecursive extends BaseFilter
$patternNotFoundInChildren = false;
$subTable = $row->getSubtable();
- if(!$subTable) {
+ if (!$subTable) {
$patternNotFoundInChildren = true;
} else {
// we delete the row if we couldn't find the pattern in any row in the
diff --git a/core/DataTable/Filter/PivotByDimension.php b/core/DataTable/Filter/PivotByDimension.php
index 3eeff39b44..b7f5ca1cf2 100644
--- a/core/DataTable/Filter/PivotByDimension.php
+++ b/core/DataTable/Filter/PivotByDimension.php
@@ -547,4 +547,4 @@ class PivotByDimension extends BaseFilter
{
return !empty($lhs) && !empty($rhs) && $lhs->getId() != $rhs->getId();
}
-} \ No newline at end of file
+}
diff --git a/core/DataTable/Filter/ReplaceSummaryRowLabel.php b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
index 168794d097..3256fe9603 100644
--- a/core/DataTable/Filter/ReplaceSummaryRowLabel.php
+++ b/core/DataTable/Filter/ReplaceSummaryRowLabel.php
@@ -10,7 +10,6 @@ namespace Piwik\DataTable\Filter;
use Piwik\DataTable\BaseFilter;
use Piwik\DataTable;
-use Piwik\DataTable\Manager;
use Piwik\Piwik;
/**
diff --git a/core/DataTable/Filter/Sort.php b/core/DataTable/Filter/Sort.php
index 7f590607cd..8f2df8c9f6 100644
--- a/core/DataTable/Filter/Sort.php
+++ b/core/DataTable/Filter/Sort.php
@@ -99,7 +99,7 @@ class Sort extends BaseFilter
* @param mixed $valB
* @return int
*/
- function naturalSort($valA, $valB)
+ public function naturalSort($valA, $valB)
{
return !isset($valA)
&& !isset($valB)
@@ -123,7 +123,7 @@ class Sort extends BaseFilter
* @param mixed $valB
* @return int
*/
- function sortString($valA, $valB)
+ public function sortString($valA, $valB)
{
return !isset($valA)
&& !isset($valB)
@@ -279,7 +279,6 @@ class Sort extends BaseFilter
if ($table->isSortRecursiveEnabled()) {
foreach ($table->getRowsWithoutSummaryRow() as $row) {
-
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->enableRecursiveSort();
@@ -287,7 +286,5 @@ class Sort extends BaseFilter
}
}
}
-
}
-
}
diff --git a/core/DataTable/Manager.php b/core/DataTable/Manager.php
index c823293c76..228f13da18 100644
--- a/core/DataTable/Manager.php
+++ b/core/DataTable/Manager.php
@@ -28,8 +28,8 @@ class Manager extends \ArrayObject
private static $instance;
- public static function getInstance() {
-
+ public static function getInstance()
+ {
if (!isset(self::$instance)) {
self::$instance = new Manager();
}
diff --git a/core/DataTable/Renderer.php b/core/DataTable/Renderer.php
index f825739611..e8796aea92 100644
--- a/core/DataTable/Renderer.php
+++ b/core/DataTable/Renderer.php
@@ -194,7 +194,6 @@ abstract class Renderer extends BaseFactory
$htmlentities = array("&nbsp;", "&iexcl;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&shy;", "&reg;", "&macr;", "&deg;", "&plusmn;", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;", "&cedil;", "&sup1;", "&ordm;", "&raquo;", "&frac14;", "&frac12;", "&frac34;", "&iquest;", "&Agrave;", "&Aacute;", "&Acirc;", "&Atilde;", "&Auml;", "&Aring;", "&AElig;", "&Ccedil;", "&Egrave;", "&Eacute;", "&Ecirc;", "&Euml;", "&Igrave;", "&Iacute;", "&Icirc;", "&Iuml;", "&ETH;", "&Ntilde;", "&Ograve;", "&Oacute;", "&Ocirc;", "&Otilde;", "&Ouml;", "&times;", "&Oslash;", "&Ugrave;", "&Uacute;", "&Ucirc;", "&Uuml;", "&Yacute;", "&THORN;", "&szlig;", "&agrave;", "&aacute;", "&acirc;", "&atilde;", "&auml;", "&aring;", "&aelig;", "&ccedil;", "&egrave;", "&eacute;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&icirc;", "&iuml;", "&eth;", "&ntilde;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&divide;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&yacute;", "&thorn;", "&yuml;", "&euro;");
$xmlentities = array("&#162;", "&#163;", "&#164;", "&#165;", "&#166;", "&#167;", "&#168;", "&#169;", "&#170;", "&#171;", "&#172;", "&#173;", "&#174;", "&#175;", "&#176;", "&#177;", "&#178;", "&#179;", "&#180;", "&#181;", "&#182;", "&#183;", "&#184;", "&#185;", "&#186;", "&#187;", "&#188;", "&#189;", "&#190;", "&#191;", "&#192;", "&#193;", "&#194;", "&#195;", "&#196;", "&#197;", "&#198;", "&#199;", "&#200;", "&#201;", "&#202;", "&#203;", "&#204;", "&#205;", "&#206;", "&#207;", "&#208;", "&#209;", "&#210;", "&#211;", "&#212;", "&#213;", "&#214;", "&#215;", "&#216;", "&#217;", "&#218;", "&#219;", "&#220;", "&#221;", "&#222;", "&#223;", "&#224;", "&#225;", "&#226;", "&#227;", "&#228;", "&#229;", "&#230;", "&#231;", "&#232;", "&#233;", "&#234;", "&#235;", "&#236;", "&#237;", "&#238;", "&#239;", "&#240;", "&#241;", "&#242;", "&#243;", "&#244;", "&#245;", "&#246;", "&#247;", "&#248;", "&#249;", "&#250;", "&#251;", "&#252;", "&#253;", "&#254;", "&#255;", "&#8364;");
$value = str_replace($htmlentities, $xmlentities, $value);
-
} elseif ($value === false) {
$value = 0;
}
diff --git a/core/DataTable/Renderer/Console.php b/core/DataTable/Renderer/Console.php
index a4fcbff0c5..bd16e93c4f 100644
--- a/core/DataTable/Renderer/Console.php
+++ b/core/DataTable/Renderer/Console.php
@@ -8,7 +8,6 @@
*/
namespace Piwik\DataTable\Renderer;
-use Piwik\DataTable\Manager;
use Piwik\DataTable;
use Piwik\DataTable\Renderer;
@@ -72,8 +71,9 @@ class Console extends Renderer
*/
protected function renderTable($table, $prefix = "")
{
- if (is_array($table)) // convert array to DataTable
- {
+ if (is_array($table)) {
+ // convert array to DataTable
+
$table = DataTable::makeFromSimpleArray($table);
}
@@ -97,8 +97,11 @@ class Console extends Renderer
$dataTableMapBreak = true;
break;
}
- if (is_string($value)) $value = "'$value'";
- elseif (is_array($value)) $value = var_export($value, true);
+ if (is_string($value)) {
+ $value = "'$value'";
+ } elseif (is_array($value)) {
+ $value = var_export($value, true);
+ }
$columns[] = "'$column' => $value";
}
@@ -109,8 +112,11 @@ class Console extends Renderer
$metadata = array();
foreach ($row->getMetadata() as $name => $value) {
- if (is_string($value)) $value = "'$value'";
- elseif (is_array($value)) $value = var_export($value, true);
+ if (is_string($value)) {
+ $value = "'$value'";
+ } elseif (is_array($value)) {
+ $value = var_export($value, true);
+ }
$metadata[] = "'$name' => $value";
}
$metadata = implode(", ", $metadata);
diff --git a/core/DataTable/Renderer/Csv.php b/core/DataTable/Renderer/Csv.php
index 6f37a660bd..4eee1949b7 100644
--- a/core/DataTable/Renderer/Csv.php
+++ b/core/DataTable/Renderer/Csv.php
@@ -117,8 +117,9 @@ class Csv extends Renderer
*/
protected function renderTable($table, &$allColumns = array())
{
- if (is_array($table)) // convert array to DataTable
- {
+ if (is_array($table)) {
+ // convert array to DataTable
+
$table = DataTable::makeFromSimpleArray($table);
}
@@ -264,11 +265,12 @@ class Csv extends Renderer
$period = Common::getRequestVar('period', false);
$date = Common::getRequestVar('date', false);
- if ($period || $date) // in test cases, there are no request params set
- {
+ if ($period || $date) {
+ // in test cases, there are no request params set
+
if ($period == 'range') {
$period = new Range($period, $date);
- } else if (strpos($date, ',') !== false) {
+ } elseif (strpos($date, ',') !== false) {
$period = new Range('range', $date);
} else {
$period = Period\Factory::build($period, Date::factory($date));
diff --git a/core/DataTable/Renderer/Html.php b/core/DataTable/Renderer/Html.php
index e193ebfdc5..f27dc51768 100644
--- a/core/DataTable/Renderer/Html.php
+++ b/core/DataTable/Renderer/Html.php
@@ -56,8 +56,9 @@ class Html extends Renderer
*/
protected function renderTable($table)
{
- if (is_array($table)) // convert array to DataTable
- {
+ if (is_array($table)) {
+ // convert array to DataTable
+
$table = DataTable::makeFromSimpleArray($table);
}
@@ -67,8 +68,9 @@ class Html extends Renderer
$this->buildTableStructure($subtable, '_' . $table->getKeyName(), $date);
}
}
- } else // Simple
- {
+ } else {
+ // Simple
+
if ($table->getRowsCount()) {
$this->buildTableStructure($table);
}
@@ -113,7 +115,9 @@ class Html extends Renderer
$metadata = array();
foreach ($row->getMetadata() as $name => $value) {
- if (is_string($value)) $value = "'$value'";
+ if (is_string($value)) {
+ $value = "'$value'";
+ }
$metadata[] = "'$name' => $value";
}
diff --git a/core/DataTable/Renderer/Json.php b/core/DataTable/Renderer/Json.php
index b5d2ebf979..36079aadf4 100644
--- a/core/DataTable/Renderer/Json.php
+++ b/core/DataTable/Renderer/Json.php
@@ -54,7 +54,6 @@ class Json extends Renderer
}
}
}
-
} else {
$array = $this->convertDataTableToArray($table);
}
diff --git a/core/DataTable/Renderer/Php.php b/core/DataTable/Renderer/Php.php
index eb6d32a3e3..9a121bc628 100644
--- a/core/DataTable/Renderer/Php.php
+++ b/core/DataTable/Renderer/Php.php
@@ -9,7 +9,6 @@
namespace Piwik\DataTable\Renderer;
use Exception;
-use Piwik\DataTable\Manager;
use Piwik\DataTable\Renderer;
use Piwik\DataTable\Simple;
use Piwik\DataTable;
@@ -111,7 +110,7 @@ class Php extends Renderer
if (self::shouldWrapArrayBeforeRendering($flatArray)) {
$flatArray = array($flatArray);
}
- } else if ($dataTable instanceof DataTable\Map) {
+ } elseif ($dataTable instanceof DataTable\Map) {
$flatArray = array();
foreach ($dataTable->getDataTables() as $keyName => $table) {
$serializeSave = $this->serialize;
@@ -119,7 +118,7 @@ class Php extends Renderer
$flatArray[$keyName] = $this->flatRender($table);
$this->serialize = $serializeSave;
}
- } else if ($dataTable instanceof Simple) {
+ } elseif ($dataTable instanceof Simple) {
$flatArray = $this->renderSimpleTable($dataTable);
// if we return only one numeric value then we print out the result in a simple <result> tag
diff --git a/core/DataTable/Renderer/Rss.php b/core/DataTable/Renderer/Rss.php
index 8adda661be..fd18b44371 100644
--- a/core/DataTable/Renderer/Rss.php
+++ b/core/DataTable/Renderer/Rss.php
@@ -29,7 +29,7 @@ class Rss extends Renderer
*
* @return string
*/
- function render()
+ public function render()
{
return $this->renderTable($this->table);
}
diff --git a/core/DataTable/Renderer/Tsv.php b/core/DataTable/Renderer/Tsv.php
index cfffbf24a0..af45a62d99 100644
--- a/core/DataTable/Renderer/Tsv.php
+++ b/core/DataTable/Renderer/Tsv.php
@@ -20,7 +20,7 @@ class Tsv extends Csv
/**
* Constructor
*/
- function __construct()
+ public function __construct()
{
parent::__construct();
$this->setSeparator("\t");
@@ -31,7 +31,7 @@ class Tsv extends Csv
*
* @return string
*/
- function render()
+ public function render()
{
return parent::render();
}
diff --git a/core/DataTable/Renderer/Xml.php b/core/DataTable/Renderer/Xml.php
index 7cd10d9367..b01f5596a2 100644
--- a/core/DataTable/Renderer/Xml.php
+++ b/core/DataTable/Renderer/Xml.php
@@ -160,7 +160,7 @@ class Xml extends Renderer
$prefix = "<row $keyAttributeName=\"$key\">";
$suffix = "</row>";
$emptyNode = "<row $keyAttributeName=\"$key\">";
- } else if (!self::isValidXmlTagName($key)) {
+ } elseif (!self::isValidXmlTagName($key)) {
$prefix = "<row key=\"$key\">";
$suffix = "</row>";
$emptyNode = "<row key=\"$key\"/>";
@@ -180,7 +180,7 @@ class Xml extends Renderer
$result .= $prefixLines . $prefix . "\n";
$result .= $this->renderArray($value, $prefixLines . "\t");
$result .= $prefixLines . $suffix . "\n";
- } else if ($value instanceof DataTable
+ } elseif ($value instanceof DataTable
|| $value instanceof Map
) {
if ($value->getRowsCount() == 0) {
@@ -189,7 +189,7 @@ class Xml extends Renderer
$result .= $prefixLines . $prefix . "\n";
if ($value instanceof Map) {
$result .= $this->renderDataTableMap($value, $this->getArrayFromDataTable($value), $prefixLines);
- } else if ($value instanceof Simple) {
+ } elseif ($value instanceof Simple) {
$result .= $this->renderDataTableSimple($this->getArrayFromDataTable($value), $prefixLines);
} else {
$result .= $this->renderDataTable($this->getArrayFromDataTable($value), $prefixLines);
@@ -461,4 +461,4 @@ class Xml extends Renderer
return array($tagStart, $tagEnd);
}
-} \ No newline at end of file
+}
diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php
index 4b5547cf8b..973974033c 100644
--- a/core/DataTable/Row.php
+++ b/core/DataTable/Row.php
@@ -118,15 +118,21 @@ class Row implements \ArrayAccess, \IteratorAggregate
{
$columns = array();
foreach ($this->getColumns() as $column => $value) {
- if (is_string($value)) $value = "'$value'";
- elseif (is_array($value)) $value = var_export($value, true);
+ if (is_string($value)) {
+ $value = "'$value'";
+ } elseif (is_array($value)) {
+ $value = var_export($value, true);
+ }
$columns[] = "'$column' => $value";
}
$columns = implode(", ", $columns);
$metadata = array();
foreach ($this->getMetadata() as $name => $value) {
- if (is_string($value)) $value = "'$value'";
- elseif (is_array($value)) $value = var_export($value, true);
+ if (is_string($value)) {
+ $value = "'$value'";
+ } elseif (is_array($value)) {
+ $value = var_export($value, true);
+ }
$metadata[] = "'$name' => $value";
}
$metadata = implode(", ", $metadata);
@@ -247,7 +253,7 @@ class Row implements \ArrayAccess, \IteratorAggregate
if ($this->isSubtableLoaded) {
try {
return Manager::getInstance()->getTable($this->subtableId);
- } catch(TableNotFoundException $e) {
+ } catch (TableNotFoundException $e) {
// edge case
}
}
@@ -491,7 +497,7 @@ class Row implements \ArrayAccess, \IteratorAggregate
case 'min':
if (!$thisColumnValue) {
$newValue = $columnToSumValue;
- } else if (!$columnToSumValue) {
+ } elseif (!$columnToSumValue) {
$newValue = $thisColumnValue;
} else {
$newValue = min($thisColumnValue, $columnToSumValue);
@@ -598,11 +604,13 @@ class Row implements \ArrayAccess, \IteratorAggregate
}
return 1;
}
- if (is_array($elem2))
+ if (is_array($elem2)) {
return -1;
+ }
- if ((string)$elem1 === (string)$elem2)
+ if ((string)$elem1 === (string)$elem2) {
return 0;
+ }
return ((string)$elem1 > (string)$elem2) ? 1 : -1;
}
@@ -679,7 +687,8 @@ class Row implements \ArrayAccess, \IteratorAggregate
$this->deleteColumn($offset);
}
- public function getIterator() {
+ public function getIterator()
+ {
return new \ArrayIterator($this->columns);
}
@@ -706,5 +715,4 @@ class Row implements \ArrayAccess, \IteratorAggregate
);
}
}
-
-} \ No newline at end of file
+}
diff --git a/core/DataTable/TableNotFoundException.php b/core/DataTable/TableNotFoundException.php
index a8e181deaf..4286405b5b 100644
--- a/core/DataTable/TableNotFoundException.php
+++ b/core/DataTable/TableNotFoundException.php
@@ -10,5 +10,4 @@ namespace Piwik\DataTable;
class TableNotFoundException extends \Exception
{
-
}
diff --git a/core/Date.php b/core/Date.php
index a046f4e27a..d229cfdb46 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -420,7 +420,6 @@ class Date
return 0;
}
if ($currentYear < $toCompareYear) {
-
return -1;
}
return 1;
diff --git a/core/Db.php b/core/Db.php
index 4d579605b2..bf24a37a41 100644
--- a/core/Db.php
+++ b/core/Db.php
@@ -11,7 +11,6 @@ namespace Piwik;
use Exception;
use Piwik\DataAccess\TableMetadata;
use Piwik\Db\Adapter;
-use Piwik\Tracker;
/**
* Contains SQL related helper functions for Piwik's MySQL database.
diff --git a/core/Db/Adapter.php b/core/Db/Adapter.php
index b75690bc08..4e245c84d3 100644
--- a/core/Db/Adapter.php
+++ b/core/Db/Adapter.php
@@ -62,7 +62,7 @@ class Adapter
private static function getAdapterClassName($adapterName)
{
$className = 'Piwik\Db\Adapter\\' . str_replace(' ', '\\', ucwords(str_replace(array('_', '\\'), ' ', strtolower($adapterName))));
- if(!class_exists($className)) {
+ if (!class_exists($className)) {
throw new \Exception("Adapter $adapterName is not valid.");
}
return $className;
diff --git a/core/Db/BatchInsert.php b/core/Db/BatchInsert.php
index 2fbd6674ad..1604124182 100644
--- a/core/Db/BatchInsert.php
+++ b/core/Db/BatchInsert.php
@@ -9,7 +9,6 @@
namespace Piwik\Db;
use Exception;
-use Piwik\AssetManager;
use Piwik\Common;
use Piwik\Config;
use Piwik\Container\StaticContainer;
@@ -92,7 +91,6 @@ class BatchInsert
return true;
}
} catch (Exception $e) {
-
if ($throwException) {
throw $e;
}
@@ -157,17 +155,17 @@ class BatchInsert
";
/*
- * First attempt: assume web server and MySQL server are on the same machine;
- * this requires that the db user have the FILE privilege; however, since this is
- * a global privilege, it may not be granted due to security concerns
- */
+ * First attempt: assume web server and MySQL server are on the same machine;
+ * this requires that the db user have the FILE privilege; however, since this is
+ * a global privilege, it may not be granted due to security concerns
+ */
$keywords = array('');
/*
- * Second attempt: using the LOCAL keyword means the client reads the file and sends it to the server;
- * the LOCAL keyword may trigger a known PHP PDO\MYSQL bug when MySQL not built with --enable-local-infile
- * @see http://bugs.php.net/bug.php?id=54158
- */
+ * Second attempt: using the LOCAL keyword means the client reads the file and sends it to the server;
+ * the LOCAL keyword may trigger a known PHP PDO\MYSQL bug when MySQL not built with --enable-local-infile
+ * @see http://bugs.php.net/bug.php?id=54158
+ */
$openBaseDir = ini_get('open_basedir');
$safeMode = ini_get('safe_mode');
diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php
index 8f0eea8a26..1e674f2dec 100644
--- a/core/Db/Schema/Mysql.php
+++ b/core/Db/Schema/Mysql.php
@@ -346,7 +346,6 @@ class Mysql implements SchemaInterface
if (is_null($this->tablesInstalled)
|| $forceReload === true
) {
-
$db = $this->getDb();
$prefixTables = $this->getTablePrefixEscaped();
@@ -483,7 +482,8 @@ class Mysql implements SchemaInterface
return $this->getDbSettings()->getEngine();
}
- private function getDb(){
+ private function getDb()
+ {
return Db::get();
}
diff --git a/core/Db/Settings.php b/core/Db/Settings.php
index afb06abc2f..e324e8feaa 100644
--- a/core/Db/Settings.php
+++ b/core/Db/Settings.php
@@ -7,6 +7,7 @@
*
*/
namespace Piwik\Db;
+
use Piwik\Db;
/**
diff --git a/core/DbHelper.php b/core/DbHelper.php
index fdc1597cf6..25b1f56455 100644
--- a/core/DbHelper.php
+++ b/core/DbHelper.php
@@ -9,7 +9,6 @@
namespace Piwik;
use Exception;
-use Piwik\Db\Adapter;
use Piwik\Db\Schema;
use Piwik\DataAccess\ArchiveTableCreator;
@@ -187,4 +186,4 @@ class DbHelper
ArchiveTableCreator::refreshTableList($forceReload = true);
}
-} \ No newline at end of file
+}
diff --git a/core/Development.php b/core/Development.php
index a2dd44c673..3b44eba71d 100644
--- a/core/Development.php
+++ b/core/Development.php
@@ -168,7 +168,7 @@ class Development
$fileIterator = new \LimitIterator($file, $offset, $count);
$methodCode = "\n " . $method->getDocComment() . "\n";
- foreach($fileIterator as $line) {
+ foreach ($fileIterator as $line) {
$methodCode .= $line;
}
$methodCode .= "\n";
@@ -185,7 +185,7 @@ class Development
$fileIterator = new \LimitIterator($file, 0, $class->getStartLine());
$uses = array();
- foreach($fileIterator as $line) {
+ foreach ($fileIterator as $line) {
if (preg_match('/(\s*)use (.+)/', $line, $match)) {
$uses[] = trim($match[2]);
}
diff --git a/core/DeviceDetectorCache.php b/core/DeviceDetectorCache.php
index 7cf2a15226..543769fc54 100644
--- a/core/DeviceDetectorCache.php
+++ b/core/DeviceDetectorCache.php
@@ -9,7 +9,6 @@
namespace Piwik;
use Piwik\Cache as PiwikCache;
-use Exception;
/**
* Caching class used for DeviceDetector caching
@@ -93,5 +92,4 @@ class DeviceDetectorCache implements \DeviceDetector\Cache\Cache
{
return $this->cache->flushAll();
}
-
}
diff --git a/core/DeviceDetectorFactory.php b/core/DeviceDetectorFactory.php
index c7962a96f0..896132e792 100644
--- a/core/DeviceDetectorFactory.php
+++ b/core/DeviceDetectorFactory.php
@@ -22,7 +22,6 @@ class DeviceDetectorFactory
public static function getInstance($userAgent)
{
if (array_key_exists($userAgent, self::$deviceDetectorInstances)) {
-
return self::$deviceDetectorInstances[$userAgent];
}
@@ -35,5 +34,4 @@ class DeviceDetectorFactory
return $deviceDetector;
}
-
}
diff --git a/core/EventDispatcher.php b/core/EventDispatcher.php
index d9c6b0374c..5795200c2f 100644
--- a/core/EventDispatcher.php
+++ b/core/EventDispatcher.php
@@ -10,7 +10,6 @@
namespace Piwik;
use Piwik\Container\StaticContainer;
-use Piwik\Plugin;
/**
* This class allows code to post events from anywhere in Piwik and for
@@ -190,10 +189,11 @@ class EventDispatcher
$pluginFunction = $hookInfo['function'];
if (!empty($hookInfo['before'])) {
$callbackGroup = self::EVENT_CALLBACK_GROUP_FIRST;
- } else if (!empty($hookInfo['after'])) {
+ } elseif (!empty($hookInfo['after'])) {
$callbackGroup = self::EVENT_CALLBACK_GROUP_THIRD;
} else {
- $callbackGroup = self::EVENT_CALLBACK_GROUP_SECOND; }
+ $callbackGroup = self::EVENT_CALLBACK_GROUP_SECOND;
+ }
} else {
$pluginFunction = $hookInfo;
$callbackGroup = self::EVENT_CALLBACK_GROUP_SECOND;
@@ -201,4 +201,4 @@ class EventDispatcher
return array($pluginFunction, $callbackGroup);
}
-} \ No newline at end of file
+}
diff --git a/core/Exception/AuthenticationFailedException.php b/core/Exception/AuthenticationFailedException.php
index ca3efc25c1..4091979f90 100644
--- a/core/Exception/AuthenticationFailedException.php
+++ b/core/Exception/AuthenticationFailedException.php
@@ -10,4 +10,4 @@ namespace Piwik\Exception;
class AuthenticationFailedException extends Exception
{
-} \ No newline at end of file
+}
diff --git a/core/Exception/DatabaseSchemaIsNewerThanCodebaseException.php b/core/Exception/DatabaseSchemaIsNewerThanCodebaseException.php
index accc4ce5d5..7c78b26ce0 100644
--- a/core/Exception/DatabaseSchemaIsNewerThanCodebaseException.php
+++ b/core/Exception/DatabaseSchemaIsNewerThanCodebaseException.php
@@ -10,5 +10,4 @@ namespace Piwik\Exception;
class DatabaseSchemaIsNewerThanCodebaseException extends Exception
{
-
-} \ No newline at end of file
+}
diff --git a/core/Exception/Exception.php b/core/Exception/Exception.php
index 106034bf5a..66d95eb417 100644
--- a/core/Exception/Exception.php
+++ b/core/Exception/Exception.php
@@ -27,4 +27,4 @@ abstract class Exception extends PhpException
{
return $this->isHtmlMessage;
}
-} \ No newline at end of file
+}
diff --git a/core/Exception/InvalidRequestParameterException.php b/core/Exception/InvalidRequestParameterException.php
index 13ead2e716..4ea468c3f0 100644
--- a/core/Exception/InvalidRequestParameterException.php
+++ b/core/Exception/InvalidRequestParameterException.php
@@ -10,4 +10,4 @@ namespace Piwik\Exception;
class InvalidRequestParameterException extends Exception
{
-} \ No newline at end of file
+}
diff --git a/core/Exception/MissingFilePermissionException.php b/core/Exception/MissingFilePermissionException.php
index 268725c70b..e54cce3e57 100644
--- a/core/Exception/MissingFilePermissionException.php
+++ b/core/Exception/MissingFilePermissionException.php
@@ -10,4 +10,4 @@ namespace Piwik\Exception;
class MissingFilePermissionException extends Exception
{
-} \ No newline at end of file
+}
diff --git a/core/Exception/NoPrivilegesException.php b/core/Exception/NoPrivilegesException.php
index 3ee8c9ce2b..d7ccfcfc1a 100644
--- a/core/Exception/NoPrivilegesException.php
+++ b/core/Exception/NoPrivilegesException.php
@@ -10,4 +10,4 @@ namespace Piwik\Exception;
class NoPrivilegesException extends Exception
{
-} \ No newline at end of file
+}
diff --git a/core/Exception/NoWebsiteFoundException.php b/core/Exception/NoWebsiteFoundException.php
index eb97cad37a..748c7a4e9d 100644
--- a/core/Exception/NoWebsiteFoundException.php
+++ b/core/Exception/NoWebsiteFoundException.php
@@ -10,4 +10,4 @@ namespace Piwik\Exception;
class NoWebsiteFoundException extends Exception
{
-} \ No newline at end of file
+}
diff --git a/core/Exception/UnexpectedWebsiteFoundException.php b/core/Exception/UnexpectedWebsiteFoundException.php
index 68178d8599..d9804bae74 100644
--- a/core/Exception/UnexpectedWebsiteFoundException.php
+++ b/core/Exception/UnexpectedWebsiteFoundException.php
@@ -10,4 +10,4 @@ namespace Piwik\Exception;
class UnexpectedWebsiteFoundException extends Exception
{
-} \ No newline at end of file
+}
diff --git a/core/Filechecks.php b/core/Filechecks.php
index d673ccc250..94340afded 100644
--- a/core/Filechecks.php
+++ b/core/Filechecks.php
@@ -40,7 +40,6 @@ class Filechecks
{
$resultCheck = array();
foreach ($directoriesToCheck as $directoryToCheck) {
-
if (!preg_match('/^' . preg_quote(PIWIK_USER_PATH, '/') . '/', $directoryToCheck)) {
$directoryToCheck = PIWIK_USER_PATH . $directoryToCheck;
}
@@ -139,7 +138,7 @@ class Filechecks
if (!file_exists($file) || !is_readable($file)) {
$messages[] = Piwik::translate('General_ExceptionMissingFile', $file);
- } else if (filesize($file) != $props[0]) {
+ } elseif (filesize($file) != $props[0]) {
if (!$hasMd5 || in_array(substr($path, -4), array('.gif', '.ico', '.jpg', '.png', '.swf'))) {
// files that contain binary data (e.g., images) must match the file size
$messages[] = Piwik::translate('General_ExceptionFilesizeMismatch', array($file, $props[0], filesize($file)));
@@ -153,7 +152,7 @@ class Filechecks
$messages[] = Piwik::translate('General_ExceptionFilesizeMismatch', array($file, $props[0], filesize($file)));
}
}
- } else if ($hasMd5file && (@md5_file($file) !== $props[1])) {
+ } elseif ($hasMd5file && (@md5_file($file) !== $props[1])) {
$messages[] = Piwik::translate('General_ExceptionFileIntegrity', $file);
}
}
diff --git a/core/Filesystem.php b/core/Filesystem.php
index 850b44da63..d50c2d8e28 100644
--- a/core/Filesystem.php
+++ b/core/Filesystem.php
@@ -118,8 +118,9 @@ class Filesystem
// and the return code 1. if NFS, it will return 0 and at least 2 lines of text.
$command = "df -T -t nfs \"$sessionsPath\" 2>&1";
- if (function_exists('exec')) // use exec
- {
+ if (function_exists('exec')) {
+ // use exec
+
$output = $returnCode = null;
@exec($command, $output, $returnCode);
@@ -129,13 +130,15 @@ class Filesystem
) {
return true;
}
- } else if (function_exists('shell_exec')) // use shell_exec
- {
+ } elseif (function_exists('shell_exec')) {
+ // use shell_exec
+
$output = @shell_exec($command);
if ($output) {
$output = explode("\n", $output);
- if (count($output) > 1) // check if filesystem is NFS
- {
+ if (count($output) > 1) {
+ // check if filesystem is NFS
+
return true;
}
}
@@ -318,7 +321,6 @@ class Filesystem
if (!empty($path_parts['extension'])
&& in_array($path_parts['extension'], $phpExtensions)) {
-
return true;
}
@@ -464,7 +466,6 @@ class Filesystem
}
if (function_exists('xcache_clear_cache') && defined('XC_TYPE_VAR')) {
-
if (ini_get('xcache.admin.enable_auth')) {
// XCache will not be cleared because "xcache.admin.enable_auth" is enabled in php.ini.
} else {
@@ -476,7 +477,6 @@ class Filesystem
private static function havePhpFilesSameContent($file1, $file2)
{
if (self::hasPHPExtension($file1)) {
-
$sourceMd5 = md5_file($file1);
$destMd5 = md5_file($file2);
@@ -503,5 +503,4 @@ class Filesystem
return true;
}
-
}
diff --git a/core/FrontController.php b/core/FrontController.php
index 31a447da36..4b47d9024b 100644
--- a/core/FrontController.php
+++ b/core/FrontController.php
@@ -11,15 +11,12 @@ namespace Piwik;
use Exception;
use Piwik\API\Request;
-use Piwik\API\ResponseBuilder;
use Piwik\Container\StaticContainer;
use Piwik\Exception\AuthenticationFailedException;
use Piwik\Exception\DatabaseSchemaIsNewerThanCodebaseException;
use Piwik\Http\ControllerResolver;
use Piwik\Http\Router;
-use Piwik\Plugin\Report;
use Piwik\Plugins\CoreAdminHome\CustomLogo;
-use Piwik\Session;
/**
* This singleton dispatches requests to the appropriate plugin Controller.
@@ -170,7 +167,7 @@ class FrontController extends Singleton
public static function setUpSafeMode()
{
- register_shutdown_function(array('\\Piwik\\FrontController','triggerSafeModeWhenError'));
+ register_shutdown_function(array('\\Piwik\\FrontController', 'triggerSafeModeWhenError'));
}
public static function triggerSafeModeWhenError()
diff --git a/core/Http.php b/core/Http.php
index 668a9dbe10..91956c9f29 100644
--- a/core/Http.php
+++ b/core/Http.php
@@ -144,8 +144,7 @@ class Http
$httpMethod = 'GET',
$httpUsername = null,
$httpPassword = null
- )
- {
+ ) {
if ($followDepth > 5) {
throw new Exception('Too many redirects (' . $followDepth . ')');
}
@@ -388,7 +387,7 @@ class Http
// determine success or failure
@fclose(@$fsock);
- } else if ($method == 'fopen') {
+ } elseif ($method == 'fopen') {
$response = false;
// we make sure the request takes less than a few seconds to fail
@@ -456,7 +455,7 @@ class Http
if (!empty($default_socket_timeout)) {
@ini_set('default_socket_timeout', $default_socket_timeout);
}
- } else if ($method == 'curl') {
+ } elseif ($method == 'curl') {
if (!self::isCurlEnabled()) {
// can be triggered in tests
throw new Exception("CURL is not enabled in php.ini, but is being used.");
@@ -501,7 +500,7 @@ class Http
@curl_setopt($ch, CURLOPT_NOBODY, true);
}
- if(!empty($httpUsername) && !empty($httpPassword)) {
+ if (!empty($httpUsername) && !empty($httpPassword)) {
$curl_options += array(
CURLOPT_USERPWD => $httpUsername . ':' . $httpPassword,
);
@@ -537,7 +536,7 @@ class Http
if ($response === true) {
$response = '';
- } else if ($response === false) {
+ } elseif ($response === false) {
$errstr = curl_error($ch);
if ($errstr != '') {
throw new Exception('curl_exec: ' . $errstr
@@ -824,4 +823,4 @@ class Http
}
return $modifiedSince;
}
-} \ No newline at end of file
+}
diff --git a/core/Http/ControllerResolver.php b/core/Http/ControllerResolver.php
index 8d58f0ed73..569fbee49e 100644
--- a/core/Http/ControllerResolver.php
+++ b/core/Http/ControllerResolver.php
@@ -13,7 +13,6 @@ use Exception;
use Piwik\Plugin\Controller;
use Piwik\Plugin\Report;
use Piwik\Plugin\Widgets;
-use Piwik\Session;
/**
* Resolves the controller that will handle the request.
diff --git a/core/Mail.php b/core/Mail.php
index 9825eb3378..2c5405cf46 100644
--- a/core/Mail.php
+++ b/core/Mail.php
@@ -116,7 +116,7 @@ class Mail extends Zend_Mail
@ini_set("smtp_port", $mailConfig['port']);
}
- public function send($transport = NULL)
+ public function send($transport = null)
{
if (defined('PIWIK_TEST_MODE')) { // hack
Piwik::postTestEvent("Test.Mail.send", array($this));
diff --git a/core/Menu/Group.php b/core/Menu/Group.php
index 90e063e264..a13da035b3 100644
--- a/core/Menu/Group.php
+++ b/core/Menu/Group.php
@@ -21,7 +21,7 @@ class Group
'name' => $subTitleMenu,
'url' => $url,
'tooltip' => $tooltip
- );;
+ );
}
public function getItems()
diff --git a/core/Menu/MenuAbstract.php b/core/Menu/MenuAbstract.php
index 539cbac7e7..4e9e090dad 100644
--- a/core/Menu/MenuAbstract.php
+++ b/core/Menu/MenuAbstract.php
@@ -240,8 +240,7 @@ abstract class MenuAbstract extends Singleton
private function applyRemoves()
{
- foreach($this->menuEntriesToRemove as $menuToDelete) {
-
+ foreach ($this->menuEntriesToRemove as $menuToDelete) {
if (empty($menuToDelete[1])) {
// Delete Main Menu
if (isset($this->menu[$menuToDelete[0]])) {
@@ -275,7 +274,7 @@ abstract class MenuAbstract extends Singleton
$this->menu[$mainMenuRenamed][$subMenuRenamed] = $save;
}
} // Changing a first-level element
- else if (isset($this->menu[$mainMenuOriginal])) {
+ elseif (isset($this->menu[$mainMenuOriginal])) {
$save = $this->menu[$mainMenuOriginal];
$save['_name'] = $mainMenuRenamed;
unset($this->menu[$mainMenuOriginal]);
@@ -299,7 +298,7 @@ abstract class MenuAbstract extends Singleton
foreach ($this->menu as $key => &$element) {
if (is_null($element)) {
unset($this->menu[$key]);
- } else if ($element['_hasSubmenu']) {
+ } elseif ($element['_hasSubmenu']) {
uasort($element, array($this, 'menuCompare'));
}
}
diff --git a/core/Menu/MenuReporting.php b/core/Menu/MenuReporting.php
index ac35151bcb..598a757633 100644
--- a/core/Menu/MenuReporting.php
+++ b/core/Menu/MenuReporting.php
@@ -7,6 +7,7 @@
*
*/
namespace Piwik\Menu;
+
use Piwik\Piwik;
use Piwik\Plugin\Report;
@@ -135,7 +136,6 @@ class MenuReporting extends MenuAbstract
foreach ($this->getAllMenus() as $menu) {
$menu->configureReportingMenu($this);
}
-
}
return parent::getMenu();
diff --git a/core/Menu/MenuTop.php b/core/Menu/MenuTop.php
index 87ccb3c5f8..687b1b46cf 100644
--- a/core/Menu/MenuTop.php
+++ b/core/Menu/MenuTop.php
@@ -7,6 +7,7 @@
*
*/
namespace Piwik\Menu;
+
use Piwik\Piwik;
/**
diff --git a/core/Metrics.php b/core/Metrics.php
index 4b48bf13f2..ffaa26a4a3 100644
--- a/core/Metrics.php
+++ b/core/Metrics.php
@@ -304,7 +304,7 @@ class Metrics
*/
Piwik::postEvent('Metrics.getDefaultMetricTranslations', array(&$translations));
- $translations = array_map(array('\\Piwik\\Piwik','translate'), $translations);
+ $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations);
$cache->save($cacheId, $translations);
@@ -326,7 +326,7 @@ class Metrics
'nb_actions' => 'General_ColumnNbActions',
'nb_users' => 'General_ColumnNbUsers',
);
- $translations = array_map(array('\\Piwik\\Piwik','translate'), $translations);
+ $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations);
$cache->save($cacheId, $translations);
@@ -349,7 +349,7 @@ class Metrics
'bounce_rate' => 'General_ColumnBounceRate',
'conversion_rate' => 'General_ColumnConversionRate',
);
- $translations = array_map(array('\\Piwik\\Piwik','translate'), $translations);
+ $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations);
$cache->save($cacheId, $translations);
@@ -361,7 +361,6 @@ class Metrics
$mappingIdToName = self::$mappingFromIdToName;
if (array_key_exists($columnIdRaw, $mappingIdToName)) {
-
return $mappingIdToName[$columnIdRaw];
}
@@ -417,7 +416,7 @@ class Metrics
*/
Piwik::postEvent('Metrics.getDefaultMetricDocumentationTranslations', array(&$translations));
- $translations = array_map(array('\\Piwik\\Piwik','translate'), $translations);
+ $translations = array_map(array('\\Piwik\\Piwik', 'translate'), $translations);
$cache->save($cacheId, $translations);
diff --git a/core/Metrics/Formatter.php b/core/Metrics/Formatter.php
index bce37e3be4..0e54dd959b 100644
--- a/core/Metrics/Formatter.php
+++ b/core/Metrics/Formatter.php
@@ -321,4 +321,4 @@ class Formatter
{
return Report::getMetricsForTable($dataTable, $report, $baseType = 'Piwik\\Plugin\\Metric');
}
-} \ No newline at end of file
+}
diff --git a/core/Metrics/Formatter/Html.php b/core/Metrics/Formatter/Html.php
index c4f9e05664..60c2f43c14 100644
--- a/core/Metrics/Formatter/Html.php
+++ b/core/Metrics/Formatter/Html.php
@@ -40,4 +40,4 @@ class Html extends Formatter
{
return str_replace(' ', '&nbsp;', $value);
}
-} \ No newline at end of file
+}
diff --git a/core/Period/Factory.php b/core/Period/Factory.php
index 2da4bd9f55..88c29a92e2 100644
--- a/core/Period/Factory.php
+++ b/core/Period/Factory.php
@@ -9,7 +9,6 @@
namespace Piwik\Period;
use Exception;
-use Piwik\Config;
use Piwik\Date;
use Piwik\Period;
use Piwik\Piwik;
diff --git a/core/Period/Month.php b/core/Period/Month.php
index 9acf63b1b2..68d97e1d5f 100644
--- a/core/Period/Month.php
+++ b/core/Period/Month.php
@@ -82,7 +82,6 @@ class Month extends Period
{
while ($startDate->isEarlier($endDate)
|| $startDate == $endDate) {
-
$week = new Week($startDate);
$startOfWeek = $week->getDateStart();
$endOfWeek = $week->getDateEnd();
@@ -112,5 +111,4 @@ class Month extends Period
$startDate = $startDate->addDay(1);
}
}
-
}
diff --git a/core/Period/Range.php b/core/Period/Range.php
index 77d7afdcbd..9e14565517 100644
--- a/core/Period/Range.php
+++ b/core/Period/Range.php
@@ -241,7 +241,6 @@ class Range extends Period
}
$startDate = $endDate->addPeriod(-1 * $lastN, $period);
-
} elseif ($dateRange = Range::parseDateRange($this->strDate)) {
$strDateStart = $dateRange[1];
$strDateEnd = $dateRange[2];
@@ -338,7 +337,7 @@ class Range extends Period
) {
$this->addSubperiod($year);
$endOfPeriod = $endOfYear;
- } else if ($startDate == $startOfMonth
+ } elseif ($startDate == $startOfMonth
&& ($endOfMonth->isEarlier($endDate)
|| $endOfMonth == $endDate
|| $endOfMonth->isLater($this->today)
@@ -460,8 +459,9 @@ class Range extends Period
$strLastDate = false;
$lastPeriod = false;
if ($period != 'range' && !preg_match('/(last|previous)([0-9]*)/', $date, $regs)) {
- if (strpos($date, ',')) // date in the form of 2011-01-01,2011-02-02
- {
+ if (strpos($date, ',')) {
+ // date in the form of 2011-01-01,2011-02-02
+
$rangePeriod = new Range($period, $date);
$lastStartDate = $rangePeriod->getDateStart()->subPeriod($subXPeriods, $period);
diff --git a/core/Period/Year.php b/core/Period/Year.php
index cb2d202ff7..ccd9c2e2b3 100644
--- a/core/Period/Year.php
+++ b/core/Period/Year.php
@@ -76,7 +76,7 @@ class Year extends Period
* @param string $format
* @return array
*/
- function toString($format = 'ignored')
+ public function toString($format = 'ignored')
{
$this->generate();
diff --git a/core/Piwik.php b/core/Piwik.php
index fa2392a14b..cfc1d995bd 100644
--- a/core/Piwik.php
+++ b/core/Piwik.php
@@ -9,16 +9,7 @@
namespace Piwik;
use Exception;
-use Piwik\Container\StaticContainer;
-use Piwik\Db\Adapter;
-use Piwik\Db\Schema;
-use Piwik\Db;
-use Piwik\Plugin;
-use Piwik\Plugins\UsersManager\API as APIUsersManager;
-use Piwik\Session;
-use Piwik\Tracker;
-use Piwik\Translation\Translator;
-use Piwik\View;
+use Piwik\Container\StaticContainer;use Piwik\Plugins\UsersManager\API as APIUsersManager;use Piwik\Translation\Translator;
/**
* @see core/Translate.php
@@ -203,7 +194,7 @@ class Piwik
{
$login = Access::getInstance()->getLogin();
- if(empty($login)) {
+ if (empty($login)) {
return 'anonymous';
}
return $login;
@@ -301,7 +292,6 @@ class Piwik
$hasAccess = Access::getInstance()->hasSuperUserAccess();
return $hasAccess;
-
} catch (Exception $e) {
return false;
}
@@ -635,8 +625,9 @@ class Piwik
reset($array);
if (!is_numeric(key($array))
|| key($array) != 0
- ) // first key must be 0
- {
+ ) {
+ // first key must be 0
+
return true;
}
@@ -649,7 +640,7 @@ class Piwik
if ($next === null) {
break;
- } else if ($current + 1 != $next) {
+ } elseif ($current + 1 != $next) {
return true;
}
}
diff --git a/core/Plugin.php b/core/Plugin.php
index bb361b5bb5..1cdbefdc7f 100644
--- a/core/Plugin.php
+++ b/core/Plugin.php
@@ -335,7 +335,6 @@ class Plugin
if (file_exists($componentFile)) {
include_once $componentFile;
}
-
} else {
$this->cache->save($cacheId, false); // prevent from trying to load over and over again for instance if there is no Menu for a plugin
diff --git a/core/Plugin/API.php b/core/Plugin/API.php
index 40bd334f95..c54e10a82b 100644
--- a/core/Plugin/API.php
+++ b/core/Plugin/API.php
@@ -50,7 +50,8 @@ abstract class API
*
* @return static
*/
- public static function getInstance() {
+ public static function getInstance()
+ {
$class = get_called_class();
if (!isset(self::$instances[$class])) {
diff --git a/core/Plugin/AggregatedMetric.php b/core/Plugin/AggregatedMetric.php
index 7df1535727..6324390ee3 100644
--- a/core/Plugin/AggregatedMetric.php
+++ b/core/Plugin/AggregatedMetric.php
@@ -7,7 +7,6 @@
*/
namespace Piwik\Plugin;
-use Piwik\DataTable\Row;
/**
* Base type for metric metadata classes that describe aggregated metrics. These metrics are
@@ -19,4 +18,4 @@ use Piwik\DataTable\Row;
abstract class AggregatedMetric extends Metric
{
// stub, to be filled out later
-} \ No newline at end of file
+}
diff --git a/core/Plugin/ComponentFactory.php b/core/Plugin/ComponentFactory.php
index 751f1157d4..c0b3c7bff5 100644
--- a/core/Plugin/ComponentFactory.php
+++ b/core/Plugin/ComponentFactory.php
@@ -128,4 +128,4 @@ class ComponentFactory
return null;
}
}
-} \ No newline at end of file
+}
diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php
index e7f96a490c..3e710608eb 100644
--- a/core/Plugin/Controller.php
+++ b/core/Plugin/Controller.php
@@ -778,7 +778,7 @@ abstract class Controller
$validHost,
'</a>'
));
- } else if (Piwik::isUserIsAnonymous()) {
+ } elseif (Piwik::isUserIsAnonymous()) {
$view->invalidHostMessage = $warningStart . ' '
. Piwik::translate('CoreHome_InjectedHostNonSuperUserWarning', array(
"<br/><a href=\"$validUrl\">",
@@ -860,7 +860,7 @@ abstract class Controller
{
try {
$this->doRedirectToUrl($moduleToRedirect, $actionToRedirect, $websiteId, $defaultPeriod, $defaultDate, $parameters);
- } catch(Exception $e) {
+ } catch (Exception $e) {
// no website ID to default to, so could not redirect
}
@@ -926,8 +926,9 @@ abstract class Controller
*/
public static function getCalendarPrettyDate($period)
{
- if ($period instanceof Month) // show month name when period is for a month
- {
+ if ($period instanceof Month) {
+ // show month name when period is for a month
+
return $period->getLocalizedLongString();
} else {
return $period->getPrettyString();
@@ -976,7 +977,7 @@ abstract class Controller
if ($evolutionPercent < 0) {
$class = "negative-evolution";
$img = "arrow_down.png";
- } else if ($evolutionPercent == 0) {
+ } elseif ($evolutionPercent == 0) {
$class = "neutral-evolution";
$img = "stop.png";
} else {
@@ -1008,7 +1009,7 @@ abstract class Controller
{
if (!empty($this->idSite) && empty($this->site)) {
throw new NoAccessException(Piwik::translate('General_ExceptionPrivilegeAccessWebsite', array("'view'", $this->idSite)));
- } else if (empty($this->site) || empty($this->idSite)) {
+ } elseif (empty($this->site) || empty($this->idSite)) {
throw new Exception("The requested website idSite is not found in the request, or is invalid.
Please check that you are logged in Piwik and have permission to access the specified website.");
}
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php
index b0c86a6b1a..c82fcaf92b 100644
--- a/core/Plugin/ControllerAdmin.php
+++ b/core/Plugin/ControllerAdmin.php
@@ -221,5 +221,4 @@ abstract class ControllerAdmin extends Controller
{
return strpos(PHP_VERSION, '5.3') === 0;
}
-
}
diff --git a/core/Plugin/Dependency.php b/core/Plugin/Dependency.php
index 7e87324612..bcade2b3ca 100644
--- a/core/Plugin/Dependency.php
+++ b/core/Plugin/Dependency.php
@@ -51,12 +51,11 @@ class Dependency
public function getMissingVersions($currentVersion, $requiredVersion)
{
$currentVersion = trim($currentVersion);
- $requiredVersions = explode(',' , (string) $requiredVersion);
+ $requiredVersions = explode(',', (string) $requiredVersion);
$missingVersions = array();
foreach ($requiredVersions as $required) {
-
$comparison = '>=';
$required = trim($required);
@@ -98,7 +97,8 @@ class Dependency
if (!empty($plugin)) {
return $plugin->getVersion();
}
- } catch (\Exception $e) {}
+ } catch (\Exception $e) {
+ }
}
return '';
diff --git a/core/Plugin/Dimension/ActionDimension.php b/core/Plugin/Dimension/ActionDimension.php
index d12e7b45a7..3c697641a3 100644
--- a/core/Plugin/Dimension/ActionDimension.php
+++ b/core/Plugin/Dimension/ActionDimension.php
@@ -19,7 +19,6 @@ use Piwik\Db;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
use Piwik\Tracker\Visitor;
-use Piwik\Translate;
use Exception;
/**
@@ -218,7 +217,6 @@ abstract class ActionDimension extends Dimension
$cache = PiwikCache::getTransientCache();
if (!$cache->contains($cacheId)) {
-
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
$instances = array();
@@ -251,5 +249,4 @@ abstract class ActionDimension extends Dimension
return $instances;
}
-
}
diff --git a/core/Plugin/Dimension/ConversionDimension.php b/core/Plugin/Dimension/ConversionDimension.php
index 34a8006111..e20f1eeeaf 100644
--- a/core/Plugin/Dimension/ConversionDimension.php
+++ b/core/Plugin/Dimension/ConversionDimension.php
@@ -18,7 +18,6 @@ use Piwik\Tracker\Action;
use Piwik\Tracker\GoalManager;
use Piwik\Tracker\Request;
use Piwik\Tracker\Visitor;
-use Piwik\Translate;
use Piwik\Plugin\Segment;
use Piwik\Plugin;
use Exception;
@@ -160,7 +159,6 @@ abstract class ConversionDimension extends Dimension
$cache = PiwikCache::getTransientCache();
if (!$cache->contains($cacheId)) {
-
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
$instances = array();
@@ -244,5 +242,4 @@ abstract class ConversionDimension extends Dimension
{
return false;
}
-
}
diff --git a/core/Plugin/Dimension/VisitDimension.php b/core/Plugin/Dimension/VisitDimension.php
index 97dfd6f57b..b93ca041b6 100644
--- a/core/Plugin/Dimension/VisitDimension.php
+++ b/core/Plugin/Dimension/VisitDimension.php
@@ -19,7 +19,6 @@ use Piwik\Tracker\Request;
use Piwik\Tracker\Visitor;
use Piwik\Tracker\Action;
use Piwik\Tracker;
-use Piwik\Translate;
use Piwik\Plugin;
use Exception;
@@ -299,7 +298,6 @@ abstract class VisitDimension extends Dimension
$cache = PiwikCache::getTransientCache();
if (!$cache->contains($cacheId)) {
-
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
$instances = array();
@@ -352,5 +350,4 @@ abstract class VisitDimension extends Dimension
return $instances;
}
-
}
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php
index 341f2f3c47..8790175128 100644
--- a/core/Plugin/Manager.php
+++ b/core/Plugin/Manager.php
@@ -15,7 +15,6 @@ use Piwik\Columns\Dimension;
use Piwik\Config as PiwikConfig;
use Piwik\Config;
use Piwik\Container\StaticContainer;
-use Piwik\Db;
use Piwik\EventDispatcher;
use Piwik\Filesystem;
use Piwik\Log;
@@ -141,7 +140,6 @@ class Manager
if ($cache->contains($cacheId)) {
$pluginsTracker = $cache->fetch($cacheId);
} else {
-
$this->unloadPlugins();
$this->loadActivatedPlugins();
@@ -196,7 +194,7 @@ class Manager
public function getCorePluginsDisabledByDefault()
{
- return array_merge( $this->corePluginsDisabledByDefault, $this->coreThemesDisabledByDefault);
+ return array_merge($this->corePluginsDisabledByDefault, $this->coreThemesDisabledByDefault);
}
// If a plugin hooks onto at least an event starting with "Tracker.", we load the plugin during tracker
@@ -244,7 +242,7 @@ class Manager
public function clearPluginsInstalledConfig()
{
- $this->updatePluginsInstalledConfig( array() );
+ $this->updatePluginsInstalledConfig(array());
PiwikConfig::getInstance()->forceSave();
}
@@ -1309,7 +1307,7 @@ class Manager
protected function isPluginEnabledByDefault($name)
{
$pluginsBundledWithPiwik = $this->getPluginsFromGlobalIniConfigFile();
- if(empty($pluginsBundledWithPiwik)) {
+ if (empty($pluginsBundledWithPiwik)) {
return false;
}
return in_array($name, $pluginsBundledWithPiwik);
@@ -1333,7 +1331,7 @@ class Manager
private function sortPluginsSameOrderAsGlobalConfig(array $plugins)
{
$global = $this->getPluginsFromGlobalIniConfigFile();
- if(empty($global)) {
+ if (empty($global)) {
return $plugins;
}
$global = array_values($global);
diff --git a/core/Plugin/Menu.php b/core/Plugin/Menu.php
index 10d7945bf5..dd1dcaf7f3 100644
--- a/core/Plugin/Menu.php
+++ b/core/Plugin/Menu.php
@@ -268,5 +268,4 @@ class Menu
Development::error($prefix . 'The defined action "' . $action . '" is not callable on "' . $controllerClass . '". Make sure the method is public.');
}
}
-
}
diff --git a/core/Plugin/MetadataLoader.php b/core/Plugin/MetadataLoader.php
index e75bc58338..703cf6ba5f 100644
--- a/core/Plugin/MetadataLoader.php
+++ b/core/Plugin/MetadataLoader.php
@@ -9,7 +9,6 @@
namespace Piwik\Plugin;
use Exception;
-use Piwik\Common;
use Piwik\Piwik;
use Piwik\Version;
diff --git a/core/Plugin/Metric.php b/core/Plugin/Metric.php
index 4122dfeedf..6349ca6999 100644
--- a/core/Plugin/Metric.php
+++ b/core/Plugin/Metric.php
@@ -112,7 +112,6 @@ abstract class Metric
$value = $row->getColumn($columnName);
if ($value === false) {
-
if (empty($mappingNameToId)) {
$mappingNameToId = Metrics::getMappingFromNameToId();
}
@@ -123,14 +122,10 @@ abstract class Metric
}
return $value;
-
} elseif (!empty($row)) {
-
if (array_key_exists($columnName, $row)) {
return $row[$columnName];
-
} else {
-
if (empty($mappingNameToId)) {
$mappingNameToId = Metrics::getMappingFromNameToId();
}
@@ -191,4 +186,4 @@ abstract class Metric
}
return $columnName;
}
-} \ No newline at end of file
+}
diff --git a/core/Plugin/ProcessedMetric.php b/core/Plugin/ProcessedMetric.php
index 20201d0887..108612c805 100644
--- a/core/Plugin/ProcessedMetric.php
+++ b/core/Plugin/ProcessedMetric.php
@@ -67,4 +67,4 @@ abstract class ProcessedMetric extends Metric
{
return true;
}
-} \ No newline at end of file
+}
diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php
index a1c54e59d1..75d76fca33 100644
--- a/core/Plugin/Report.php
+++ b/core/Plugin/Report.php
@@ -297,7 +297,7 @@ class Report
* Defaults to false
* @return bool
*/
- public function alwaysUseDefaultViewDataTable ()
+ public function alwaysUseDefaultViewDataTable()
{
return false;
}
@@ -312,7 +312,6 @@ class Report
*/
public function configureView(ViewDataTable $view)
{
-
}
/**
@@ -433,7 +432,7 @@ class Report
foreach ($restrictToColumns as $column) {
if (isset($processedMetricsById[$column])) {
$metrics = array_merge($metrics, $processedMetricsById[$column]->getDependentMetrics());
- } else if (isset($metricsSet[$column])) {
+ } elseif (isset($metricsSet[$column])) {
$metrics[] = $column;
}
}
@@ -498,7 +497,6 @@ class Report
if (is_string($processedMetric) && !empty($translations[$processedMetric])) {
$documentation[$processedMetric] = $translations[$processedMetric];
} elseif ($processedMetric instanceof ProcessedMetric) {
-
$name = $processedMetric->getName();
$metricDocs = $processedMetric->getDocumentation();
if (empty($metricDocs)) {
@@ -509,7 +507,6 @@ class Report
$documentation[$processedMetric->getName()] = $metricDocs;
}
}
-
}
return $documentation;
@@ -990,4 +987,4 @@ class Report
{
return self::getMetricsForTable($dataTable, $report, 'Piwik\\Plugin\\ProcessedMetric');
}
-} \ No newline at end of file
+}
diff --git a/core/Plugin/Segment.php b/core/Plugin/Segment.php
index 2f0c84db63..8553703b08 100644
--- a/core/Plugin/Segment.php
+++ b/core/Plugin/Segment.php
@@ -67,7 +67,6 @@ class Segment
*/
protected function init()
{
-
}
/**
@@ -201,7 +200,8 @@ class Segment
*
* @param callable $suggestedValuesCallback
*/
- public function setSuggestedValuesCallback($suggestedValuesCallback) {
+ public function setSuggestedValuesCallback($suggestedValuesCallback)
+ {
$this->suggestedValuesCallback = $suggestedValuesCallback;
}
@@ -253,4 +253,4 @@ class Segment
return $segment;
}
-} \ No newline at end of file
+}
diff --git a/core/Plugin/Settings.php b/core/Plugin/Settings.php
index 8a674ae370..1066ea6aff 100644
--- a/core/Plugin/Settings.php
+++ b/core/Plugin/Settings.php
@@ -64,7 +64,6 @@ abstract class Settings
if (!empty($pluginName)) {
$this->pluginName = $pluginName;
} else {
-
$classname = get_class($this);
$parts = explode('\\', $classname);
diff --git a/core/Plugin/Tasks.php b/core/Plugin/Tasks.php
index 2d131d86c4..19f9e5bb39 100644
--- a/core/Plugin/Tasks.php
+++ b/core/Plugin/Tasks.php
@@ -151,4 +151,4 @@ class Tasks
{
Development::checkMethodIsCallable($objectOrClassName, $methodName, 'The registered task is not valid as the method');
}
-} \ No newline at end of file
+}
diff --git a/core/Plugin/ViewDataTable.php b/core/Plugin/ViewDataTable.php
index a49358e48b..eb733265ff 100644
--- a/core/Plugin/ViewDataTable.php
+++ b/core/Plugin/ViewDataTable.php
@@ -347,7 +347,7 @@ abstract class ViewDataTable implements ViewInterface
throw new \Exception($message);
}
- return $id;
+ return $id;
}
/**
@@ -514,5 +514,4 @@ abstract class ViewDataTable implements ViewInterface
}
}
}
-
}
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php
index 6e6b4802a0..ceccc4ab13 100644
--- a/core/Plugin/Visualization.php
+++ b/core/Plugin/Visualization.php
@@ -508,7 +508,7 @@ class Visualization extends ViewDataTable
foreach ($this->config->clientSideProperties as $name) {
if (property_exists($this->requestConfig, $name)) {
$result[$name] = $this->getIntIfValueIsBool($this->requestConfig->$name);
- } else if (property_exists($this->config, $name)) {
+ } elseif (property_exists($this->config, $name)) {
$result[$name] = $this->getIntIfValueIsBool($this->config->$name);
}
}
@@ -562,7 +562,7 @@ class Visualization extends ViewDataTable
if (property_exists($this->requestConfig, $name)) {
$valueToConvert = $this->requestConfig->$name;
- } else if (property_exists($this->config, $name)) {
+ } elseif (property_exists($this->config, $name)) {
$valueToConvert = $this->config->$name;
}
@@ -719,7 +719,7 @@ class Visualization extends ViewDataTable
/**
* @internal
- *
+ *
* @return array
*/
public function buildApiRequestArray()
diff --git a/core/Plugin/Widgets.php b/core/Plugin/Widgets.php
index 2c86fe045f..10566a9a7a 100644
--- a/core/Plugin/Widgets.php
+++ b/core/Plugin/Widgets.php
@@ -106,7 +106,6 @@ class Widgets
*/
public function configureWidgetsList(WidgetsList $widgetsList)
{
-
}
/**
diff --git a/core/Profiler.php b/core/Profiler.php
index e3bbfb47e3..c1b0875fa6 100644
--- a/core/Profiler.php
+++ b/core/Profiler.php
@@ -9,7 +9,6 @@
namespace Piwik;
use Exception;
-use Piwik\Container\StaticContainer;
use XHProfRuns_Default;
/**
@@ -228,7 +227,8 @@ class Profiler
}
if (!function_exists('xhprof_error')) {
- function xhprof_error($out) {
+ function xhprof_error($out)
+ {
echo substr($out, 0, 300) . '...';
}
}
@@ -245,7 +245,7 @@ class Profiler
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
- register_shutdown_function(function () use($profilerNamespace, $mainRun) {
+ register_shutdown_function(function () use ($profilerNamespace, $mainRun) {
$xhprofData = xhprof_disable();
$xhprofRuns = new XHProfRuns_Default();
$runId = $xhprofRuns->save_run($xhprofData, $profilerNamespace);
@@ -324,13 +324,13 @@ class Profiler
public static function setProfilingRunIds($ids)
{
- file_put_contents( self::getPathToXHProfRunIds(), json_encode($ids) );
+ file_put_contents(self::getPathToXHProfRunIds(), json_encode($ids));
@chmod(self::getPathToXHProfRunIds(), 0777);
}
public static function getProfilingRunIds()
{
- $runIds = file_get_contents( self::getPathToXHProfRunIds() );
+ $runIds = file_get_contents(self::getPathToXHProfRunIds());
$array = json_decode($runIds, $assoc = true);
if (!is_array($array)) {
$array = array();
diff --git a/core/ProxyHttp.php b/core/ProxyHttp.php
index b2939e9a39..790d62229d 100644
--- a/core/ProxyHttp.php
+++ b/core/ProxyHttp.php
@@ -234,7 +234,7 @@ class ProxyHttp
if (preg_match(self::DEFLATE_ENCODING_REGEX, $acceptEncoding, $matches)) {
return array('deflate', '.deflate');
- } else if (preg_match(self::GZIP_ENCODING_REGEX, $acceptEncoding, $matches)) {
+ } elseif (preg_match(self::GZIP_ENCODING_REGEX, $acceptEncoding, $matches)) {
return array('gzip', '.gz');
} else {
return array(false, false);
@@ -262,7 +262,7 @@ class ProxyHttp
if ($compressionEncoding == 'deflate') {
$data = gzdeflate($data, 9);
- } else if ($compressionEncoding == 'gzip' || $compressionEncoding == 'x-gzip') {
+ } elseif ($compressionEncoding == 'gzip' || $compressionEncoding == 'x-gzip') {
$data = gzencode($data, 9);
}
diff --git a/core/QuickForm2.php b/core/QuickForm2.php
index e2ecbf5b3c..49b2167289 100644
--- a/core/QuickForm2.php
+++ b/core/QuickForm2.php
@@ -27,7 +27,7 @@ abstract class QuickForm2 extends HTML_QuickForm2
{
protected $a_formElements = array();
- function __construct($id, $method = 'post', $attributes = null, $trackSubmit = false)
+ public function __construct($id, $method = 'post', $attributes = null, $trackSubmit = false)
{
if (!isset($attributes['action'])) {
$attributes['action'] = Url::getCurrentQueryString();
@@ -43,7 +43,7 @@ abstract class QuickForm2 extends HTML_QuickForm2
/**
* Class specific initialization
*/
- abstract function init();
+ abstract public function init();
/**
* The elements in this form
@@ -77,7 +77,7 @@ abstract class QuickForm2 extends HTML_QuickForm2
return parent::addElement($elementOrType, $name, $attributes, $data);
}
- function setChecked($nameElement)
+ public function setChecked($nameElement)
{
foreach ($this->_elements as $key => $value) {
if ($value->_attributes['name'] == $nameElement) {
@@ -86,7 +86,7 @@ abstract class QuickForm2 extends HTML_QuickForm2
}
}
- function setSelected($nameElement, $value)
+ public function setSelected($nameElement, $value)
{
foreach ($this->_elements as $key => $value) {
if ($value->_attributes['name'] == $nameElement) {
@@ -101,7 +101,7 @@ abstract class QuickForm2 extends HTML_QuickForm2
* @param string $elementName
* @return mixed
*/
- function getSubmitValue($elementName)
+ public function getSubmitValue($elementName)
{
$value = $this->getValue();
return isset($value[$elementName]) ? $value[$elementName] : null;
diff --git a/core/ReportRenderer.php b/core/ReportRenderer.php
index 443c16df76..a693d1b7f3 100644
--- a/core/ReportRenderer.php
+++ b/core/ReportRenderer.php
@@ -13,9 +13,7 @@ use Piwik\API\Request;
use Piwik\Container\StaticContainer;
use Piwik\DataTable\Row;
use Piwik\DataTable\Simple;
-use Piwik\DataTable;
use Piwik\Plugins\ImageGraph\API;
-use Piwik\BaseFactory;
/**
* A Report Renderer produces user friendly renderings of any given Piwik report.
@@ -164,7 +162,7 @@ abstract class ReportRenderer extends BaseFactory
$bytesWritten = file_put_contents($outputFilename, $content);
if ($bytesWritten === false) {
- throw new Exception ("ReportRenderer: Could not write to file '" . $outputFilename . "'.");
+ throw new Exception("ReportRenderer: Could not write to file '" . $outputFilename . "'.");
}
return $outputFilename;
diff --git a/core/ReportRenderer/Html.php b/core/ReportRenderer/Html.php
index 6c0e950c3e..3ff0fd0d40 100644
--- a/core/ReportRenderer/Html.php
+++ b/core/ReportRenderer/Html.php
@@ -172,7 +172,6 @@ class Html extends ReportRenderer
foreach ($processedReports as $processedReport) {
if ($processedReport['displayGraph']) {
-
$additionalFiles[] = $this->getAttachment($report, $processedReport, $prettyDate);
}
}
diff --git a/core/ReportRenderer/Pdf.php b/core/ReportRenderer/Pdf.php
index 4f0ee97bdc..8c1dbcf2b5 100644
--- a/core/ReportRenderer/Pdf.php
+++ b/core/ReportRenderer/Pdf.php
@@ -196,7 +196,6 @@ class Pdf extends ReportRenderer
// segment
if ($segment != null) {
-
$this->TCPDF->Ln();
$this->TCPDF->Ln();
$this->TCPDF->SetFont($this->reportFont, '', $this->reportHeaderFontSize - 2);
@@ -472,7 +471,7 @@ class Pdf extends ReportRenderer
&& $columnsCount <= 3
) {
$totalWidth = $this->reportWidthPortrait * 2 / 3;
- } else if ($this->orientation == self::LANDSCAPE) {
+ } elseif ($this->orientation == self::LANDSCAPE) {
$totalWidth = $this->reportWidthLandscape;
} else {
$totalWidth = $this->reportWidthPortrait;
diff --git a/core/Scheduler/Schedule/Daily.php b/core/Scheduler/Schedule/Daily.php
index 7b1248f187..e459fbfe96 100644
--- a/core/Scheduler/Schedule/Daily.php
+++ b/core/Scheduler/Schedule/Daily.php
@@ -51,6 +51,6 @@ class Daily extends Schedule
*/
public function setDay($_day)
{
- throw new Exception ("Method not supported");
+ throw new Exception("Method not supported");
}
}
diff --git a/core/Scheduler/Schedule/Hourly.php b/core/Scheduler/Schedule/Hourly.php
index 5830d378ed..199e5a0f15 100644
--- a/core/Scheduler/Schedule/Hourly.php
+++ b/core/Scheduler/Schedule/Hourly.php
@@ -45,7 +45,7 @@ class Hourly extends Schedule
*/
public function setHour($_hour)
{
- throw new Exception ("Method not supported");
+ throw new Exception("Method not supported");
}
/**
@@ -56,6 +56,6 @@ class Hourly extends Schedule
*/
public function setDay($_day)
{
- throw new Exception ("Method not supported");
+ throw new Exception("Method not supported");
}
}
diff --git a/core/Scheduler/Schedule/Monthly.php b/core/Scheduler/Schedule/Monthly.php
index 64a96f69dd..48b0e287c7 100644
--- a/core/Scheduler/Schedule/Monthly.php
+++ b/core/Scheduler/Schedule/Monthly.php
@@ -85,8 +85,9 @@ class Monthly extends Schedule
&& $this->week !== null
) {
$newTime = $rescheduledTime + $this->week * 7 * 86400;
- while (date("w", $newTime) != $this->dayOfWeek % 7) // modulus for sanity check
- {
+ while (date("w", $newTime) != $this->dayOfWeek % 7) {
+ // modulus for sanity check
+
$newTime += 86400;
}
$scheduledDay = ($newTime - $rescheduledTime) / 86400 + 1;
@@ -114,7 +115,7 @@ class Monthly extends Schedule
public function setDay($_day)
{
if (!($_day >= 1 && $_day < 32)) {
- throw new Exception ("Invalid day parameter, must be >=1 and < 32");
+ throw new Exception("Invalid day parameter, must be >=1 and < 32");
}
$this->day = $_day;
diff --git a/core/Scheduler/Schedule/Schedule.php b/core/Scheduler/Schedule/Schedule.php
index 4642389b44..a150850c8d 100644
--- a/core/Scheduler/Schedule/Schedule.php
+++ b/core/Scheduler/Schedule/Schedule.php
@@ -107,7 +107,7 @@ abstract class Schedule
public function setHour($hour)
{
if (!($hour >= 0 && $hour < 24)) {
- throw new Exception ("Invalid hour parameter, must be >=0 and < 24");
+ throw new Exception("Invalid hour parameter, must be >=0 and < 24");
}
$this->hour = $hour;
diff --git a/core/Scheduler/Schedule/Weekly.php b/core/Scheduler/Schedule/Weekly.php
index 2f984c2db6..09fb5ec77a 100644
--- a/core/Scheduler/Schedule/Weekly.php
+++ b/core/Scheduler/Schedule/Weekly.php
@@ -64,7 +64,7 @@ class Weekly extends Schedule
}
if (!($day >= 1 && $day < 8)) {
- throw new Exception ("Invalid day parameter, must be >=1 and < 8");
+ throw new Exception("Invalid day parameter, must be >=1 and < 8");
}
$this->day = $day;
diff --git a/core/Scheduler/TaskLoader.php b/core/Scheduler/TaskLoader.php
index 44ec80c54b..60b9e328b6 100644
--- a/core/Scheduler/TaskLoader.php
+++ b/core/Scheduler/TaskLoader.php
@@ -27,7 +27,6 @@ class TaskLoader
$pluginTasks = PluginManager::getInstance()->findComponents('Tasks', 'Piwik\Plugin\Tasks');
foreach ($pluginTasks as $pluginTask) {
-
$pluginTask->schedule();
foreach ($pluginTask->getScheduledTasks() as $task) {
diff --git a/core/Segment.php b/core/Segment.php
index d3cde673b7..511d4fca10 100644
--- a/core/Segment.php
+++ b/core/Segment.php
@@ -171,7 +171,6 @@ class Segment
if ($matchType != SegmentExpression::MATCH_IS_NOT_NULL_NOR_EMPTY
&& $matchType != SegmentExpression::MATCH_IS_NULL_OR_EMPTY) {
-
if (isset($segment['sqlFilterValue'])) {
$value = call_user_func($segment['sqlFilterValue'], $value);
}
@@ -261,5 +260,4 @@ class Segment
{
return (string) $this->getString();
}
-
-} \ No newline at end of file
+}
diff --git a/core/Segment/SegmentExpression.php b/core/Segment/SegmentExpression.php
index 10cf0294e3..3fcf232a14 100644
--- a/core/Segment/SegmentExpression.php
+++ b/core/Segment/SegmentExpression.php
@@ -40,7 +40,7 @@ class SegmentExpression
const INDEX_BOOL_OPERATOR = 0;
const INDEX_OPERAND = 1;
- function __construct($string)
+ public function __construct($string)
{
$this->string = $string;
$this->tree = $this->parseTree();
diff --git a/core/Session.php b/core/Session.php
index 9733593205..965553b521 100644
--- a/core/Session.php
+++ b/core/Session.php
@@ -86,7 +86,7 @@ class Session extends Zend_Session
@ini_set('session.save_handler', 'files');
@ini_set('session.save_path', $sessionPath);
- } else if ($config->General['session_save_handler'] === 'dbtable'
+ } elseif ($config->General['session_save_handler'] === 'dbtable'
|| in_array($currentSaveHandler, array('user', 'mm'))
) {
// We consider these to be misconfigurations, in that:
diff --git a/core/Session/SaveHandler/DbTable.php b/core/Session/SaveHandler/DbTable.php
index 74fc5e388b..03b4afa862 100644
--- a/core/Session/SaveHandler/DbTable.php
+++ b/core/Session/SaveHandler/DbTable.php
@@ -25,7 +25,7 @@ class DbTable implements Zend_Session_SaveHandler_Interface
/**
* @param array $config
*/
- function __construct($config)
+ public function __construct($config)
{
$this->config = $config;
$this->maxLifetime = ini_get('session.gc_maxlifetime');
diff --git a/core/Settings/Manager.php b/core/Settings/Manager.php
index f3862989e1..e757e44d60 100644
--- a/core/Settings/Manager.php
+++ b/core/Settings/Manager.php
@@ -37,7 +37,6 @@ class Manager
}
if (empty(static::$settings)) {
-
$settings = PluginManager::getInstance()->findComponents('Settings', 'Piwik\\Plugin\\Settings');
$byPluginName = array();
@@ -155,5 +154,4 @@ class Manager
return !empty($settings);
}
-
}
diff --git a/core/Settings/Setting.php b/core/Settings/Setting.php
index 4b1b36e5a1..51e7942146 100644
--- a/core/Settings/Setting.php
+++ b/core/Settings/Setting.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Settings;
+
use Piwik\Piwik;
use Piwik\SettingsServer;
diff --git a/core/Settings/Storage.php b/core/Settings/Storage.php
index 09525cb6d3..5e3b8fc793 100644
--- a/core/Settings/Storage.php
+++ b/core/Settings/Storage.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Settings;
+
use Piwik\Option;
/**
@@ -71,7 +72,6 @@ class Storage implements StorageInterface
$this->loadSettingsIfNotDoneYet();
if (array_key_exists($setting->getKey(), $this->settingsValues)) {
-
return $this->settingsValues[$setting->getKey()];
}
@@ -140,5 +140,4 @@ class Storage implements StorageInterface
return array();
}
-
}
diff --git a/core/Settings/Storage/Factory.php b/core/Settings/Storage/Factory.php
index c007e30e9f..87d54ad3b1 100644
--- a/core/Settings/Storage/Factory.php
+++ b/core/Settings/Storage/Factory.php
@@ -25,5 +25,4 @@ class Factory
return $storage;
}
-
}
diff --git a/core/Settings/Storage/StaticStorage.php b/core/Settings/Storage/StaticStorage.php
index ada437fa1c..d8a43b6c9a 100644
--- a/core/Settings/Storage/StaticStorage.php
+++ b/core/Settings/Storage/StaticStorage.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Settings\Storage;
+
use Piwik\Settings\Storage;
/**
@@ -30,5 +31,4 @@ class StaticStorage extends Storage
public function save()
{
}
-
}
diff --git a/core/Settings/UserSetting.php b/core/Settings/UserSetting.php
index 60f63e3037..aa3a08c400 100644
--- a/core/Settings/UserSetting.php
+++ b/core/Settings/UserSetting.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Settings;
+
use Piwik\Common;
use Piwik\Piwik;
@@ -130,16 +131,13 @@ class UserSetting extends Setting
$pluginsSettings = Manager::getAllPluginSettings();
foreach ($pluginsSettings as $pluginSettings) {
-
$settings = $pluginSettings->getSettings();
foreach ($settings as $setting) {
-
if ($setting instanceof UserSetting) {
$setting->setUserLogin($userLogin);
$setting->removeValue();
}
-
}
$pluginSettings->save();
diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php
index 7a731b9b98..614950d5f5 100644
--- a/core/SettingsPiwik.php
+++ b/core/SettingsPiwik.php
@@ -224,7 +224,6 @@ class SettingsPiwik
return false;
}
return true;
-
}
/**
@@ -437,5 +436,4 @@ class SettingsPiwik
{
return (bool)Config::getInstance()->Tracker['enable_fingerprinting_across_websites'];
}
-
}
diff --git a/core/Singleton.php b/core/Singleton.php
index 1dff87db5f..499fb28e52 100644
--- a/core/Singleton.php
+++ b/core/Singleton.php
@@ -20,9 +20,13 @@ class Singleton
{
protected static $instances;
- protected function __construct() { }
+ protected function __construct()
+ {
+ }
- final private function __clone() { }
+ final private function __clone()
+ {
+ }
/**
* Returns the singleton instance for the derived class. If the singleton instance
@@ -30,7 +34,8 @@ class Singleton
*
* @return Singleton
*/
- public static function getInstance() {
+ public static function getInstance()
+ {
$class = get_called_class();
if (!isset(self::$instances[$class])) {
diff --git a/core/Site.php b/core/Site.php
index 9312fd5355..cbf554d981 100644
--- a/core/Site.php
+++ b/core/Site.php
@@ -80,7 +80,7 @@ class Site
{
self::triggerSetSitesEvent($sites);
- foreach($sites as $idsite => $site) {
+ foreach ($sites as $idsite => $site) {
self::setSite($idsite, $site);
}
}
diff --git a/core/TCPDF.php b/core/TCPDF.php
index f9a4baae99..fbbadbb315 100644
--- a/core/TCPDF.php
+++ b/core/TCPDF.php
@@ -25,7 +25,7 @@ class TCPDF extends \TCPDF
*
* @see TCPDF::Footer()
*/
- function Footer()
+ public function Footer()
{
//Don't show footer on the frontPage
if ($this->currentPageNo > 1) {
@@ -40,7 +40,7 @@ class TCPDF extends \TCPDF
* @param $msg
* @throws Exception
*/
- function Error($msg)
+ public function Error($msg)
{
$this->_destroy(true);
throw new Exception($msg);
@@ -49,7 +49,7 @@ class TCPDF extends \TCPDF
/**
* Set current page number
*/
- function setCurrentPageNo()
+ public function setCurrentPageNo()
{
if (empty($this->currentPageNo)) {
$this->currentPageNo = 1;
@@ -68,7 +68,7 @@ class TCPDF extends \TCPDF
* @param bool $keepmargins
* @param bool $tocpage
*/
- function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
+ public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
{
parent::AddPage($orientation);
$this->setCurrentPageNo();
@@ -79,7 +79,7 @@ class TCPDF extends \TCPDF
*
* @param string $footerContent
*/
- function SetFooterContent($footerContent)
+ public function SetFooterContent($footerContent)
{
$this->footerContent = $footerContent;
}
diff --git a/core/Theme.php b/core/Theme.php
index f7f85a5291..8965a2687c 100644
--- a/core/Theme.php
+++ b/core/Theme.php
@@ -67,7 +67,7 @@ class Theme
if (!is_array($jsFiles)) {
$jsFiles = array($jsFiles);
}
- foreach($jsFiles as &$jsFile) {
+ foreach ($jsFiles as &$jsFile) {
$jsFile = 'plugins/' . $this->theme->getPluginName() . '/' . $jsFile;
}
return $jsFiles;
@@ -97,7 +97,7 @@ class Theme
// rewrites images in JS files
'~(=)[\s]?[\'"]([^\'"]+[.jpg|.png|.gif|svg]?)[\'"]~',
);
- return preg_replace_callback($pattern, array($this,'rewriteAssetPathIfOverridesFound'), $output);
+ return preg_replace_callback($pattern, array($this, 'rewriteAssetPathIfOverridesFound'), $output);
}
private function rewriteAssetPathIfOverridesFound($src)
@@ -107,7 +107,7 @@ class Theme
// Basic health check, we dont replace if not starting with plugins/
$posPluginsInPath = strpos($pathAsset, 'plugins');
- if ( $posPluginsInPath !== 0) {
+ if ($posPluginsInPath !== 0) {
return $source;
}
@@ -133,7 +133,7 @@ class Theme
// Strip trailing query string
$fileToCheck = $overridingAsset;
$queryStringPos = strpos($fileToCheck, '?');
- if ( $queryStringPos !== false) {
+ if ($queryStringPos !== false) {
$fileToCheck = substr($fileToCheck, 0, $queryStringPos);
}
diff --git a/core/Timer.php b/core/Timer.php
index c7401677bf..3aea3db1b9 100644
--- a/core/Timer.php
+++ b/core/Timer.php
@@ -7,6 +7,7 @@
*
*/
namespace Piwik;
+
use Piwik\Metrics\Formatter;
/**
diff --git a/core/Tracker.php b/core/Tracker.php
index 9c22ab804d..ffe64f980c 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -227,7 +227,7 @@ class Tracker
public static function disconnectCachedDbConnection()
{
// code redundancy w/ above is on purpose; above disconnectDatabase depends on method that can potentially be overridden
- if (!is_null(self::$db)) {
+ if (!is_null(self::$db)) {
self::$db->disconnect();
self::$db = null;
}
@@ -243,7 +243,7 @@ class Tracker
if (is_null($requestMethod) && array_key_exists('REQUEST_METHOD', $_SERVER)) {
$requestMethod = $_SERVER['REQUEST_METHOD'];
- } else if (is_null($requestMethod)) {
+ } elseif (is_null($requestMethod)) {
$requestMethod = 'GET';
}
@@ -278,7 +278,6 @@ class Tracker
// Tests can force the enabling of IP anonymization
if (Common::getRequestVar('forceIpAnonymization', false, null, $args) == 1) {
-
self::getDatabase(); // make sure db is initialized
$privacyConfig = new PrivacyManagerConfig();
@@ -326,7 +325,7 @@ class Tracker
if ($debugOnDemand) {
return (bool) Common::getRequestVar('debug', false);
}
- } catch(Exception $e) {
+ } catch (Exception $e) {
}
return false;
diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php
index 0b88aed213..c4c33148a0 100644
--- a/core/Tracker/Action.php
+++ b/core/Tracker/Action.php
@@ -248,7 +248,6 @@ abstract class Action
public function getIdActionName()
{
if (!isset($this->actionIdsCached['idaction_name'])) {
-
return false;
}
@@ -302,7 +301,6 @@ abstract class Action
$value = $dimension->onLookupAction($this->request, $this);
if (false !== $value) {
-
if (is_float($value)) {
$value = Common::forceDotAsSeparatorForDecimalPoint($value);
}
@@ -359,7 +357,6 @@ abstract class Action
$value = $dimension->onNewAction($this->request, $visitor, $this);
if ($value !== false) {
-
if (is_float($value)) {
$value = Common::forceDotAsSeparatorForDecimalPoint($value);
}
diff --git a/core/Tracker/ActionPageview.php b/core/Tracker/ActionPageview.php
index 9088fc543a..eb98dd4b23 100644
--- a/core/Tracker/ActionPageview.php
+++ b/core/Tracker/ActionPageview.php
@@ -10,7 +10,6 @@
namespace Piwik\Tracker;
use Piwik\Config;
-use Piwik\Tracker;
/**
* This class represents a page view, tracking URL, page title and generation time.
@@ -20,7 +19,7 @@ class ActionPageview extends Action
{
protected $timeGeneration = false;
- function __construct(Request $request)
+ public function __construct(Request $request)
{
parent::__construct(Action::TYPE_PAGE_URL, $request);
@@ -88,5 +87,4 @@ class ActionPageview extends Action
return Config::getInstance()->General['action_url_category_delimiter'];
}
-
}
diff --git a/core/Tracker/Cache.php b/core/Tracker/Cache.php
index 1c333069eb..b18003aaa9 100644
--- a/core/Tracker/Cache.php
+++ b/core/Tracker/Cache.php
@@ -15,8 +15,6 @@ use Piwik\Common;
use Piwik\Config;
use Piwik\Option;
use Piwik\Piwik;
-use Piwik\Plugin;
-use Piwik\SettingsServer;
use Piwik\Tracker;
/**
@@ -56,7 +54,7 @@ class Cache
* @param int $idSite
* @return array
*/
- static function getCacheWebsiteAttributes($idSite)
+ public static function getCacheWebsiteAttributes($idSite)
{
if ('all' == $idSite) {
return array();
diff --git a/core/Tracker/Db/Mysqli.php b/core/Tracker/Db/Mysqli.php
index e1922e11e5..1482add1d3 100644
--- a/core/Tracker/Db/Mysqli.php
+++ b/core/Tracker/Db/Mysqli.php
@@ -39,7 +39,7 @@ class Mysqli extends Db
$this->host = null;
$this->port = null;
$this->socket = $dbInfo['unix_socket'];
- } else if ($dbInfo['port'][0] == '/') {
+ } elseif ($dbInfo['port'][0] == '/') {
$this->host = null;
$this->port = null;
$this->socket = $dbInfo['port'];
@@ -239,7 +239,7 @@ class Mysqli extends Db
{
if (!$parameters) {
$parameters = array();
- } else if (!is_array($parameters)) {
+ } elseif (!is_array($parameters)) {
$parameters = array($parameters);
}
@@ -295,7 +295,7 @@ class Mysqli extends Db
return;
}
- if ( $this->connection->autocommit(false)) {
+ if ($this->connection->autocommit(false)) {
$this->activeTransaction = uniqid();
return $this->activeTransaction;
}
@@ -310,13 +310,12 @@ class Mysqli extends Db
public function commit($xid)
{
if ($this->activeTransaction != $xid || $this->activeTransaction === false) {
-
return;
}
$this->activeTransaction = false;
- if (!$this->connection->commit() ) {
+ if (!$this->connection->commit()) {
throw new DbException("Commit failed");
}
@@ -337,7 +336,7 @@ class Mysqli extends Db
$this->activeTransaction = false;
- if (!$this->connection->rollback() ) {
+ if (!$this->connection->rollback()) {
throw new DbException("Rollback failed");
}
diff --git a/core/Tracker/Db/Pdo/Mysql.php b/core/Tracker/Db/Pdo/Mysql.php
index 4d6094b478..826d400c3e 100644
--- a/core/Tracker/Db/Pdo/Mysql.php
+++ b/core/Tracker/Db/Pdo/Mysql.php
@@ -42,7 +42,7 @@ class Mysql extends Db
{
if (isset($dbInfo['unix_socket']) && $dbInfo['unix_socket'][0] == '/') {
$this->dsn = $driverName . ':dbname=' . $dbInfo['dbname'] . ';unix_socket=' . $dbInfo['unix_socket'];
- } else if (!empty($dbInfo['port']) && $dbInfo['port'][0] == '/') {
+ } elseif (!empty($dbInfo['port']) && $dbInfo['port'][0] == '/') {
$this->dsn = $driverName . ':dbname=' . $dbInfo['dbname'] . ';unix_socket=' . $dbInfo['port'];
} else {
$this->dsn = $driverName . ':dbname=' . $dbInfo['dbname'] . ';host=' . $dbInfo['host'] . ';port=' . $dbInfo['port'];
@@ -252,11 +252,11 @@ class Mysql extends Db
*/
public function beginTransaction()
{
- if (!$this->activeTransaction === false ) {
+ if (!$this->activeTransaction === false) {
return;
}
- if ( $this->connection->beginTransaction() ) {
+ if ($this->connection->beginTransaction()) {
$this->activeTransaction = uniqid();
return $this->activeTransaction;
}
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php
index 2b9de403a2..87fb80ecc4 100644
--- a/core/Tracker/GoalManager.php
+++ b/core/Tracker/GoalManager.php
@@ -767,12 +767,11 @@ class GoalManager
$match = $this->isGoalPatternMatchingUrl($goal, $pattern_type, $url);
- if(!$match) {
+ if (!$match) {
// Users may set Goal matching URL as URL encoded
$goal['pattern'] = urldecode($goal['pattern']);
$match = $this->isGoalPatternMatchingUrl($goal, $pattern_type, $url);
-
}
return $match;
}
@@ -792,7 +791,6 @@ class GoalManager
$value = $dimension->$hook($this->request, $visitor, $action, $this);
if (false !== $value) {
-
if (is_float($value)) {
$value = Common::forceDotAsSeparatorForDecimalPoint($value);
}
diff --git a/core/Tracker/Handler.php b/core/Tracker/Handler.php
index 3970b910d1..ed75104efe 100644
--- a/core/Tracker/Handler.php
+++ b/core/Tracker/Handler.php
@@ -114,5 +114,4 @@ class Handler
Url::redirectToUrl($redirectUrl);
}
}
-
}
diff --git a/core/Tracker/Handler/Factory.php b/core/Tracker/Handler/Factory.php
index c15def0fe4..6333374748 100644
--- a/core/Tracker/Handler/Factory.php
+++ b/core/Tracker/Handler/Factory.php
@@ -39,5 +39,4 @@ class Factory
return $handler;
}
-
}
diff --git a/core/Tracker/Model.php b/core/Tracker/Model.php
index ce725db995..e9b67d6c6a 100644
--- a/core/Tracker/Model.php
+++ b/core/Tracker/Model.php
@@ -75,7 +75,7 @@ class Model
try {
$this->getDb()->query($sql, $sqlBind);
- } catch(Exception $e){
+ } catch (Exception $e) {
Common::printDebug("There was an error while updating the Conversion: " . $e->getMessage());
return false;
@@ -120,7 +120,6 @@ class Model
$bind = array();
foreach ($ecommerceItems as $item) {
-
if ($i === 0) {
$fields = implode(', ', array_keys($item));
$sql .= ' (' . $fields . ') VALUES ';
@@ -334,15 +333,10 @@ class Model
);
if ($shouldMatchOneFieldOnly && $isVisitorIdToLookup) {
-
$visitRow = $this->findVisitorByVisitorId($idVisitor, $select, $from, $whereCommon, $bindSql);
-
} elseif ($shouldMatchOneFieldOnly) {
-
$visitRow = $this->findVisitorByConfigId($configId, $select, $from, $whereCommon, $bindSql);
-
} else {
-
$visitRow = $this->findVisitorByVisitorId($idVisitor, $select, $from, $whereCommon, $bindSql);
if (empty($visitRow)) {
diff --git a/core/Tracker/PageUrl.php b/core/Tracker/PageUrl.php
index 9f956c5196..1ff3e529af 100644
--- a/core/Tracker/PageUrl.php
+++ b/core/Tracker/PageUrl.php
@@ -50,7 +50,6 @@ class PageUrl
if (empty($parsedUrl['query'])) {
if (empty($parsedUrl['fragment'])) {
-
return UrlHelper::getParseUrlReverse($parsedUrl);
}
@@ -97,11 +96,11 @@ class PageUrl
*
* @param array &$parametersToExclude An array of parameters to exclude from the tracking url.
*/
- Piwik::postEvent('Tracker.PageUrl.getQueryParametersToExclude', array(&$parametersToExclude));
+ Piwik::postEvent('Tracker.PageUrl.getQueryParametersToExclude', array(&$parametersToExclude));
- if (!empty($parametersToExclude)) {
- Common::printDebug('Excluding parameters "' . implode(',', $parametersToExclude) . '" from URL');
- }
+ if (!empty($parametersToExclude)) {
+ Common::printDebug('Excluding parameters "' . implode(',', $parametersToExclude) . '" from URL');
+ }
$parametersToExclude = array_map('strtolower', $parametersToExclude);
return $parametersToExclude;
@@ -332,7 +331,6 @@ class PageUrl
{
foreach (self::$urlPrefixMap as $prefix => $id) {
if (strtolower(substr($url, 0, strlen($prefix))) == $prefix) {
-
return array(
'url' => substr($url, strlen($prefix)),
'prefixId' => $id
@@ -375,4 +373,4 @@ class PageUrl
}
return $value;
}
-} \ No newline at end of file
+}
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php
index 7eed4104e0..b0ecacc701 100644
--- a/core/Tracker/Request.php
+++ b/core/Tracker/Request.php
@@ -112,7 +112,6 @@ class Request
$shouldAuthenticate = TrackerConfig::getConfigValue('tracking_requests_require_authentication');
if ($shouldAuthenticate) {
-
try {
$idSite = $this->getIdSite();
} catch (Exception $e) {
@@ -143,7 +142,6 @@ class Request
if ($this->isAuthenticated) {
Common::printDebug("token_auth is authenticated!");
}
-
} else {
$this->isAuthenticated = true;
Common::printDebug("token_auth authentication not required");
@@ -429,7 +427,7 @@ class Request
$isTimestampRecent = $timeFromNow < self::CUSTOM_TIMESTAMP_DOES_NOT_REQUIRE_TOKENAUTH_WHEN_NEWER_THAN;
if (!$isTimestampRecent) {
- if(!$this->isAuthenticated()) {
+ if (!$this->isAuthenticated()) {
Common::printDebug(sprintf("Custom timestamp is %s seconds old, requires &token_auth...", $timeFromNow));
Common::printDebug("WARN: Tracker API 'cdt' was used with invalid token_auth");
return false;
@@ -739,7 +737,7 @@ class Request
*/
public function getUserIdHashed($userId)
{
- return substr( sha1( $userId ), 0, 16);
+ return substr(sha1($userId), 0, 16);
}
/**
diff --git a/core/Tracker/RequestSet.php b/core/Tracker/RequestSet.php
index 4d8771dc79..3d3c626e17 100644
--- a/core/Tracker/RequestSet.php
+++ b/core/Tracker/RequestSet.php
@@ -36,7 +36,6 @@ class RequestSet
$this->requests = array();
foreach ($requests as $request) {
-
if (empty($request) && !is_array($request)) {
continue;
}
@@ -253,6 +252,4 @@ class RequestSet
'server' => $_SERVER
);
}
-
-
}
diff --git a/core/Tracker/Response.php b/core/Tracker/Response.php
index e4f2f7d5ae..2b4a6f3b49 100644
--- a/core/Tracker/Response.php
+++ b/core/Tracker/Response.php
@@ -146,7 +146,7 @@ class Response
$this->outputTransparentGif();
}
- private function outputTransparentGif ()
+ private function outputTransparentGif()
{
$transGifBase64 = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
Common::sendHeader('Content-Type: image/gif');
@@ -179,5 +179,4 @@ class Response
{
error_log(sprintf("Error in Piwik (tracker): %s", str_replace("\n", " ", $this->getMessageFromException($e))));
}
-
}
diff --git a/core/Tracker/ScheduledTasksRunner.php b/core/Tracker/ScheduledTasksRunner.php
index 8513c8e98f..c8e8b89ce3 100644
--- a/core/Tracker/ScheduledTasksRunner.php
+++ b/core/Tracker/ScheduledTasksRunner.php
@@ -9,14 +9,10 @@
namespace Piwik\Tracker;
-
use Piwik\CliMulti;
use Piwik\Common;
-use Piwik\Config;
-use Piwik\CronArchive;
use Piwik\Option;
use Piwik\Piwik;
-use Piwik\SettingsPiwik;
use Piwik\Tracker;
class ScheduledTasksRunner
diff --git a/core/Tracker/Settings.php b/core/Tracker/Settings.php
index 9b3fd7b2e5..a7a945c517 100644
--- a/core/Tracker/Settings.php
+++ b/core/Tracker/Settings.php
@@ -17,7 +17,7 @@ class Settings
{
const OS_BOT = 'BOT';
- function __construct(Request $request, $ip, $isSameFingerprintsAcrossWebsites)
+ public function __construct(Request $request, $ip, $isSameFingerprintsAcrossWebsites)
{
$this->request = $request;
$this->ipAddress = $ip;
@@ -25,7 +25,7 @@ class Settings
$this->configId = null;
}
- function getConfigId()
+ public function getConfigId()
{
if (empty($this->configId)) {
$this->loadInfo();
@@ -114,7 +114,7 @@ class Settings
. $browserLang
. $salt;
- if(!$this->isSameFingerprintsAcrossWebsites) {
+ if (!$this->isSameFingerprintsAcrossWebsites) {
$configString .= $this->request->getIdSite();
}
@@ -122,5 +122,4 @@ class Settings
return substr($hash, 0, Tracker::LENGTH_BINARY_ID);
}
-
-} \ No newline at end of file
+}
diff --git a/core/Tracker/SettingsStorage.php b/core/Tracker/SettingsStorage.php
index 7ffb3de872..a69e03553f 100644
--- a/core/Tracker/SettingsStorage.php
+++ b/core/Tracker/SettingsStorage.php
@@ -55,5 +55,4 @@ class SettingsStorage extends Storage
{
return PiwikCache::getEagerCache();
}
-
}
diff --git a/core/Tracker/TableLogAction.php b/core/Tracker/TableLogAction.php
index 653c7f8407..21350aedb5 100644
--- a/core/Tracker/TableLogAction.php
+++ b/core/Tracker/TableLogAction.php
@@ -11,7 +11,6 @@ namespace Piwik\Tracker;
use Piwik\Common;
use Piwik\Segment\SegmentExpression;
-use Piwik\Tracker;
/**
* This class is used to query Action IDs from the log_action table.
@@ -35,7 +34,7 @@ class TableLogAction
public static function loadIdsAction($actionsNameAndType)
{
// Add url prefix if not set
- foreach($actionsNameAndType as &$action) {
+ foreach ($actionsNameAndType as &$action) {
if (2 == count($action)) {
$action[] = null;
}
@@ -266,6 +265,4 @@ class TableLogAction
return in_array($actionType, $actionsTypesStoredUnsanitized);
}
-
}
-
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index 4d81bc2f3b..2ae3e0677d 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -125,7 +125,6 @@ class Visit implements VisitInterface
if ($this->goalManager->isGoalAnOrder()) {
$visitIsConverted = true;
}
-
} elseif ($isManualGoalConversion) {
// this request is from the JS call to piwikTracker.trackGoal()
$someGoalsConverted = $this->goalManager->detectGoalId($this->request->getIdSite());
@@ -136,7 +135,6 @@ class Visit implements VisitInterface
Common::printDebug('Invalid goal tracking request for goal id = ' . $this->goalManager->idGoal);
return;
}
-
} else {
// normal page view, potentially triggering a URL matching goal
$action = Action::factory($this->request);
@@ -178,7 +176,6 @@ class Visit implements VisitInterface
if (!is_null($action)) {
$action->record($visitor, $idReferrerActionUrl, $idReferrerActionName);
}
-
} catch (VisitorNotFoundInDb $e) {
// There is an edge case when:
@@ -386,7 +383,7 @@ class Visit implements VisitInterface
protected function getSettingsObject()
{
if (is_null($this->userSettings)) {
- $this->userSettings = new Settings( $this->request, $this->getVisitorIp(), SettingsPiwik::isSameFingerprintAcrossWebsites());
+ $this->userSettings = new Settings($this->request, $this->getVisitorIp(), SettingsPiwik::isSameFingerprintAcrossWebsites());
}
return $this->userSettings;
@@ -590,7 +587,7 @@ class Visit implements VisitInterface
self::$dimensions = VisitDimension::getAllDimensions();
$dimensionNames = array();
- foreach(self::$dimensions as $dimension) {
+ foreach (self::$dimensions as $dimension) {
$dimensionNames[] = $dimension->getColumnName();
}
diff --git a/core/Tracker/Visit/Factory.php b/core/Tracker/Visit/Factory.php
index 1d9349dfb1..778832925c 100644
--- a/core/Tracker/Visit/Factory.php
+++ b/core/Tracker/Visit/Factory.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Tracker\Visit;
+
use Piwik\Piwik;
use Piwik\Tracker\Visit;
use Piwik\Tracker\VisitInterface;
diff --git a/core/Tracker/Visit/ReferrerSpamFilter.php b/core/Tracker/Visit/ReferrerSpamFilter.php
index 51a50fcb2f..0c6ee6204a 100644
--- a/core/Tracker/Visit/ReferrerSpamFilter.php
+++ b/core/Tracker/Visit/ReferrerSpamFilter.php
@@ -27,7 +27,7 @@ class ReferrerSpamFilter
$referrerUrl = $request->getParam('urlref');
- foreach($spammers as $spammerHost) {
+ foreach ($spammers as $spammerHost) {
if (strpos($referrerUrl, $spammerHost) !== false) {
Common::printDebug('Referrer URL is a known spam: ' . $spammerHost);
return true;
diff --git a/core/Tracker/VisitExcluded.php b/core/Tracker/VisitExcluded.php
index 0081b37bc2..8d34797bdc 100644
--- a/core/Tracker/VisitExcluded.php
+++ b/core/Tracker/VisitExcluded.php
@@ -10,7 +10,6 @@ namespace Piwik\Tracker;
use Piwik\Cache as PiwikCache;
use Piwik\Common;
-use Piwik\Config;
use Piwik\DeviceDetectorFactory;
use Piwik\Network\IP;
use Piwik\Piwik;
diff --git a/core/Tracker/Visitor.php b/core/Tracker/Visitor.php
index 4088e724f1..3bd3d1a91c 100644
--- a/core/Tracker/Visitor.php
+++ b/core/Tracker/Visitor.php
@@ -161,7 +161,7 @@ class Visitor
return true;
}
- if (!$isVisitorIdToLookup ) {
+ if (!$isVisitorIdToLookup) {
return true;
}
diff --git a/core/Tracker/VisitorNotFoundInDb.php b/core/Tracker/VisitorNotFoundInDb.php
index f1a0b71a04..5cbf79190d 100644
--- a/core/Tracker/VisitorNotFoundInDb.php
+++ b/core/Tracker/VisitorNotFoundInDb.php
@@ -14,4 +14,3 @@ namespace Piwik\Tracker;
class VisitorNotFoundInDb extends \Exception
{
}
-
diff --git a/core/Translation/Loader/JsonFileLoader.php b/core/Translation/Loader/JsonFileLoader.php
index f80b940528..802bcc62d0 100644
--- a/core/Translation/Loader/JsonFileLoader.php
+++ b/core/Translation/Loader/JsonFileLoader.php
@@ -8,7 +8,6 @@
namespace Piwik\Translation\Loader;
-use Exception;
use Piwik\Common;
/**
diff --git a/core/Translation/Transifex/API.php b/core/Translation/Transifex/API.php
index 1257607539..f73f6d2b45 100644
--- a/core/Translation/Transifex/API.php
+++ b/core/Translation/Transifex/API.php
@@ -139,10 +139,10 @@ class API
if ($httpStatus == 401) {
throw new AuthenticationFailedException();
- } else if ($httpStatus != 200) {
+ } elseif ($httpStatus != 200) {
throw new Exception('Error while getting API results', $httpStatus);
}
return $raw ? $response : json_decode($response);
}
-} \ No newline at end of file
+}
diff --git a/core/Twig.php b/core/Twig.php
index 3f1015cf3a..09720eefdd 100755
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -41,26 +41,26 @@ class Twig
public function __construct()
{
$loader = $this->getDefaultThemeLoader();
- $this->addPluginNamespaces($loader);
+ $this->addPluginNamespaces($loader);
- //get current theme
- $manager = Plugin\Manager::getInstance();
- $theme = $manager->getThemeEnabled();
- $loaders = array();
+ //get current theme
+ $manager = Plugin\Manager::getInstance();
+ $theme = $manager->getThemeEnabled();
+ $loaders = array();
$this->formatter = new Formatter();
- //create loader for custom theme to overwrite twig templates
- if ($theme && $theme->getPluginName() != \Piwik\Plugin\Manager::DEFAULT_THEME) {
- $customLoader = $this->getCustomThemeLoader($theme);
- if ($customLoader) {
- //make it possible to overwrite plugin templates
- $this->addCustomPluginNamespaces($customLoader, $theme->getPluginName());
- $loaders[] = $customLoader;
- }
- }
+ //create loader for custom theme to overwrite twig templates
+ if ($theme && $theme->getPluginName() != \Piwik\Plugin\Manager::DEFAULT_THEME) {
+ $customLoader = $this->getCustomThemeLoader($theme);
+ if ($customLoader) {
+ //make it possible to overwrite plugin templates
+ $this->addCustomPluginNamespaces($customLoader, $theme->getPluginName());
+ $loaders[] = $customLoader;
+ }
+ }
- $loaders[] = $loader;
+ $loaders[] = $loader;
$chainLoader = new Twig_Loader_Chain($loaders);
@@ -161,7 +161,7 @@ class Twig
// make the first value the string that will get output in the template
// plugins can modify this string
$str = '';
- $params = array_merge( array( &$str ), $params);
+ $params = array_merge(array( &$str ), $params);
Piwik::postEvent($eventName, $params);
return $str;
@@ -199,21 +199,22 @@ class Twig
return $themeLoader;
}
- /**
- * create template loader for a custom theme
- * @param \Piwik\Plugin $theme
- * @return \Twig_Loader_Filesystem
- */
- protected function getCustomThemeLoader(Plugin $theme){
- if (!file_exists(sprintf("%s/plugins/%s/templates/", PIWIK_INCLUDE_PATH, $theme->getPluginName()))){
- return false;
- }
- $themeLoader = new Twig_Loader_Filesystem(array(
+ /**
+ * create template loader for a custom theme
+ * @param \Piwik\Plugin $theme
+ * @return \Twig_Loader_Filesystem
+ */
+ protected function getCustomThemeLoader(Plugin $theme)
+ {
+ if (!file_exists(sprintf("%s/plugins/%s/templates/", PIWIK_INCLUDE_PATH, $theme->getPluginName()))) {
+ return false;
+ }
+ $themeLoader = new Twig_Loader_Filesystem(array(
sprintf("%s/plugins/%s/templates/", PIWIK_INCLUDE_PATH, $theme->getPluginName())
));
return $themeLoader;
- }
+ }
public function getTwigEnvironment()
{
@@ -353,18 +354,18 @@ class Twig
}
}
- /**
- *
- * Plugin-Templates can be overwritten by putting identically named templates in plugins/[theme]/templates/plugins/[plugin]/
- *
- */
- private function addCustomPluginNamespaces(Twig_Loader_Filesystem $loader, $pluginName)
+ /**
+ *
+ * Plugin-Templates can be overwritten by putting identically named templates in plugins/[theme]/templates/plugins/[plugin]/
+ *
+ */
+ private function addCustomPluginNamespaces(Twig_Loader_Filesystem $loader, $pluginName)
{
$plugins = \Piwik\Plugin\Manager::getInstance()->getAllPluginsNames();
foreach ($plugins as $name) {
$path = sprintf("%s/plugins/%s/templates/plugins/%s/", PIWIK_INCLUDE_PATH, $pluginName, $name);
if (is_dir($path)) {
- $loader->addPath(PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName . '/templates/plugins/'. $name , $name);
+ $loader->addPath(PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName . '/templates/plugins/'. $name, $name);
}
}
}
diff --git a/core/Unzip.php b/core/Unzip.php
index 547a1a84a5..ffef2add15 100644
--- a/core/Unzip.php
+++ b/core/Unzip.php
@@ -29,16 +29,18 @@ class Unzip
{
switch ($name) {
case 'ZipArchive':
- if (class_exists('ZipArchive', false))
+ if (class_exists('ZipArchive', false)) {
return new ZipArchive($filename);
+ }
break;
case 'tar.gz':
return new Tar($filename, 'gz');
case 'tar.bz2':
return new Tar($filename, 'bz2');
case 'gz':
- if (function_exists('gzopen'))
+ if (function_exists('gzopen')) {
return new Gzip($filename);
+ }
break;
case 'PclZip':
default:
diff --git a/core/Updater.php b/core/Updater.php
index bccddff3f2..9190320fa7 100644
--- a/core/Updater.php
+++ b/core/Updater.php
@@ -10,7 +10,6 @@ namespace Piwik;
use Piwik\Columns\Updater as ColumnUpdater;
use Piwik\Container\StaticContainer;
-use Piwik\Exception\DatabaseSchemaIsNewerThanCodebaseException;
use Piwik\Updater\UpdateObserver;
use Zend_Db_Exception;
@@ -290,7 +289,7 @@ class Updater
foreach ($files as $file) {
$fileVersion = basename($file, '.php');
- if ( // if the update is from a newer version
+ if (// if the update is from a newer version
version_compare($currentVersion, $fileVersion) == -1
// but we don't execute updates from non existing future releases
&& version_compare($fileVersion, $newVersion) <= 0
@@ -551,7 +550,7 @@ class Updater
* @param array $sqlarray An array of SQL queries to be executed
* @throws UpdaterErrorException
*/
- static function updateDatabase($file, $sqlarray)
+ public static function updateDatabase($file, $sqlarray)
{
self::$activeInstance->executeMigrationQueries($file, $sqlarray);
}
diff --git a/core/Updater/UpdateObserver.php b/core/Updater/UpdateObserver.php
index b8a91562f5..e639ecdb04 100644
--- a/core/Updater/UpdateObserver.php
+++ b/core/Updater/UpdateObserver.php
@@ -111,4 +111,4 @@ abstract class UpdateObserver
{
// empty
}
-} \ No newline at end of file
+}
diff --git a/core/Updates.php b/core/Updates.php
index 2ef3e0836d..0eeffc69dd 100644
--- a/core/Updates.php
+++ b/core/Updates.php
@@ -18,7 +18,7 @@ abstract class Updates
/**
* @deprecated since v2.12.0 use getMigrationQueries() instead
*/
- static function getSql()
+ public static function getSql()
{
return array();
}
@@ -26,7 +26,7 @@ abstract class Updates
/**
* @deprecated since v2.12.0 use doUpdate() instead
*/
- static function update()
+ public static function update()
{
}
diff --git a/core/Updates/0.2.10.php b/core/Updates/0.2.10.php
index 215360e576..e108151244 100644
--- a/core/Updates/0.2.10.php
+++ b/core/Updates/0.2.10.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_2_10 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'CREATE TABLE `' . Common::prefixTable('option') . '` (
@@ -50,7 +50,7 @@ class Updates_0_2_10 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/0.2.12.php b/core/Updates/0.2.12.php
index 0cf0fed8ea..01d837b636 100644
--- a/core/Updates/0.2.12.php
+++ b/core/Updates/0.2.12.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_12 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('site') . '`
@@ -31,7 +31,7 @@ class Updates_0_2_12 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.2.13.php b/core/Updates/0.2.13.php
index e73acf0b77..8ed75348ea 100644
--- a/core/Updates/0.2.13.php
+++ b/core/Updates/0.2.13.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_13 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'DROP TABLE IF EXISTS `' . Common::prefixTable('option') . '`' => false,
@@ -31,7 +31,7 @@ class Updates_0_2_13 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.2.24.php b/core/Updates/0.2.24.php
index 23bf21274e..58595ad6f1 100644
--- a/core/Updates/0.2.24.php
+++ b/core/Updates/0.2.24.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_24 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'CREATE INDEX index_type_name
@@ -29,7 +29,7 @@ class Updates_0_2_24 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.2.27.php b/core/Updates/0.2.27.php
index a46990f5fa..391fa60b33 100644
--- a/core/Updates/0.2.27.php
+++ b/core/Updates/0.2.27.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_2_27 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sqlarray = array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
@@ -73,7 +73,7 @@ class Updates_0_2_27 extends Updates
return $sqlarray;
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.2.32.php b/core/Updates/0.2.32.php
index 15264ebef2..6e73786e15 100644
--- a/core/Updates/0.2.32.php
+++ b/core/Updates/0.2.32.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_32 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// 0.2.32 [941]
@@ -32,7 +32,7 @@ class Updates_0_2_32 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.2.33.php b/core/Updates/0.2.33.php
index b1e8886dbf..b3dda1a169 100644
--- a/core/Updates/0.2.33.php
+++ b/core/Updates/0.2.33.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_2_33 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sqlarray = array(
// 0.2.33 [1020]
@@ -38,7 +38,7 @@ class Updates_0_2_33 extends Updates
return $sqlarray;
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.2.35.php b/core/Updates/0.2.35.php
index 658d896856..266005fc72 100644
--- a/core/Updates/0.2.35.php
+++ b/core/Updates/0.2.35.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_35 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '`
@@ -25,7 +25,7 @@ class Updates_0_2_35 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.2.37.php b/core/Updates/0.2.37.php
index 6e7bb6da92..2e3878df51 100644
--- a/core/Updates/0.2.37.php
+++ b/core/Updates/0.2.37.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_2_37 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'DELETE FROM `' . Common::prefixTable('user_dashboard') . "`
@@ -26,7 +26,7 @@ class Updates_0_2_37 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.4.1.php b/core/Updates/0.4.1.php
index 1448b4c013..6d820b7749 100644
--- a/core/Updates/0.4.1.php
+++ b/core/Updates/0.4.1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_4_1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_conversion') . '`
@@ -27,7 +27,7 @@ class Updates_0_4_1 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.4.2.php b/core/Updates/0.4.2.php
index d3cac21d21..932186d914 100644
--- a/core/Updates/0.4.2.php
+++ b/core/Updates/0.4.2.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_4_2 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
@@ -31,7 +31,7 @@ class Updates_0_4_2 extends Updates
}
// when restoring (possibly) previousy dropped columns, ignore mysql code error 1060: duplicate column
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.4.4.php b/core/Updates/0.4.4.php
index 51972e2cbf..3c468659a1 100644
--- a/core/Updates/0.4.4.php
+++ b/core/Updates/0.4.4.php
@@ -16,7 +16,7 @@ use Piwik\Updates;
*/
class Updates_0_4_4 extends Updates
{
- static function update()
+ public static function update()
{
$obsoleteFile = PIWIK_DOCUMENT_ROOT . '/libs/open-flash-chart/php-ofc-library/ofc_upload_image.php';
if (file_exists($obsoleteFile)) {
diff --git a/core/Updates/0.4.php b/core/Updates/0.4.php
index ce86db2cee..ac17194030 100644
--- a/core/Updates/0.4.php
+++ b/core/Updates/0.4.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_4 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// 0.4 [1140]
@@ -32,7 +32,7 @@ class Updates_0_4 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.5.4.php b/core/Updates/0.5.4.php
index 502da855bc..c4c1a1d906 100644
--- a/core/Updates/0.5.4.php
+++ b/core/Updates/0.5.4.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_5_4 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_action') . '`
@@ -26,7 +26,7 @@ class Updates_0_5_4 extends Updates
);
}
- static function update()
+ public static function update()
{
$salt = Common::generateUniqId();
$config = Config::getInstance();
diff --git a/core/Updates/0.5.5.php b/core/Updates/0.5.5.php
index 50f6236caa..aed0a25571 100644
--- a/core/Updates/0.5.5.php
+++ b/core/Updates/0.5.5.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_5_5 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sqlarray = array(
'DROP INDEX index_idsite_date ON ' . Common::prefixTable('log_visit') => 1091,
@@ -38,9 +38,8 @@ class Updates_0_5_5 extends Updates
return $sqlarray;
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
-
}
}
diff --git a/core/Updates/0.5.php b/core/Updates/0.5.php
index 6c7a51af4e..f7788430e1 100644
--- a/core/Updates/0.5.php
+++ b/core/Updates/0.5.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_5 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE ' . Common::prefixTable('log_action') . ' ADD COLUMN `hash` INTEGER(10) UNSIGNED NOT NULL AFTER `name`;' => 1060,
@@ -33,7 +33,7 @@ class Updates_0_5 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.6-rc1.php b/core/Updates/0.6-rc1.php
index 9f293dda97..f652e29b96 100644
--- a/core/Updates/0.6-rc1.php
+++ b/core/Updates/0.6-rc1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_6_rc1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$defaultTimezone = 'UTC';
$defaultCurrency = 'USD';
@@ -38,7 +38,7 @@ class Updates_0_6_rc1 extends Updates
);
}
- static function update()
+ public static function update()
{
// first we disable the plugins and keep an array of warnings messages
$pluginsToDisableMessage = array(
@@ -64,4 +64,4 @@ class Updates_0_6_rc1 extends Updates
"</li></ul>");
}
}
-} \ No newline at end of file
+}
diff --git a/core/Updates/0.6.3.php b/core/Updates/0.6.3.php
index 56488304ff..acb3318625 100644
--- a/core/Updates/0.6.3.php
+++ b/core/Updates/0.6.3.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_6_3 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
@@ -28,7 +28,7 @@ class Updates_0_6_3 extends Updates
);
}
- static function update()
+ public static function update()
{
$config = Config::getInstance();
$dbInfos = $config->database;
diff --git a/core/Updates/0.7.php b/core/Updates/0.7.php
index 5af49b8d8b..e6d156d4a5 100644
--- a/core/Updates/0.7.php
+++ b/core/Updates/0.7.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_0_7 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('option') . '`
@@ -25,7 +25,7 @@ class Updates_0_7 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/0.9.1.php b/core/Updates/0.9.1.php
index 9d49a906e6..690b9b9ef4 100644
--- a/core/Updates/0.9.1.php
+++ b/core/Updates/0.9.1.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_0_9_1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
if (!SettingsServer::isTimezoneSupportEnabled()) {
return array();
@@ -48,7 +48,7 @@ class Updates_0_9_1 extends Updates
);
}
- static function update()
+ public static function update()
{
if (SettingsServer::isTimezoneSupportEnabled()) {
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/1.1.php b/core/Updates/1.1.php
index 5e533c5e07..303fd254a6 100644
--- a/core/Updates/1.1.php
+++ b/core/Updates/1.1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_1 extends Updates
{
- static function update()
+ public static function update()
{
$config = Config::getInstance();
diff --git a/core/Updates/1.10-b4.php b/core/Updates/1.10-b4.php
index 2079e24546..31bda4882f 100755
--- a/core/Updates/1.10-b4.php
+++ b/core/Updates/1.10-b4.php
@@ -15,12 +15,12 @@ use Piwik\Updates;
*/
class Updates_1_10_b4 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return false;
}
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('MobileMessaging');
diff --git a/core/Updates/1.10.1.php b/core/Updates/1.10.1.php
index 743a4dda4c..63226964c2 100755
--- a/core/Updates/1.10.1.php
+++ b/core/Updates/1.10.1.php
@@ -15,12 +15,12 @@ use Piwik\Updates;
*/
class Updates_1_10_1 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return false;
}
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('Overlay');
diff --git a/core/Updates/1.10.2-b1.php b/core/Updates/1.10.2-b1.php
index 03943f63a1..b963be0176 100755
--- a/core/Updates/1.10.2-b1.php
+++ b/core/Updates/1.10.2-b1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_10_2_b1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// ignore existing column name error (1060)
@@ -26,7 +26,7 @@ class Updates_1_10_2_b1 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.10.2-b2.php b/core/Updates/1.10.2-b2.php
index a1a88de66e..66fa382ba7 100644
--- a/core/Updates/1.10.2-b2.php
+++ b/core/Updates/1.10.2-b2.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_10_2_b2 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// ignore existing column name error (1060)
@@ -26,7 +26,7 @@ class Updates_1_10_2_b2 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.11-b1.php b/core/Updates/1.11-b1.php
index 2c0c02c877..ceb04c960e 100644
--- a/core/Updates/1.11-b1.php
+++ b/core/Updates/1.11-b1.php
@@ -15,12 +15,12 @@ use Piwik\Updates;
*/
class Updates_1_11_b1 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return false;
}
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('UserCountryMap');
diff --git a/core/Updates/1.12-b1.php b/core/Updates/1.12-b1.php
index cf0663853e..59f4c530f8 100644
--- a/core/Updates/1.12-b1.php
+++ b/core/Updates/1.12-b1.php
@@ -17,12 +17,12 @@ use Piwik\Updates;
*/
class Updates_1_12_b1 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return true;
}
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_link_visit_action') . '`
@@ -30,9 +30,8 @@ class Updates_1_12_b1 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
-
}
diff --git a/core/Updates/1.12-b15.php b/core/Updates/1.12-b15.php
index 2187fc8816..b3228e8389 100644
--- a/core/Updates/1.12-b15.php
+++ b/core/Updates/1.12-b15.php
@@ -15,7 +15,7 @@ use Piwik\Updates;
*/
class Updates_1_12_b15 extends Updates
{
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('SegmentEditor');
diff --git a/core/Updates/1.12-b16.php b/core/Updates/1.12-b16.php
index 853de0ad85..ce95badbe1 100644
--- a/core/Updates/1.12-b16.php
+++ b/core/Updates/1.12-b16.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_12_b16 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// ignore existing column name error (1060)
@@ -26,7 +26,7 @@ class Updates_1_12_b16 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.2-rc1.php b/core/Updates/1.2-rc1.php
index e268ad8570..652bb41752 100644
--- a/core/Updates/1.2-rc1.php
+++ b/core/Updates/1.2-rc1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_2_rc1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// Various performance improvements schema updates
@@ -125,7 +125,7 @@ class Updates_1_2_rc1 extends Updates
);
}
- static function update()
+ public static function update()
{
// first we disable the plugins and keep an array of warnings messages
$pluginsToDisableMessage = array(
@@ -150,7 +150,5 @@ class Updates_1_2_rc1 extends Updates
implode('</li><li>', $disabledPlugins) .
"</li></ul>");
}
-
}
}
-
diff --git a/core/Updates/1.2-rc2.php b/core/Updates/1.2-rc2.php
index a991f4e0a6..3696c485e4 100644
--- a/core/Updates/1.2-rc2.php
+++ b/core/Updates/1.2-rc2.php
@@ -15,7 +15,7 @@ use Piwik\Updates;
*/
class Updates_1_2_rc2 extends Updates
{
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('CustomVariables');
@@ -23,4 +23,3 @@ class Updates_1_2_rc2 extends Updates
}
}
}
-
diff --git a/core/Updates/1.2.3.php b/core/Updates/1.2.3.php
index d240462468..3e449b9f46 100644
--- a/core/Updates/1.2.3.php
+++ b/core/Updates/1.2.3.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_1_2_3 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// LOAD DATA INFILE uses the database's charset
@@ -33,9 +33,8 @@ class Updates_1_2_3 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}
-
diff --git a/core/Updates/1.2.5-rc1.php b/core/Updates/1.2.5-rc1.php
index af6308ad8a..f69f673056 100644
--- a/core/Updates/1.2.5-rc1.php
+++ b/core/Updates/1.2.5-rc1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_2_5_rc1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('goal') . '`
@@ -29,9 +29,8 @@ class Updates_1_2_5_rc1 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}
-
diff --git a/core/Updates/1.2.5-rc7.php b/core/Updates/1.2.5-rc7.php
index 85ce3792f1..c1be88ae73 100644
--- a/core/Updates/1.2.5-rc7.php
+++ b/core/Updates/1.2.5-rc7.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_2_5_rc7 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
@@ -25,9 +25,8 @@ class Updates_1_2_5_rc7 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}
-
diff --git a/core/Updates/1.4-rc1.php b/core/Updates/1.4-rc1.php
index 5290e8d24b..d3cf376d74 100644
--- a/core/Updates/1.4-rc1.php
+++ b/core/Updates/1.4-rc1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_4_rc1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'UPDATE `' . Common::prefixTable('pdf') . '`
@@ -27,7 +27,7 @@ class Updates_1_4_rc1 extends Updates
);
}
- static function update()
+ public static function update()
{
try {
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/1.4-rc2.php b/core/Updates/1.4-rc2.php
index a54ab231c0..05cc7c92ae 100644
--- a/core/Updates/1.4-rc2.php
+++ b/core/Updates/1.4-rc2.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_4_rc2 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
"SET sql_mode=''" => false,
@@ -37,7 +37,7 @@ class Updates_1_4_rc2 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.5-b1.php b/core/Updates/1.5-b1.php
index 9661fe3213..06c8663966 100644
--- a/core/Updates/1.5-b1.php
+++ b/core/Updates/1.5-b1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_5_b1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'CREATE TABLE `' . Common::prefixTable('log_conversion_item') . '` (
@@ -56,7 +56,7 @@ class Updates_1_5_b1 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.5-b2.php b/core/Updates/1.5-b2.php
index 377c26f112..a6868db408 100644
--- a/core/Updates/1.5-b2.php
+++ b/core/Updates/1.5-b2.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_5_b2 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_link_visit_action') . '`
@@ -34,7 +34,7 @@ class Updates_1_5_b2 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.5-b3.php b/core/Updates/1.5-b3.php
index e7e8754ac3..9a2b6e353a 100644
--- a/core/Updates/1.5-b3.php
+++ b/core/Updates/1.5-b3.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_5_b3 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_visit') . '`
@@ -56,7 +56,7 @@ class Updates_1_5_b3 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.5-b4.php b/core/Updates/1.5-b4.php
index 802992f6ae..e2b20db87c 100644
--- a/core/Updates/1.5-b4.php
+++ b/core/Updates/1.5-b4.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_5_b4 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('site') . '`
@@ -25,7 +25,7 @@ class Updates_1_5_b4 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.5-b5.php b/core/Updates/1.5-b5.php
index 5b13385fd8..701e3135b1 100644
--- a/core/Updates/1.5-b5.php
+++ b/core/Updates/1.5-b5.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_5_b5 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'CREATE TABLE `' . Common::prefixTable('session') . '` (
@@ -30,7 +30,7 @@ class Updates_1_5_b5 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.5-rc6.php b/core/Updates/1.5-rc6.php
index fa940cab0a..60d27b8653 100644
--- a/core/Updates/1.5-rc6.php
+++ b/core/Updates/1.5-rc6.php
@@ -15,7 +15,7 @@ use Piwik\Updates;
*/
class Updates_1_5_rc6 extends Updates
{
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('PrivacyManager');
@@ -23,4 +23,3 @@ class Updates_1_5_rc6 extends Updates
}
}
}
-
diff --git a/core/Updates/1.6-b1.php b/core/Updates/1.6-b1.php
index f28fc487cc..1a1186ca90 100644
--- a/core/Updates/1.6-b1.php
+++ b/core/Updates/1.6-b1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_6_b1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_conversion_item') . '`
@@ -61,7 +61,7 @@ class Updates_1_6_b1 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/1.6-rc1.php b/core/Updates/1.6-rc1.php
index 75ca3fd032..9f963084e2 100644
--- a/core/Updates/1.6-rc1.php
+++ b/core/Updates/1.6-rc1.php
@@ -15,7 +15,7 @@ use Piwik\Updates;
*/
class Updates_1_6_rc1 extends Updates
{
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('ImageGraph');
@@ -23,4 +23,3 @@ class Updates_1_6_rc1 extends Updates
}
}
}
-
diff --git a/core/Updates/1.7-b1.php b/core/Updates/1.7-b1.php
index 676065d3bd..cb3d323a3d 100644
--- a/core/Updates/1.7-b1.php
+++ b/core/Updates/1.7-b1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_7_b1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('pdf') . '`
@@ -27,7 +27,7 @@ class Updates_1_7_b1 extends Updates
);
}
- static function update()
+ public static function update()
{
try {
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/1.7.2-rc5.php b/core/Updates/1.7.2-rc5.php
index 4fb21e72fe..4280fe73d3 100644
--- a/core/Updates/1.7.2-rc5.php
+++ b/core/Updates/1.7.2-rc5.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_7_2_rc5 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('pdf') . '`
@@ -25,7 +25,7 @@ class Updates_1_7_2_rc5 extends Updates
);
}
- static function update()
+ public static function update()
{
try {
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/1.7.2-rc7.php b/core/Updates/1.7.2-rc7.php
index 3966d8c86d..f19da572f8 100755
--- a/core/Updates/1.7.2-rc7.php
+++ b/core/Updates/1.7.2-rc7.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_1_7_2_rc7 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('user_dashboard') . '`
@@ -26,7 +26,7 @@ class Updates_1_7_2_rc7 extends Updates
);
}
- static function update()
+ public static function update()
{
try {
$dashboards = Db::fetchAll('SELECT * FROM `' . Common::prefixTable('user_dashboard') . '`');
diff --git a/core/Updates/1.8.3-b1.php b/core/Updates/1.8.3-b1.php
index ee8e6c4d00..51d6d68d06 100644
--- a/core/Updates/1.8.3-b1.php
+++ b/core/Updates/1.8.3-b1.php
@@ -20,7 +20,7 @@ use Piwik\Updates;
class Updates_1_8_3_b1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('site') . '`
@@ -44,7 +44,7 @@ class Updates_1_8_3_b1 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
if (!\Piwik\Plugin\Manager::getInstance()->isPluginLoaded('ScheduledReports')) {
@@ -61,7 +61,6 @@ class Updates_1_8_3_b1 extends Updates
$reports = Db::fetchAll('SELECT * FROM `' . Common::prefixTable('pdf') . '`');
foreach ($reports as $report) {
-
$idreport = $report['idreport'];
$idsite = $report['idsite'];
$login = $report['login'];
@@ -110,6 +109,5 @@ class Updates_1_8_3_b1 extends Updates
Db::query('DROP TABLE `' . Common::prefixTable('pdf') . '`');
} catch (\Exception $e) {
}
-
}
}
diff --git a/core/Updates/1.8.4-b1.php b/core/Updates/1.8.4-b1.php
index 272eb08498..7ab572532f 100644
--- a/core/Updates/1.8.4-b1.php
+++ b/core/Updates/1.8.4-b1.php
@@ -18,12 +18,12 @@ use Piwik\Updates;
class Updates_1_8_4_b1 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return true;
}
- static function getSql()
+ public static function getSql()
{
$action = Common::prefixTable('log_action');
$duplicates = Common::prefixTable('log_action_duplicates');
@@ -176,7 +176,7 @@ class Updates_1_8_4_b1 extends Updates
);
}
- static function update()
+ public static function update()
{
try {
self::enableMaintenanceMode();
diff --git a/core/Updates/1.9-b16.php b/core/Updates/1.9-b16.php
index d6b1c04a09..937c82a49e 100755
--- a/core/Updates/1.9-b16.php
+++ b/core/Updates/1.9-b16.php
@@ -17,12 +17,12 @@ use Piwik\Updates;
*/
class Updates_1_9_b16 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return true;
}
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_link_visit_action') . '`
@@ -45,9 +45,8 @@ class Updates_1_9_b16 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
}
-
diff --git a/core/Updates/1.9-b19.php b/core/Updates/1.9-b19.php
index 87d46f856a..15d2a8fd93 100755
--- a/core/Updates/1.9-b19.php
+++ b/core/Updates/1.9-b19.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_9_b19 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE `' . Common::prefixTable('log_link_visit_action') . '`
@@ -29,7 +29,7 @@ class Updates_1_9_b19 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
@@ -39,4 +39,3 @@ class Updates_1_9_b19 extends Updates
}
}
}
-
diff --git a/core/Updates/1.9-b9.php b/core/Updates/1.9-b9.php
index 5274232cd8..ce37c0ea5b 100755
--- a/core/Updates/1.9-b9.php
+++ b/core/Updates/1.9-b9.php
@@ -17,12 +17,12 @@ use Piwik\Updates;
*/
class Updates_1_9_b9 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return true;
}
- static function getSql()
+ public static function getSql()
{
$logVisit = Common::prefixTable('log_visit');
$logConversion = Common::prefixTable('log_conversion');
@@ -45,7 +45,7 @@ class Updates_1_9_b9 extends Updates
);
}
- static function update()
+ public static function update()
{
try {
self::enableMaintenanceMode();
@@ -57,4 +57,3 @@ class Updates_1_9_b9 extends Updates
}
}
}
-
diff --git a/core/Updates/1.9.1-b2.php b/core/Updates/1.9.1-b2.php
index 81e64b938b..c68b2f8ed7 100644
--- a/core/Updates/1.9.1-b2.php
+++ b/core/Updates/1.9.1-b2.php
@@ -17,14 +17,14 @@ use Piwik\Updates;
*/
class Updates_1_9_1_b2 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE ' . Common::prefixTable('site') . " DROP `feedburnerName`" => 1091
);
}
- static function update()
+ public static function update()
{
// manually remove ExampleFeedburner column
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/1.9.3-b10.php b/core/Updates/1.9.3-b10.php
index a2d7a179a0..5b711b04d4 100755
--- a/core/Updates/1.9.3-b10.php
+++ b/core/Updates/1.9.3-b10.php
@@ -15,12 +15,12 @@ use Piwik\Updates;
*/
class Updates_1_9_3_b10 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return false;
}
- static function update()
+ public static function update()
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('Annotations');
diff --git a/core/Updates/1.9.3-b3.php b/core/Updates/1.9.3-b3.php
index 875a5754cf..e7be93c9fb 100644
--- a/core/Updates/1.9.3-b3.php
+++ b/core/Updates/1.9.3-b3.php
@@ -15,7 +15,7 @@ use Piwik\Updates;
*/
class Updates_1_9_3_b3 extends Updates
{
- static function update()
+ public static function update()
{
// Insight was a temporary code name for Overlay
$pluginToDelete = 'Insight';
diff --git a/core/Updates/1.9.3-b8.php b/core/Updates/1.9.3-b8.php
index 867ac817ac..d3deadc0ce 100755
--- a/core/Updates/1.9.3-b8.php
+++ b/core/Updates/1.9.3-b8.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_1_9_3_b8 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// ignore existing column name error (1060)
@@ -26,7 +26,7 @@ class Updates_1_9_3_b8 extends Updates
);
}
- static function update()
+ public static function update()
{
// add excluded_user_agents column to site table
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/2.0-a13.php b/core/Updates/2.0-a13.php
index b428daef5a..7c01824ee4 100644
--- a/core/Updates/2.0-a13.php
+++ b/core/Updates/2.0-a13.php
@@ -9,7 +9,6 @@
namespace Piwik\Updates;
use Piwik\Common;
-use Piwik\Db;
use Piwik\Option;
use Piwik\Updater;
use Piwik\Updates;
@@ -61,6 +60,5 @@ class Updates_2_0_a13 extends Updates
\Piwik\Plugin\Manager::getInstance()->activatePlugin('ScheduledReports');
} catch (\Exception $e) {
}
-
}
}
diff --git a/core/Updates/2.0-a17.php b/core/Updates/2.0-a17.php
index 5d65143596..38090f9a60 100644
--- a/core/Updates/2.0-a17.php
+++ b/core/Updates/2.0-a17.php
@@ -8,7 +8,6 @@
*/
namespace Piwik\Updates;
-use Piwik\Db;
use Piwik\Filesystem;
use Piwik\Updates;
@@ -33,10 +32,9 @@ class Updates_2_0_a17 extends Updates
if (file_exists($dir)) {
$errors[] = "Please delete this directory manually (eg. using your FTP software): $dir \n";
}
-
}
if (!empty($errors)) {
throw new \Exception("Warnings during the update: <br>" . implode("<br>", $errors));
}
- }
+ }
}
diff --git a/core/Updates/2.0-a7.php b/core/Updates/2.0-a7.php
index 9898d80a89..d2bf8703ed 100644
--- a/core/Updates/2.0-a7.php
+++ b/core/Updates/2.0-a7.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
*/
class Updates_2_0_a7 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// ignore existing column name error (1060)
@@ -29,7 +29,7 @@ class Updates_2_0_a7 extends Updates
);
}
- static function update()
+ public static function update()
{
// add tag & level columns to logger_message table
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/2.0-b10.php b/core/Updates/2.0-b10.php
index 0a2152ed4a..ef6dcba919 100644
--- a/core/Updates/2.0-b10.php
+++ b/core/Updates/2.0-b10.php
@@ -15,7 +15,7 @@ use Piwik\Updates;
*/
class Updates_2_0_b10 extends Updates
{
- static function update()
+ public static function update()
{
parent::deletePluginFromConfigFile('Referers');
parent::deletePluginFromConfigFile('PDFReports');
diff --git a/core/Updates/2.0-b13.php b/core/Updates/2.0-b13.php
index a5e9546b90..a9b7a1618b 100644
--- a/core/Updates/2.0-b13.php
+++ b/core/Updates/2.0-b13.php
@@ -33,10 +33,9 @@ class Updates_2_0_b13 extends Updates
if (file_exists($dir)) {
$errors[] = "Please delete this directory manually (eg. using your FTP software): $dir \n";
}
-
}
if (!empty($errors)) {
throw new \Exception("Warnings during the update: <br>" . implode("<br>", $errors));
}
- }
+ }
}
diff --git a/core/Updates/2.0-b3.php b/core/Updates/2.0-b3.php
index b4dcdf25db..f24c514d7a 100644
--- a/core/Updates/2.0-b3.php
+++ b/core/Updates/2.0-b3.php
@@ -17,12 +17,12 @@ use Piwik\Updates;
*/
class Updates_2_0_b3 extends Updates
{
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return true;
}
- static function getSql()
+ public static function getSql()
{
return array(
'ALTER TABLE ' . Common::prefixTable('log_visit')
@@ -34,7 +34,7 @@ class Updates_2_0_b3 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/2.0-b9.php b/core/Updates/2.0-b9.php
index 59819890ca..568358235f 100644
--- a/core/Updates/2.0-b9.php
+++ b/core/Updates/2.0-b9.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_2_0_b9 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
"ALTER TABLE `" . Common::prefixTable('site')
@@ -26,7 +26,7 @@ class Updates_2_0_b9 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/2.0-rc1.php b/core/Updates/2.0-rc1.php
index 64baac6e6d..dc3f0dbb9c 100644
--- a/core/Updates/2.0-rc1.php
+++ b/core/Updates/2.0-rc1.php
@@ -18,7 +18,7 @@ class Updates_2_0_rc1 extends Updates
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('Morpheus');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.0.3-b7.php b/core/Updates/2.0.3-b7.php
index 9903d999c1..779427db55 100644
--- a/core/Updates/2.0.3-b7.php
+++ b/core/Updates/2.0.3-b7.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
*/
class Updates_2_0_3_b7 extends Updates
{
- static function update()
+ public static function update()
{
$errors = array();
@@ -43,8 +43,7 @@ class Updates_2_0_3_b7 extends Updates
foreach ($oldPlugins as $plugin) {
try {
\Piwik\Plugin\Manager::getInstance()->deactivatePlugin($plugin);
- } catch(\Exception $e) {
-
+ } catch (\Exception $e) {
}
$dir = PIWIK_INCLUDE_PATH . "/plugins/$plugin";
@@ -56,7 +55,6 @@ class Updates_2_0_3_b7 extends Updates
if (file_exists($dir)) {
$errors[] = "Please delete this directory manually (eg. using your FTP software): $dir \n";
}
-
}
if (!empty($errors)) {
throw new \Exception("Warnings during the update: <br>" . implode("<br>", $errors));
diff --git a/core/Updates/2.0.4-b5.php b/core/Updates/2.0.4-b5.php
index 94e6a6529d..c9d5f92718 100644
--- a/core/Updates/2.0.4-b5.php
+++ b/core/Updates/2.0.4-b5.php
@@ -22,7 +22,7 @@ use Piwik\Updates;
*/
class Updates_2_0_4_b5 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
// ignore existing column name error (1060)
@@ -31,7 +31,7 @@ class Updates_2_0_4_b5 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
@@ -78,7 +78,7 @@ class Updates_2_0_4_b5 extends Updates
'superuser_access' => 1
)
);
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
echo "There was an issue, but we proceed: " . $e->getMessage();
}
diff --git a/core/Updates/2.0.4-b7.php b/core/Updates/2.0.4-b7.php
index 512180fec9..319b3bea30 100644
--- a/core/Updates/2.0.4-b7.php
+++ b/core/Updates/2.0.4-b7.php
@@ -9,7 +9,6 @@
namespace Piwik\Updates;
-use Piwik\Db;
use Piwik\Option;
use Piwik\Plugins\MobileMessaging\MobileMessaging;
use Piwik\Plugins\UsersManager\API as UsersManagerApi;
@@ -20,12 +19,12 @@ use Piwik\Updates;
*/
class Updates_2_0_4_b7 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array();
}
- static function update()
+ public static function update()
{
try {
self::migrateExistingMobileMessagingOptions();
diff --git a/core/Updates/2.0.4-b8.php b/core/Updates/2.0.4-b8.php
index 0e8b56c412..f31927a047 100644
--- a/core/Updates/2.0.4-b8.php
+++ b/core/Updates/2.0.4-b8.php
@@ -10,7 +10,6 @@
namespace Piwik\Updates;
use Piwik\Config;
-use Piwik\Db;
use Piwik\Plugins\CoreAdminHome\CustomLogo;
use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig;
use Piwik\UpdaterErrorException;
@@ -20,12 +19,12 @@ use Piwik\Updates;
*/
class Updates_2_0_4_b8 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array();
}
- static function update()
+ public static function update()
{
try {
$config = Config::getInstance();
@@ -34,7 +33,6 @@ class Updates_2_0_4_b8 extends Updates
self::migratePrivacyManagerConfig($config, new PrivacyManagerConfig());
$config->forceSave();
-
} catch (\Exception $e) {
throw new UpdaterErrorException($e->getMessage());
}
diff --git a/core/Updates/2.1.1-b11.php b/core/Updates/2.1.1-b11.php
index 3fa0364e73..ad05de0888 100644
--- a/core/Updates/2.1.1-b11.php
+++ b/core/Updates/2.1.1-b11.php
@@ -21,7 +21,7 @@ use Piwik\Updates;
*/
class Updates_2_1_1_b11 extends Updates
{
- static function update()
+ public static function update()
{
$returningMetrics = array(
'nb_visits_returning',
diff --git a/core/Updates/2.10.0-b10.php b/core/Updates/2.10.0-b10.php
index 3628719ccd..41139073a1 100644
--- a/core/Updates/2.10.0-b10.php
+++ b/core/Updates/2.10.0-b10.php
@@ -16,34 +16,32 @@ use Piwik\Updates;
class Updates_2_10_0_b10 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sqls = array();
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
- $archiveBlobTables = array_filter($archiveTables, function($name) {
+ $archiveBlobTables = array_filter($archiveTables, function ($name) {
return ArchiveTableCreator::getTypeFromTableName($name) == ArchiveTableCreator::BLOB_TABLE;
});
foreach ($archiveBlobTables as $table) {
-
$sqls["UPDATE " . $table . " SET name = 'DevicePlugins_plugin' WHERE name = 'UserSettings_plugin'"] = false;
}
return $sqls;
}
- static function update()
+ public static function update()
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
try {
$pluginManager->activatePlugin('DevicePlugins');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
Updater::updateDatabase(__FILE__, self::getSql());
}
-
}
diff --git a/core/Updates/2.10.0-b4.php b/core/Updates/2.10.0-b4.php
index 88cbaf4df4..fd3c7c5cf1 100644
--- a/core/Updates/2.10.0-b4.php
+++ b/core/Updates/2.10.0-b4.php
@@ -17,13 +17,13 @@ use Piwik\Updates;
class Updates_2_10_0_b4 extends Updates
{
- static function update()
+ public static function update()
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
try {
$pluginManager->activatePlugin('BulkTracking');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.10.0-b5.php b/core/Updates/2.10.0-b5.php
index 51663a9d0a..e7ae8f74a5 100644
--- a/core/Updates/2.10.0-b5.php
+++ b/core/Updates/2.10.0-b5.php
@@ -15,8 +15,7 @@ use Piwik\DataTable;
use Piwik\Db;
use Piwik\Updater;
use Piwik\Updates;
-use DeviceDetector\Parser\Client\Browser AS BrowserParser;
-use Piwik\Plugins\Dashboard\Model AS DashboardModel;
+use Piwik\Plugins\Dashboard\Model as DashboardModel;
/**
* This Update script will update all browser and os archives of UserSettings and DevicesDetection plugin
@@ -44,7 +43,7 @@ class Updates_2_10_0_b5 extends Updates
{
public static $archiveBlobTables;
- static function getSql()
+ public static function getSql()
{
$sqls = array('# ATTENTION: This update script will execute some more SQL queries than that below as it is necessary to rebuilt some archives #' => false);
@@ -86,8 +85,7 @@ class Updates_2_10_0_b5 extends Updates
$allDashboards = Db::get()->fetchAll(sprintf("SELECT * FROM %s", Common::prefixTable('user_dashboard')));
- foreach($allDashboards AS $dashboard) {
-
+ foreach ($allDashboards as $dashboard) {
$dashboardLayout = json_decode($dashboard['layout']);
$dashboardLayout = DashboardModel::replaceDashboardWidgets($dashboardLayout, $oldWidgets, $newWidgets);
@@ -101,7 +99,7 @@ class Updates_2_10_0_b5 extends Updates
return $sqls;
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
@@ -124,7 +122,7 @@ class Updates_2_10_0_b5 extends Updates
if (empty(self::$archiveBlobTables)) {
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
- self::$archiveBlobTables = array_filter($archiveTables, function($name) {
+ self::$archiveBlobTables = array_filter($archiveTables, function ($name) {
return ArchiveTableCreator::getTypeFromTableName($name) == ArchiveTableCreator::BLOB_TABLE;
});
@@ -145,7 +143,6 @@ class Updates_2_10_0_b5 extends Updates
static $deviceDetectionBlobAvailableDate;
if (empty($deviceDetectionBlobAvailableDate)) {
-
$archiveBlobTables = self::getAllArchiveBlobTables();
$deviceDetectionBlobAvailableDate = null;
@@ -157,7 +154,6 @@ class Updates_2_10_0_b5 extends Updates
if (!empty($deviceDetectionBlobAvailableDate)) {
break;
}
-
}
$deviceDetectionBlobAvailableDate = strtotime($deviceDetectionBlobAvailableDate);
@@ -185,14 +181,14 @@ class Updates_2_10_0_b5 extends Updates
// if start date of blob is before calculated date us old usersettings archive instead of already existing DevicesDetection archive
if (strtotime($blob['date1']) < self::getFirstDayOfArchivedDeviceDetectorData()) {
-
Db::get()->query(sprintf("DELETE FROM %s WHERE idarchive = ? AND name = ?", $table), array($blob['idarchive'], 'DevicesDetection_browserVersions'));
Db::get()->query(sprintf("UPDATE %s SET name = ? WHERE idarchive = ? AND name = ?", $table), array('DevicesDetection_browserVersions', $blob['idarchive'], 'UserSettings_browser'));
}
}
}
- public static function updateOsArchives($table) {
+ public static function updateOsArchives($table)
+ {
Db::exec(sprintf("UPDATE IGNORE %s SET name='DevicesDetection_osVersions' WHERE name = 'UserSettings_os'", $table));
/*
@@ -204,7 +200,6 @@ class Updates_2_10_0_b5 extends Updates
// if start date of blob is before calculated date us old usersettings archive instead of already existing DevicesDetection archive
if (strtotime($blob['date1']) < self::getFirstDayOfArchivedDeviceDetectorData()) {
-
Db::get()->query(sprintf("DELETE FROM %s WHERE idarchive = ? AND name = ?", $table), array($blob['idarchive'], 'DevicesDetection_osVersions'));
Db::get()->query(sprintf("UPDATE %s SET name = ? WHERE idarchive = ? AND name = ?", $table), array('DevicesDetection_osVersions', $blob['idarchive'], 'UserSettings_os'));
}
diff --git a/core/Updates/2.10.0-b7.php b/core/Updates/2.10.0-b7.php
index a44117fc81..b385e41d22 100644
--- a/core/Updates/2.10.0-b7.php
+++ b/core/Updates/2.10.0-b7.php
@@ -16,18 +16,17 @@ use Piwik\Updates;
class Updates_2_10_0_b7 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sqls = array();
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
- $archiveBlobTables = array_filter($archiveTables, function($name) {
+ $archiveBlobTables = array_filter($archiveTables, function ($name) {
return ArchiveTableCreator::getTypeFromTableName($name) == ArchiveTableCreator::BLOB_TABLE;
});
foreach ($archiveBlobTables as $table) {
-
$sqls["UPDATE " . $table . " SET name = 'Resolution_resolution' WHERE name = 'UserSettings_resolution'"] = false;
$sqls["UPDATE " . $table . " SET name = 'Resolution_configuration' WHERE name = 'UserSettings_configuration'"] = false;
}
@@ -35,9 +34,8 @@ class Updates_2_10_0_b7 extends Updates
return $sqls;
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
-
}
diff --git a/core/Updates/2.10.0-b8.php b/core/Updates/2.10.0-b8.php
index 17705f8143..03bd866f82 100644
--- a/core/Updates/2.10.0-b8.php
+++ b/core/Updates/2.10.0-b8.php
@@ -13,14 +13,13 @@ use Piwik\Updates;
class Updates_2_10_0_b8 extends Updates
{
- static function update()
+ public static function update()
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
try {
$pluginManager->activatePlugin('Resolution');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
-
}
diff --git a/core/Updates/2.11.0-b2.php b/core/Updates/2.11.0-b2.php
index ce0c7b2533..372256fdf3 100644
--- a/core/Updates/2.11.0-b2.php
+++ b/core/Updates/2.11.0-b2.php
@@ -13,7 +13,7 @@ use Piwik\Db;
use Piwik\Piwik;
use Piwik\Updater;
use Piwik\Updates;
-use Piwik\Plugins\Dashboard\Model AS DashboardModel;
+use Piwik\Plugins\Dashboard\Model as DashboardModel;
/**
* Update for version 2.11.0-b2.
@@ -21,7 +21,7 @@ use Piwik\Plugins\Dashboard\Model AS DashboardModel;
class Updates_2_11_0_b2 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sqls = array();
@@ -38,8 +38,7 @@ class Updates_2_11_0_b2 extends Updates
$allDashboards = Db::get()->fetchAll(sprintf("SELECT * FROM %s", Common::prefixTable('user_dashboard')));
- foreach($allDashboards AS $dashboard) {
-
+ foreach ($allDashboards as $dashboard) {
$dashboardLayout = json_decode($dashboard['layout']);
$dashboardLayout = DashboardModel::replaceDashboardWidgets($dashboardLayout, $oldWidgets, $newWidgets);
@@ -52,13 +51,13 @@ class Updates_2_11_0_b2 extends Updates
return $sqls;
}
- static function update()
+ public static function update()
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
try {
$pluginManager->activatePlugin('Ecommerce');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
Updater::updateDatabase(__FILE__, self::getSql());
diff --git a/core/Updates/2.11.0-b4.php b/core/Updates/2.11.0-b4.php
index 00dc1b23ee..2f7c10cdab 100644
--- a/core/Updates/2.11.0-b4.php
+++ b/core/Updates/2.11.0-b4.php
@@ -16,34 +16,32 @@ use Piwik\Updates;
class Updates_2_11_0_b4 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sqls = array();
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
- $archiveBlobTables = array_filter($archiveTables, function($name) {
+ $archiveBlobTables = array_filter($archiveTables, function ($name) {
return ArchiveTableCreator::getTypeFromTableName($name) == ArchiveTableCreator::BLOB_TABLE;
});
foreach ($archiveBlobTables as $table) {
-
$sqls["UPDATE " . $table . " SET name = 'UserLanguage_language' WHERE name = 'UserSettings_language'"] = false;
}
return $sqls;
}
- static function update()
+ public static function update()
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
try {
$pluginManager->activatePlugin('UserLanguage');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
Updater::updateDatabase(__FILE__, self::getSql());
}
-
}
diff --git a/core/Updates/2.11.0-b5.php b/core/Updates/2.11.0-b5.php
index 1a75fd9f88..5b3ebccb51 100644
--- a/core/Updates/2.11.0-b5.php
+++ b/core/Updates/2.11.0-b5.php
@@ -13,7 +13,7 @@ use Piwik\Updates;
class Updates_2_11_0_b5 extends Updates
{
- static function update()
+ public static function update()
{
try {
Manager::getInstance()->activatePlugin('Monolog');
diff --git a/core/Updates/2.11.1-b4.php b/core/Updates/2.11.1-b4.php
index 7777f10f89..a4c7bb149c 100644
--- a/core/Updates/2.11.1-b4.php
+++ b/core/Updates/2.11.1-b4.php
@@ -19,7 +19,7 @@ class Updates_2_11_1_b4 extends Updates
* Here you can define any action that should be performed during the update. For instance executing SQL statements,
* renaming config entries, updating files, etc.
*/
- static function update()
+ public static function update()
{
if (!Development::isEnabled()) {
return;
diff --git a/core/Updates/2.13.0-b3.php b/core/Updates/2.13.0-b3.php
index 3d6cd83cea..f0950c6422 100644
--- a/core/Updates/2.13.0-b3.php
+++ b/core/Updates/2.13.0-b3.php
@@ -9,7 +9,6 @@
namespace Piwik\Updates;
-use Piwik\Config;
use Piwik\Updater;
use Piwik\Updates;
@@ -21,7 +20,7 @@ class Updates_2_13_0_b3 extends Updates
try {
$pluginManager->activatePlugin('Diagnostics');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.13.1.php b/core/Updates/2.13.1.php
index 8cb01ad22c..32650b05b1 100644
--- a/core/Updates/2.13.1.php
+++ b/core/Updates/2.13.1.php
@@ -22,7 +22,7 @@ class Updates_2_13_1 extends Updates
* Here you can define one or multiple SQL statements that should be executed during the update.
* @return array
*/
- static function getSql()
+ public static function getSql()
{
$optionTable = Common::prefixTable('option');
$removeEmptyDefaultReportsSql = "delete from `$optionTable` where option_name like '%defaultReport%' and option_value=''";
@@ -36,7 +36,7 @@ class Updates_2_13_1 extends Updates
* Here you can define any action that should be performed during the update. For instance executing SQL statements,
* renaming config entries, updating files, etc.
*/
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/2.14.0-b1.php b/core/Updates/2.14.0-b1.php
index 6d6d7ff529..e414bc3af8 100644
--- a/core/Updates/2.14.0-b1.php
+++ b/core/Updates/2.14.0-b1.php
@@ -9,7 +9,6 @@
namespace Piwik\Updates;
-use Piwik\Config;
use Piwik\Updater;
use Piwik\Updates;
use Piwik\Plugin\Manager;
@@ -26,14 +25,12 @@ class Updates_2_14_0_b1 extends Updates
$pluginManager = Manager::getInstance();
if ($pluginManager->isPluginInstalled($plugin)) {
-
if ($pluginManager->isPluginActivated($plugin)) {
$pluginManager->deactivatePlugin($plugin);
}
$pluginManager->unloadPlugin($plugin);
$pluginManager->uninstallPlugin($plugin);
-
} else {
$this->makeSurePluginIsRemovedFromFilesystem($plugin);
}
diff --git a/core/Updates/2.2.0-b15.php b/core/Updates/2.2.0-b15.php
index d35e6a1ff8..1a03a1ccd1 100644
--- a/core/Updates/2.2.0-b15.php
+++ b/core/Updates/2.2.0-b15.php
@@ -7,14 +7,13 @@
*/
namespace Piwik\Updates;
-use Piwik\Db;
use Piwik\Updates;
/**
*/
class Updates_2_2_0_b15 extends Updates
{
- static function update()
+ public static function update()
{
// This was added in the beta cycle and then removed
// if the file is there, it can cause bugs (we don't have an archiver in VisitFrequency anymore)
diff --git a/core/Updates/2.2.3-b6.php b/core/Updates/2.2.3-b6.php
index 0b9d15e4f1..cb2c094e15 100644
--- a/core/Updates/2.2.3-b6.php
+++ b/core/Updates/2.2.3-b6.php
@@ -18,7 +18,7 @@ class Updates_2_2_3_b6 extends Updates
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('ZenMode');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.3.0-rc2.php b/core/Updates/2.3.0-rc2.php
index 052a314a86..3d7488f916 100644
--- a/core/Updates/2.3.0-rc2.php
+++ b/core/Updates/2.3.0-rc2.php
@@ -21,5 +21,4 @@ class Updates_2_3_0_rc2 extends Updates
ServerFilesGenerator::createHtAccessFiles();
}
-
}
diff --git a/core/Updates/2.4.0-b1.php b/core/Updates/2.4.0-b1.php
index cc0d615d54..ab73d614bc 100644
--- a/core/Updates/2.4.0-b1.php
+++ b/core/Updates/2.4.0-b1.php
@@ -16,13 +16,13 @@ class Updates_2_4_0_b1 extends Updates
{
try {
\Piwik\Plugin\Manager::getInstance()->activatePlugin('Morpheus');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
try {
\Piwik\Plugin\Manager::getInstance()->deactivatePlugin('Zeitgeist');
self::deletePluginFromConfigFile('Zeitgeist');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.4.0-b3.php b/core/Updates/2.4.0-b3.php
index 693cfd7ca0..1a166c4ab2 100644
--- a/core/Updates/2.4.0-b3.php
+++ b/core/Updates/2.4.0-b3.php
@@ -18,17 +18,17 @@ class Updates_2_4_0_b3 extends Updates
try {
$pluginManager->activatePlugin('LeftMenu');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
try {
$pluginManager->deactivatePlugin('Zeitgeist');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
try {
$pluginManager->uninstallPlugin('Zeitgeist');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.4.0-b4.php b/core/Updates/2.4.0-b4.php
index ad54fe8343..7cd2288f07 100644
--- a/core/Updates/2.4.0-b4.php
+++ b/core/Updates/2.4.0-b4.php
@@ -23,12 +23,12 @@ class Updates_2_4_0_b4 extends Updates
try {
$pluginManager->deactivatePlugin('Zeitgeist');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
try {
$pluginManager->uninstallPlugin('Zeitgeist');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.4.0-b6.php b/core/Updates/2.4.0-b6.php
index 62ab76c46e..192ace4baf 100644
--- a/core/Updates/2.4.0-b6.php
+++ b/core/Updates/2.4.0-b6.php
@@ -18,7 +18,7 @@ class Updates_2_4_0_b6 extends Updates
try {
$pluginManager->activatePlugin('DevicesDetection');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
diff --git a/core/Updates/2.4.0-b8.php b/core/Updates/2.4.0-b8.php
index 4df50ee0ce..04eaf72334 100644
--- a/core/Updates/2.4.0-b8.php
+++ b/core/Updates/2.4.0-b8.php
@@ -14,7 +14,7 @@ use Piwik\Updates;
class Updates_2_4_0_b8 extends Updates
{
- static function getSql()
+ public static function getSql()
{
return array(
"ALTER TABLE `" . Common::prefixTable('session')
@@ -22,7 +22,7 @@ class Updates_2_4_0_b8 extends Updates
);
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
diff --git a/core/Updates/2.5.0-b1.php b/core/Updates/2.5.0-b1.php
index 54c0e6e026..b29be3dafd 100644
--- a/core/Updates/2.5.0-b1.php
+++ b/core/Updates/2.5.0-b1.php
@@ -33,5 +33,4 @@ class Updates_2_5_0_b1 extends Updates
$config->forceSave();
}
}
-
}
diff --git a/core/Updates/2.5.0-rc2.php b/core/Updates/2.5.0-rc2.php
index e1c55840e9..5140984ff0 100644
--- a/core/Updates/2.5.0-rc2.php
+++ b/core/Updates/2.5.0-rc2.php
@@ -18,7 +18,7 @@ use Piwik\Updates;
class Updates_2_5_0_rc2 extends Updates
{
- static function update()
+ public static function update()
{
$files = self::getFilesToDeleteIfOld();
diff --git a/core/Updates/2.5.0-rc4.php b/core/Updates/2.5.0-rc4.php
index a6485941cb..d847ab98c5 100644
--- a/core/Updates/2.5.0-rc4.php
+++ b/core/Updates/2.5.0-rc4.php
@@ -19,7 +19,7 @@ use Piwik\Updates;
class Updates_2_5_0_rc4 extends Updates
{
- static function update()
+ public static function update()
{
Cache::deleteTrackerCache();
Filesystem::clearPhpCaches();
diff --git a/core/Updates/2.6.0-b1.php b/core/Updates/2.6.0-b1.php
index 5819ca95f9..0f0f7b42d0 100644
--- a/core/Updates/2.6.0-b1.php
+++ b/core/Updates/2.6.0-b1.php
@@ -21,7 +21,7 @@ class Updates_2_6_0_b1 extends Updates
* Here you can define any action that should be performed during the update. For instance executing SQL statements,
* renaming config entries, updating files, etc.
*/
- static function update()
+ public static function update()
{
$config = Config::getInstance();
$config->Plugins_Tracker = array();
diff --git a/core/Updates/2.7.0-b2.php b/core/Updates/2.7.0-b2.php
index 2951dae653..277fcdd1d0 100644
--- a/core/Updates/2.7.0-b2.php
+++ b/core/Updates/2.7.0-b2.php
@@ -15,14 +15,13 @@ use Piwik\Updates;
*/
class Updates_2_7_0_b2 extends Updates
{
- static function update()
+ public static function update()
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
try {
$pluginManager->activatePlugin('Contents');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
}
-
diff --git a/core/Updates/2.7.0-b4.php b/core/Updates/2.7.0-b4.php
index 92f7ff1c71..0d4714ad4e 100644
--- a/core/Updates/2.7.0-b4.php
+++ b/core/Updates/2.7.0-b4.php
@@ -15,19 +15,18 @@ use Piwik\Updates;
*/
class Updates_2_7_0_b4 extends Updates
{
- static function update()
+ public static function update()
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
try {
$pluginManager->activatePlugin('Contents');
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
}
}
- static function isMajorUpdate()
+ public static function isMajorUpdate()
{
return true;
}
}
-
diff --git a/core/Updates/2.9.0-b1.php b/core/Updates/2.9.0-b1.php
index 5720bf076e..8c2333d857 100644
--- a/core/Updates/2.9.0-b1.php
+++ b/core/Updates/2.9.0-b1.php
@@ -17,7 +17,7 @@ use Piwik\Updates;
class Updates_2_9_0_b1 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sql = array();
$sql = self::updateBrowserEngine($sql);
@@ -25,7 +25,7 @@ class Updates_2_9_0_b1 extends Updates
return $sql;
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
@@ -34,7 +34,6 @@ class Updates_2_9_0_b1 extends Updates
try {
Manager::getInstance()->activatePlugin('TestRunner');
} catch (\Exception $e) {
-
}
}
@@ -54,8 +53,7 @@ class Updates_2_9_0_b1 extends Updates
$engineUpdate = "''";
$ifFragment = "IF (`config_browser_name` IN ('%s'), '%s', %s)";
- foreach ($browserEngineMatch AS $engine => $browsers) {
-
+ foreach ($browserEngineMatch as $engine => $browsers) {
$engineUpdate = sprintf($ifFragment, implode("','", $browsers), $engine, $engineUpdate);
}
diff --git a/core/Updates/2.9.0-b7.php b/core/Updates/2.9.0-b7.php
index 110545aaa8..6eeccd71f5 100644
--- a/core/Updates/2.9.0-b7.php
+++ b/core/Updates/2.9.0-b7.php
@@ -16,7 +16,7 @@ use Piwik\Updates;
class Updates_2_9_0_b7 extends Updates
{
- static function getSql()
+ public static function getSql()
{
$sql = array();
$sql = self::addCreateSequenceTableQuery($sql);
@@ -25,7 +25,7 @@ class Updates_2_9_0_b7 extends Updates
return $sql;
}
- static function update()
+ public static function update()
{
Updater::updateDatabase(__FILE__, self::getSql());
}
@@ -87,5 +87,4 @@ class Updates_2_9_0_b7 extends Updates
{
return Common::prefixTable('sequence');
}
-
}
diff --git a/core/Url.php b/core/Url.php
index 04131c9827..6db8ed7ee5 100644
--- a/core/Url.php
+++ b/core/Url.php
@@ -9,9 +9,7 @@
namespace Piwik;
use Exception;
-
use Piwik\Network\IPUtils;
-use Piwik\Session;
/**
* Provides URL related helper methods.
@@ -217,8 +215,9 @@ class Url
if ($host === false) {
$host = @$_SERVER['HTTP_HOST'];
- if (empty($host)) // if no current host, assume valid
- {
+ if (empty($host)) {
+ // if no current host, assume valid
+
return true;
}
}
@@ -406,7 +405,7 @@ class Url
* @return string eg, `"?param2=value2&param3=value3"`
* @api
*/
- static function getCurrentQueryStringWithParametersModified($params)
+ public static function getCurrentQueryStringWithParametersModified($params)
{
$urlValues = self::getArrayFromCurrentQueryString();
foreach ($params as $key => $value) {
diff --git a/core/UrlHelper.php b/core/UrlHelper.php
index bcea3c979f..3a550c8eb3 100644
--- a/core/UrlHelper.php
+++ b/core/UrlHelper.php
@@ -45,7 +45,7 @@ class UrlHelper
$validQuery .= $name . '[]=' . $param . $separator;
}
}
- } else if ($value === false) {
+ } elseif ($value === false) {
$validQuery .= $name . $separator;
} else {
$validQuery .= $name . '=' . $value . $separator;
@@ -207,7 +207,7 @@ class UrlHelper
$nameToValue[$name] = array();
}
array_push($nameToValue[$name], $value);
- } else if (!empty($name)) {
+ } elseif (!empty($name)) {
$nameToValue[$name] = $value;
}
}
@@ -365,7 +365,7 @@ class UrlHelper
$query = str_replace('&', '&amp;', strstr($query, '?'));
}
$searchEngineName = 'Google Images';
- } else if ($searchEngineName === 'Google'
+ } elseif ($searchEngineName === 'Google'
&& (strpos($query, '&as_') !== false || strpos($query, 'as_') === 0)
) {
$keys = array();
diff --git a/core/Version.php b/core/Version.php
index 4060011f1f..da0b9751b0 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -36,5 +36,4 @@ final class Version
{
return (bool) preg_match('/^(\d+)\.(\d+)\.(\d+)-.{1,4}(\d+)$/', $version);
}
-
}
diff --git a/core/View.php b/core/View.php
index 08c65695b9..fc1c1e0a11 100644
--- a/core/View.php
+++ b/core/View.php
@@ -365,7 +365,7 @@ class View implements ViewInterface
* @ignore
*/
public static function clearCompiledTemplates()
- {
+ {
$twig = new Twig();
$environment = $twig->getTwigEnvironment();
$environment->clearTemplateCache();
diff --git a/core/View/RenderTokenParser.php b/core/View/RenderTokenParser.php
index 2800beab8b..bac31e01ca 100644
--- a/core/View/RenderTokenParser.php
+++ b/core/View/RenderTokenParser.php
@@ -79,4 +79,4 @@ class RenderTokenParser extends Twig_TokenParser
{
return 'render';
}
-} \ No newline at end of file
+}
diff --git a/core/View/UIControl.php b/core/View/UIControl.php
index 6bbb1e0b1d..845d0f9d6a 100644
--- a/core/View/UIControl.php
+++ b/core/View/UIControl.php
@@ -168,4 +168,4 @@ class UIControl extends \Piwik\View
{
return array();
}
-} \ No newline at end of file
+}
diff --git a/core/View/ViewInterface.php b/core/View/ViewInterface.php
index 9c8d01ee0c..de3115c376 100644
--- a/core/View/ViewInterface.php
+++ b/core/View/ViewInterface.php
@@ -21,5 +21,5 @@ interface ViewInterface
*
* @return string Serialized data, eg, (image, array, html...).
*/
- function render();
+ public function render();
}
diff --git a/core/ViewDataTable/Config.php b/core/ViewDataTable/Config.php
index f4eef3c639..8e4e59586b 100644
--- a/core/ViewDataTable/Config.php
+++ b/core/ViewDataTable/Config.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\ViewDataTable;
+
use Piwik\API\Request as ApiRequest;
use Piwik\DataTable;
use Piwik\DataTable\Filter\PivotByDimension;
diff --git a/core/ViewDataTable/Request.php b/core/ViewDataTable/Request.php
index 6bca343068..8eff081179 100644
--- a/core/ViewDataTable/Request.php
+++ b/core/ViewDataTable/Request.php
@@ -142,5 +142,4 @@ class Request
return false;
}
-
}
diff --git a/core/ViewDataTable/RequestConfig.php b/core/ViewDataTable/RequestConfig.php
index a6c9b7bed8..2c6e364d1d 100644
--- a/core/ViewDataTable/RequestConfig.php
+++ b/core/ViewDataTable/RequestConfig.php
@@ -8,7 +8,7 @@
*/
namespace Piwik\ViewDataTable;
-use Piwik\Common;
+
/**
* Contains base request properties for {@link Piwik\Plugin\ViewDataTable} instances. Manipulating
diff --git a/core/dispatch.php b/core/dispatch.php
index fd05aac2b5..53d0b8b3b3 100644
--- a/core/dispatch.php
+++ b/core/dispatch.php
@@ -39,4 +39,4 @@ if (PIWIK_ENABLE_DISPATCH) {
} catch (Exception $ex) {
ExceptionHandler::dieWithHtmlErrorPage($ex);
}
-} \ No newline at end of file
+}
diff --git a/core/testMinimumPhpVersion.php b/core/testMinimumPhpVersion.php
index eb1ee157ee..6bbe380ffb 100644
--- a/core/testMinimumPhpVersion.php
+++ b/core/testMinimumPhpVersion.php
@@ -100,7 +100,7 @@ if (!function_exists('Piwik_GetErrorMessagePage')) {
header('Content-Type: text/html; charset=utf-8');
$isInternalServerError = preg_match('/(sql|database|mysql)/i', $message);
- if($isInternalServerError) {
+ if ($isInternalServerError) {
header('HTTP/1.1 500 Internal Server Error');
}
}