diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2014-07-22 11:29:44 +0400 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2014-07-22 11:29:44 +0400 |
commit | ba70cfb04b2570e1bb432c3d46b61c1fa8021079 (patch) | |
tree | d5dff27f495c725c5338ab0e5c56897cdfbf7b0d /plugins | |
parent | 3964ebc71576e917fe24a81c7a3662576ed76ca7 (diff) | |
parent | 893801a082a173e645f31f00b4f6ef1ed29bb512 (diff) |
Merge pull request #5847 from craue/code-cleanup-2
code cleanup
Diffstat (limited to 'plugins')
60 files changed, 134 insertions, 142 deletions
diff --git a/plugins/API/API.php b/plugins/API/API.php index 3253ae5f21..b72ab0ee86 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -86,7 +86,7 @@ class API extends \Piwik\Plugin\API * translated here. * @return array */ - static public function getDefaultMetricTranslations() + public static function getDefaultMetricTranslations() { return Metrics::getDefaultMetricTranslations(); } diff --git a/plugins/API/ProcessedReport.php b/plugins/API/ProcessedReport.php index 86a7fd1698..ef1fcf6182 100644 --- a/plugins/API/ProcessedReport.php +++ b/plugins/API/ProcessedReport.php @@ -449,7 +449,7 @@ class ProcessedReport list($newReport, $columns, $rowsMetadata, $totals) = $this->handleTableReport($idSite, $dataTable, $reportMetadata, $showRawMetrics); - foreach ($columns as $columnId => &$name) { + foreach ($columns as &$name) { $name = ucfirst($name); } $website = new Site($idSite); @@ -534,7 +534,7 @@ class ProcessedReport $rowsMetadata->setKeyName("prettyDate"); // Process each Simple entry - foreach ($dataTable->getDataTables() as $label => $simpleDataTable) { + foreach ($dataTable->getDataTables() as $simpleDataTable) { $this->removeEmptyColumns($columns, $reportMetadata, $simpleDataTable); list($enhancedSimpleDataTable, $rowMetadata) = $this->handleSimpleDataTable($idSite, $simpleDataTable, $columns, $hasDimension, $showRawMetrics); diff --git a/plugins/API/RowEvolution.php b/plugins/API/RowEvolution.php index 69bb5e2f56..84bc431c47 100644 --- a/plugins/API/RowEvolution.php +++ b/plugins/API/RowEvolution.php @@ -144,7 +144,7 @@ class RowEvolution $logo = $actualLabel = false; $urlFound = false; - foreach ($dataTable->getDataTables() as $date => $subTable) { + foreach ($dataTable->getDataTables() as $subTable) { /** @var $subTable DataTable */ $subTable->applyQueuedFilters(); if ($subTable->getRowsCount() > 0) { diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php index c915060885..ed161bdfec 100644 --- a/plugins/Actions/API.php +++ b/plugins/Actions/API.php @@ -81,8 +81,10 @@ class API extends \Piwik\Plugin\API } if ($avgGenerationTimeRequested) { - $tempColumns[] = Archiver::METRIC_SUM_TIME_RECORD_NAME; - $tempColumns[] = Archiver::METRIC_HITS_TIMED_RECORD_NAME; + $tempColumns = array( + Archiver::METRIC_SUM_TIME_RECORD_NAME, + Archiver::METRIC_HITS_TIMED_RECORD_NAME, + ); $columns = array_merge($columns, $tempColumns); $columns = array_unique($columns); @@ -342,7 +344,6 @@ class API extends \Piwik\Plugin\API $dataTable = $customVariables->getEmptyClone(); $customVariableDatatables = $customVariables->getDataTables(); - $dataTables = $dataTable->getDataTables(); foreach ($customVariableDatatables as $key => $customVariableTableForDate) { // we do not enter the IF, in the case idSite=1,3 AND period=day&date=datefrom,dateto, if ($customVariableTableForDate instanceof DataTable diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php index 91042fce4f..3407c7f8e2 100644 --- a/plugins/Actions/Actions.php +++ b/plugins/Actions/Actions.php @@ -123,14 +123,14 @@ class Actions extends \Piwik\Plugin return true; } - static public function checkCustomVariablesPluginEnabled() + public static function checkCustomVariablesPluginEnabled() { if (!self::isCustomVariablesPluginsEnabled()) { throw new \Exception("To Track Site Search Categories, please ask the Piwik Administrator to enable the 'Custom Variables' plugin in Settings > Plugins."); } } - static public function isCustomVariablesPluginsEnabled() + public static function isCustomVariablesPluginsEnabled() { return \Piwik\Plugin\Manager::getInstance()->isPluginActivated('CustomVariables'); } diff --git a/plugins/Actions/Archiver.php b/plugins/Actions/Archiver.php index 758e3acb85..30146cbac3 100644 --- a/plugins/Actions/Archiver.php +++ b/plugins/Actions/Archiver.php @@ -56,12 +56,12 @@ class Archiver extends \Piwik\Plugin\Archiver Action::TYPE_PAGE_TITLE, Action::TYPE_SITE_SEARCH, ); - static protected $columnsToRenameAfterAggregation = array( + protected static $columnsToRenameAfterAggregation = array( Metrics::INDEX_NB_UNIQ_VISITORS => Metrics::INDEX_SUM_DAILY_NB_UNIQ_VISITORS, Metrics::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS => Metrics::INDEX_PAGE_ENTRY_SUM_DAILY_NB_UNIQ_VISITORS, Metrics::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS => Metrics::INDEX_PAGE_EXIT_SUM_DAILY_NB_UNIQ_VISITORS, ); - static public $columnsToDeleteAfterAggregation = array( + public static $columnsToDeleteAfterAggregation = array( Metrics::INDEX_NB_UNIQ_VISITORS, Metrics::INDEX_PAGE_ENTRY_NB_UNIQ_VISITORS, Metrics::INDEX_PAGE_EXIT_NB_UNIQ_VISITORS, @@ -121,7 +121,7 @@ class Archiver extends \Piwik\Plugin\Archiver /** * @return string */ - static public function getWhereClauseActionIsNotEvent() + public static function getWhereClauseActionIsNotEvent() { return " AND log_link_visit_action.idaction_event_category IS NULL"; } diff --git a/plugins/Actions/ArchivingHelper.php b/plugins/Actions/ArchivingHelper.php index 908375d032..86e035f458 100644 --- a/plugins/Actions/ArchivingHelper.php +++ b/plugins/Actions/ArchivingHelper.php @@ -38,7 +38,7 @@ class ArchivingHelper * @param array $actionsTablesByType * @return int */ - static public function updateActionsTableWithRowQuery($query, $fieldQueried, & $actionsTablesByType) + public static function updateActionsTableWithRowQuery($query, $fieldQueried, & $actionsTablesByType) { $rowsProcessed = 0; while ($row = $query->fetch()) { @@ -284,17 +284,17 @@ class ArchivingHelper return $newValue; } - static public $maximumRowsInDataTableLevelZero; - static public $maximumRowsInSubDataTable; - static public $columnToSortByBeforeTruncation; + public static $maximumRowsInDataTableLevelZero; + public static $maximumRowsInSubDataTable; + public static $columnToSortByBeforeTruncation; - static protected $actionUrlCategoryDelimiter = null; - static protected $actionTitleCategoryDelimiter = null; - static protected $defaultActionName = null; - static protected $defaultActionNameWhenNotDefined = null; - static protected $defaultActionUrlWhenNotDefined = null; + protected static $actionUrlCategoryDelimiter = null; + protected static $actionTitleCategoryDelimiter = null; + protected static $defaultActionName = null; + protected static $defaultActionNameWhenNotDefined = null; + protected static $defaultActionUrlWhenNotDefined = null; - static public function reloadConfig() + public static function reloadConfig() { // for BC, we read the old style delimiter first (see #1067)Row $actionDelimiter = @Config::getInstance()->General['action_category_delimiter']; @@ -320,7 +320,7 @@ class ArchivingHelper * * @return Row */ - static private function getDefaultRow() + private static function getDefaultRow() { static $row = false; if ($row === false) { @@ -390,7 +390,7 @@ class ArchivingHelper * @param $type * @return string */ - static public function getUnknownActionName($type) + public static function getUnknownActionName($type) { if (empty(self::$defaultActionNameWhenNotDefined)) { self::$defaultActionNameWhenNotDefined = Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageName')); @@ -425,7 +425,7 @@ class ArchivingHelper * @param int $urlPrefix url prefix (only used for TYPE_PAGE_URL) * @return array of exploded elements from $name */ - static public function getActionExplodedNames($name, $type, $urlPrefix = null) + public static function getActionExplodedNames($name, $type, $urlPrefix = null) { // Site Search does not split Search keywords if ($type == Action::TYPE_SITE_SEARCH) { @@ -477,7 +477,7 @@ class ArchivingHelper /** * Static cache to store Rows during processing */ - static protected $cacheParsedAction = array(); + protected static $cacheParsedAction = array(); public static function clearActionsCache() { diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php index d651c8f1ca..e18bd3f031 100644 --- a/plugins/CoreAdminHome/API.php +++ b/plugins/CoreAdminHome/API.php @@ -193,7 +193,7 @@ class API extends \Piwik\Plugin\API * @ignore * @return mixed */ - static public function getWebsiteIdsToInvalidate() + public static function getWebsiteIdsToInvalidate() { Piwik::checkUserHasSomeAdminAccess(); diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php index e50451fd84..7de5be31d0 100644 --- a/plugins/CoreAdminHome/Controller.php +++ b/plugins/CoreAdminHome/Controller.php @@ -273,7 +273,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin return '0'; } - static public function isGeneralSettingsAdminEnabled() + public static function isGeneralSettingsAdminEnabled() { return (bool) Config::getInstance()->General['enable_general_settings_admin']; } diff --git a/plugins/CoreConsole/Commands/CoreArchiver.php b/plugins/CoreConsole/Commands/CoreArchiver.php index aed4ed9721..4a3a24fc61 100644 --- a/plugins/CoreConsole/Commands/CoreArchiver.php +++ b/plugins/CoreConsole/Commands/CoreArchiver.php @@ -81,7 +81,7 @@ class CoreArchiver extends ConsoleCommand } // This is reused by another console command - static public function configureArchiveCommand(ConsoleCommand $command) + public static function configureArchiveCommand(ConsoleCommand $command) { $command->setName('core:archive'); $command->setDescription("Runs the CLI archiver. It is an important tool for general maintenance and to keep Piwik very fast."); diff --git a/plugins/CoreConsole/Commands/GenerateApi.php b/plugins/CoreConsole/Commands/GenerateApi.php index cd7d536ea1..39ce9a48c5 100644 --- a/plugins/CoreConsole/Commands/GenerateApi.php +++ b/plugins/CoreConsole/Commands/GenerateApi.php @@ -45,7 +45,7 @@ class GenerateApi extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateCommand.php b/plugins/CoreConsole/Commands/GenerateCommand.php index d3199ef2c4..416c7f64c7 100644 --- a/plugins/CoreConsole/Commands/GenerateCommand.php +++ b/plugins/CoreConsole/Commands/GenerateCommand.php @@ -52,7 +52,7 @@ class GenerateCommand extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return string - * @throws \RunTimeException + * @throws \RuntimeException */ private function getCommandName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateController.php b/plugins/CoreConsole/Commands/GenerateController.php index 2f2d4a4e15..19a05aeab6 100644 --- a/plugins/CoreConsole/Commands/GenerateController.php +++ b/plugins/CoreConsole/Commands/GenerateController.php @@ -45,7 +45,7 @@ class GenerateController extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateDimension.php b/plugins/CoreConsole/Commands/GenerateDimension.php index 73c2984d1b..0c11020b26 100644 --- a/plugins/CoreConsole/Commands/GenerateDimension.php +++ b/plugins/CoreConsole/Commands/GenerateDimension.php @@ -104,7 +104,7 @@ class GenerateDimension extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getDimensionName(InputInterface $input, OutputInterface $output) { @@ -139,7 +139,7 @@ class GenerateDimension extends GeneratePluginBase * @param OutputInterface $output * @param string $type * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getColumnName(InputInterface $input, OutputInterface $output, $type) { @@ -187,7 +187,7 @@ class GenerateDimension extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getColumnType(InputInterface $input, OutputInterface $output) { @@ -215,7 +215,7 @@ class GenerateDimension extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getDimensionType(InputInterface $input, OutputInterface $output) { @@ -245,7 +245,7 @@ class GenerateDimension extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateMenu.php b/plugins/CoreConsole/Commands/GenerateMenu.php index c5d0fe62ba..d26deb5de5 100644 --- a/plugins/CoreConsole/Commands/GenerateMenu.php +++ b/plugins/CoreConsole/Commands/GenerateMenu.php @@ -45,7 +45,7 @@ class GenerateMenu extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GeneratePlugin.php b/plugins/CoreConsole/Commands/GeneratePlugin.php index db8bd3aedd..539159bec4 100644 --- a/plugins/CoreConsole/Commands/GeneratePlugin.php +++ b/plugins/CoreConsole/Commands/GeneratePlugin.php @@ -117,7 +117,7 @@ class GeneratePlugin extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { @@ -125,17 +125,17 @@ class GeneratePlugin extends GeneratePluginBase $validate = function ($pluginName) use ($self) { if (empty($pluginName)) { - throw new \RunTimeException('You have to enter a plugin name'); + throw new \RuntimeException('You have to enter a plugin name'); } if (!Filesystem::isValidFilename($pluginName)) { - throw new \RunTimeException(sprintf('The plugin name %s is not valid', $pluginName)); + throw new \RuntimeException(sprintf('The plugin name %s is not valid', $pluginName)); } $pluginPath = $self->getPluginPath($pluginName); if (file_exists($pluginPath)) { - throw new \RunTimeException('A plugin with this name already exists'); + throw new \RuntimeException('A plugin with this name already exists'); } return $pluginName; @@ -159,16 +159,16 @@ class GeneratePlugin extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return mixed - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginDescription(InputInterface $input, OutputInterface $output) { $validate = function ($description) { if (empty($description)) { - throw new \RunTimeException('You have to enter a description'); + throw new \RuntimeException('You have to enter a description'); } if (150 < strlen($description)) { - throw new \RunTimeException('Description is too long, max 150 characters allowed.'); + throw new \RuntimeException('Description is too long, max 150 characters allowed.'); } return $description; diff --git a/plugins/CoreConsole/Commands/GeneratePluginBase.php b/plugins/CoreConsole/Commands/GeneratePluginBase.php index cd90321fec..5cfc506ac8 100644 --- a/plugins/CoreConsole/Commands/GeneratePluginBase.php +++ b/plugins/CoreConsole/Commands/GeneratePluginBase.php @@ -242,7 +242,7 @@ abstract class GeneratePluginBase extends ConsoleCommand * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function askPluginNameAndValidate(InputInterface $input, OutputInterface $output, $pluginNames, $invalidArgumentException) { diff --git a/plugins/CoreConsole/Commands/GenerateReport.php b/plugins/CoreConsole/Commands/GenerateReport.php index d1e5cbbcf9..84677f10db 100644 --- a/plugins/CoreConsole/Commands/GenerateReport.php +++ b/plugins/CoreConsole/Commands/GenerateReport.php @@ -100,7 +100,7 @@ class GenerateReport extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getReportName(InputInterface $input, OutputInterface $output) { @@ -134,7 +134,7 @@ class GenerateReport extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getDocumentation(InputInterface $input, OutputInterface $output) { @@ -165,7 +165,7 @@ class GenerateReport extends GeneratePluginBase * @param OutputInterface $output * @param string $pluginName * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getCategory(InputInterface $input, OutputInterface $output, $pluginName) { @@ -214,7 +214,7 @@ class GenerateReport extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getDimension(InputInterface $input, OutputInterface $output) { @@ -270,7 +270,7 @@ class GenerateReport extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateScheduledTask.php b/plugins/CoreConsole/Commands/GenerateScheduledTask.php index ee95f80069..3a52e44556 100644 --- a/plugins/CoreConsole/Commands/GenerateScheduledTask.php +++ b/plugins/CoreConsole/Commands/GenerateScheduledTask.php @@ -45,7 +45,7 @@ class GenerateScheduledTask extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateSettings.php b/plugins/CoreConsole/Commands/GenerateSettings.php index 394882c66b..3fd2cde563 100644 --- a/plugins/CoreConsole/Commands/GenerateSettings.php +++ b/plugins/CoreConsole/Commands/GenerateSettings.php @@ -45,7 +45,7 @@ class GenerateSettings extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateTest.php b/plugins/CoreConsole/Commands/GenerateTest.php index d08ba28f7c..a9ace19a8b 100644 --- a/plugins/CoreConsole/Commands/GenerateTest.php +++ b/plugins/CoreConsole/Commands/GenerateTest.php @@ -69,7 +69,7 @@ class GenerateTest extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return string - * @throws \RunTimeException + * @throws \RuntimeException */ private function getTestName(InputInterface $input, OutputInterface $output) { @@ -103,7 +103,7 @@ class GenerateTest extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateUpdate.php b/plugins/CoreConsole/Commands/GenerateUpdate.php index 745918666a..a9d843d04d 100644 --- a/plugins/CoreConsole/Commands/GenerateUpdate.php +++ b/plugins/CoreConsole/Commands/GenerateUpdate.php @@ -89,7 +89,7 @@ class GenerateUpdate extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ private function getComponent(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreConsole/Commands/GenerateVisualizationPlugin.php b/plugins/CoreConsole/Commands/GenerateVisualizationPlugin.php index b2f3d9ea11..4d2a08c7fe 100644 --- a/plugins/CoreConsole/Commands/GenerateVisualizationPlugin.php +++ b/plugins/CoreConsole/Commands/GenerateVisualizationPlugin.php @@ -60,7 +60,7 @@ class GenerateVisualizationPlugin extends GeneratePlugin * @param InputInterface $input * @param OutputInterface $output * @return string - * @throws \RunTimeException + * @throws \RuntimeException */ private function getVisualizationName(InputInterface $input, OutputInterface $output) { @@ -68,11 +68,11 @@ class GenerateVisualizationPlugin extends GeneratePlugin $validate = function ($visualizationName) use ($self) { if (empty($visualizationName)) { - throw new \RunTimeException('You have to enter a visualization name'); + throw new \RuntimeException('You have to enter a visualization name'); } if (!ctype_alnum($visualizationName)) { - throw new \RunTimeException(sprintf('The visualization name %s is not valid (only AlNum allowed)', $visualizationName)); + throw new \RuntimeException(sprintf('The visualization name %s is not valid (only AlNum allowed)', $visualizationName)); } return $visualizationName; diff --git a/plugins/CoreConsole/Commands/GenerateWidget.php b/plugins/CoreConsole/Commands/GenerateWidget.php index 605b336a23..c7fabb1c44 100644 --- a/plugins/CoreConsole/Commands/GenerateWidget.php +++ b/plugins/CoreConsole/Commands/GenerateWidget.php @@ -51,7 +51,7 @@ class GenerateWidget extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getCategory(InputInterface $input, OutputInterface $output) { @@ -94,7 +94,7 @@ class GenerateWidget extends GeneratePluginBase * @param InputInterface $input * @param OutputInterface $output * @return array - * @throws \RunTimeException + * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) { diff --git a/plugins/CoreHome/Columns/VisitGoalBuyer.php b/plugins/CoreHome/Columns/VisitGoalBuyer.php index 7b9b79f50f..1fcf91cb96 100644 --- a/plugins/CoreHome/Columns/VisitGoalBuyer.php +++ b/plugins/CoreHome/Columns/VisitGoalBuyer.php @@ -24,7 +24,7 @@ class VisitGoalBuyer extends VisitDimension const TYPE_BUYER_OPEN_CART = GoalManager::TYPE_BUYER_OPEN_CART; const TYPE_BUYER_ORDERED_AND_OPEN_CART = GoalManager::TYPE_BUYER_ORDERED_AND_OPEN_CART; - static protected $visitEcommerceStatus = array( + protected static $visitEcommerceStatus = array( self::TYPE_BUYER_NONE => 'none', self::TYPE_BUYER_ORDERED => 'ordered', self::TYPE_BUYER_OPEN_CART => 'abandonedCart', @@ -83,7 +83,7 @@ class VisitGoalBuyer extends VisitDimension return false; } - static public function getVisitEcommerceStatus($status) + public static function getVisitEcommerceStatus($status) { $id = array_search($status, self::$visitEcommerceStatus); @@ -97,7 +97,7 @@ class VisitGoalBuyer extends VisitDimension /** * @ignore */ - static public function getVisitEcommerceStatusFromId($id) + public static function getVisitEcommerceStatusFromId($id) { if (!isset(self::$visitEcommerceStatus[$id])) { throw new \Exception("Unexpected ECommerce status value "); @@ -128,4 +128,4 @@ class VisitGoalBuyer extends VisitDimension return self::TYPE_BUYER_OPEN_CART; } -}
\ No newline at end of file +} diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php index c2977088aa..c14078e1ad 100644 --- a/plugins/CoreUpdater/Controller.php +++ b/plugins/CoreUpdater/Controller.php @@ -46,7 +46,7 @@ class Controller extends \Piwik\Plugin\Controller private $pathPiwikZip = false; private $newVersion; - static protected function getLatestZipUrl($newVersion) + protected static function getLatestZipUrl($newVersion) { if (@Config::getInstance()->Debug['allow_upgrades_to_beta']) { return 'http://builds.piwik.org/piwik-' . $newVersion . '.zip'; diff --git a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php index 3de82dbc17..0fdaa2c1eb 100644 --- a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php +++ b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php @@ -78,7 +78,7 @@ class Evolution extends JqplotDataGenerator $axisXOnClick = array(); $queryStringAsHash = $this->getQueryStringAsHash(); - foreach ($dataTable->getDataTables() as $idDataTable => $metadataDataTable) { + foreach ($dataTable->getDataTables() as $metadataDataTable) { $dateInUrl = $metadataDataTable->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX)->getDateStart(); $parameters = array( 'idSite' => $idSite, diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php index 6598f97b89..0a78e219e6 100644 --- a/plugins/CoreVisualizations/Visualizations/Cloud.php +++ b/plugins/CoreVisualizations/Visualizations/Cloud.php @@ -143,7 +143,7 @@ class Cloud extends Visualization $tmpArray = $this->wordsArray; $this->wordsArray = array(); - foreach ($keys as $key => $value) { + foreach ($keys as $value) { $this->wordsArray[$value] = $tmpArray[$value]; } diff --git a/plugins/Events/Events.php b/plugins/Events/Events.php index 4992ca3452..088eb213a1 100644 --- a/plugins/Events/Events.php +++ b/plugins/Events/Events.php @@ -75,7 +75,7 @@ class Events extends \Piwik\Plugin /** * @return array */ - static public function getLabelTranslations() + public static function getLabelTranslations() { return array( 'getCategory' => array('Events_EventCategories', 'Events_EventCategory'), diff --git a/plugins/Goals/Archiver.php b/plugins/Goals/Archiver.php index 4d727adbd6..146cdccd6f 100644 --- a/plugins/Goals/Archiver.php +++ b/plugins/Goals/Archiver.php @@ -186,7 +186,7 @@ class Archiver extends \Piwik\Plugin\Archiver * @param int|bool $idGoal idGoal to return the metrics for, or false to return overall * @return string Archive record name */ - static public function getRecordName($recordName, $idGoal = false) + public static function getRecordName($recordName, $idGoal = false) { $idGoalStr = ''; if ($idGoal !== false) { @@ -356,7 +356,7 @@ class Archiver extends \Piwik\Plugin\Archiver return array(GoalManager::IDGOAL_CART, GoalManager::IDGOAL_ORDER); } - static public function getItemRecordNameAbandonedCart($recordName) + public static function getItemRecordNameAbandonedCart($recordName) { return $recordName . '_Cart'; } diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index 0aea5cb842..39a7c0b2dc 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -30,7 +30,7 @@ class Goals extends \Piwik\Plugin return $info; } - static public function getReportsWithGoalMetrics() + public static function getReportsWithGoalMetrics() { $dimensions = self::getAllReportsWithGoalMetrics(); @@ -64,7 +64,7 @@ class Goals extends \Piwik\Plugin return $orderA > $orderB; } - static public function getGoalColumns($idGoal) + public static function getGoalColumns($idGoal) { $columns = array( 'nb_conversions', @@ -177,7 +177,7 @@ class Goals extends \Piwik\Plugin } } - static private function getAllReportsWithGoalMetrics() + private static function getAllReportsWithGoalMetrics() { $reportsWithGoals = array(); diff --git a/plugins/Goals/Visualizations/Goals.php b/plugins/Goals/Visualizations/Goals.php index 512ca91633..0b8c2c5365 100644 --- a/plugins/Goals/Visualizations/Goals.php +++ b/plugins/Goals/Visualizations/Goals.php @@ -191,7 +191,7 @@ class Goals extends HtmlTable // set columns to display (columns of same type but different goals will be next to each other, // ie, goal_0_nb_conversions, goal_1_nb_conversions, etc.) - foreach ($goalColumnTemplates as $idx => $columnTemplate) { + foreach ($goalColumnTemplates as $columnTemplate) { foreach ($idGoals as $idGoal) { $this->config->columns_to_display[] = sprintf($columnTemplate, $idGoal); } diff --git a/plugins/ImageGraph/API.php b/plugins/ImageGraph/API.php index 1aa5348b60..1ce331d9d8 100644 --- a/plugins/ImageGraph/API.php +++ b/plugins/ImageGraph/API.php @@ -41,7 +41,7 @@ class API extends \Piwik\Plugin\API const MAX_WIDTH = 2048; const MAX_HEIGHT = 2048; - static private $DEFAULT_PARAMETERS = array( + private static $DEFAULT_PARAMETERS = array( StaticGraph::GRAPH_TYPE_BASIC_LINE => array( self::FILENAME_KEY => 'BasicLine', self::TRUNCATE_KEY => 6, @@ -74,7 +74,7 @@ class API extends \Piwik\Plugin\API ), ); - static private $DEFAULT_GRAPH_TYPE_OVERRIDE = array( + private static $DEFAULT_GRAPH_TYPE_OVERRIDE = array( 'UserSettings_getPlugin' => array( false // override if !$isMultiplePeriod => StaticGraph::GRAPH_TYPE_HORIZONTAL_BAR, diff --git a/plugins/ImageGraph/ImageGraph.php b/plugins/ImageGraph/ImageGraph.php index bcc6833b89..0344d8567f 100644 --- a/plugins/ImageGraph/ImageGraph.php +++ b/plugins/ImageGraph/ImageGraph.php @@ -27,12 +27,12 @@ class ImageGraph extends \Piwik\Plugin return $info; } - static private $CONSTANT_ROW_COUNT_REPORT_EXCEPTIONS = array( + private static $CONSTANT_ROW_COUNT_REPORT_EXCEPTIONS = array( 'Referrers_getReferrerType', ); // row evolution support not yet implemented for these APIs - static private $REPORTS_DISABLED_EVOLUTION_GRAPH = array( + private static $REPORTS_DISABLED_EVOLUTION_GRAPH = array( 'Referrers_getAll', ); diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php index 6c6fbb2705..0ece9a173d 100644 --- a/plugins/ImageGraph/StaticGraph.php +++ b/plugins/ImageGraph/StaticGraph.php @@ -32,7 +32,7 @@ abstract class StaticGraph const GRAPH_TYPE_3D_PIE = "3dPie"; const GRAPH_TYPE_BASIC_PIE = "pie"; - static private $availableStaticGraphTypes = array( + private static $availableStaticGraphTypes = array( self::GRAPH_TYPE_BASIC_LINE => 'Evolution', self::GRAPH_TYPE_VERTICAL_BAR => 'VerticalBar', self::GRAPH_TYPE_HORIZONTAL_BAR => 'HorizontalBar', @@ -311,7 +311,7 @@ abstract class StaticGraph $maxWidth = 0; $maxHeight = 0; - foreach ($values as $column => $data) { + foreach ($values as $data) { foreach ($data as $value) { list($valueWidth, $valueHeight) = $this->getTextWidthHeight($value); diff --git a/plugins/Installation/ServerFilesGenerator.php b/plugins/Installation/ServerFilesGenerator.php index 5b38fcf1d0..df0c91f081 100644 --- a/plugins/Installation/ServerFilesGenerator.php +++ b/plugins/Installation/ServerFilesGenerator.php @@ -64,7 +64,7 @@ class ServerFilesGenerator } } - static public function createHtAccessDenyAll($path) + public static function createHtAccessDenyAll($path) { self::createHtAccess($path, $overwrite = false, self::getDenyAllHtaccessContent()); } diff --git a/plugins/LanguagesManager/Commands/CompareKeys.php b/plugins/LanguagesManager/Commands/CompareKeys.php index 9fb1478392..a5998f79ca 100644 --- a/plugins/LanguagesManager/Commands/CompareKeys.php +++ b/plugins/LanguagesManager/Commands/CompareKeys.php @@ -30,8 +30,6 @@ class CompareKeys extends ConsoleCommand protected function execute(InputInterface $input, OutputInterface $output) { - $dialog = $this->getHelperSet()->get('dialog'); - $command = $this->getApplication()->find('translations:fetch'); $arguments = array( 'command' => 'translations:fetch', diff --git a/plugins/LanguagesManager/LanguagesManager.php b/plugins/LanguagesManager/LanguagesManager.php index bf592fd746..ff53082736 100644 --- a/plugins/LanguagesManager/LanguagesManager.php +++ b/plugins/LanguagesManager/LanguagesManager.php @@ -127,7 +127,7 @@ class LanguagesManager extends \Piwik\Plugin /** * @return string Two letters language code, eg. "fr" */ - static public function getLanguageCodeForCurrentUser() + public static function getLanguageCodeForCurrentUser() { $languageCode = self::getLanguageFromPreferences(); if (!API::getInstance()->isLanguageAvailable($languageCode)) { @@ -142,7 +142,7 @@ class LanguagesManager extends \Piwik\Plugin /** * @return string Full english language string, eg. "French" */ - static public function getLanguageNameForCurrentUser() + public static function getLanguageNameForCurrentUser() { $languageCode = self::getLanguageCodeForCurrentUser(); $languages = API::getInstance()->getAvailableLanguageNames(); @@ -157,7 +157,7 @@ class LanguagesManager extends \Piwik\Plugin /** * @return string|false if language preference could not be loaded */ - static protected function getLanguageFromPreferences() + protected static function getLanguageFromPreferences() { if (($language = self::getLanguageForSession()) != null) { return $language; @@ -176,7 +176,7 @@ class LanguagesManager extends \Piwik\Plugin * * @return string|null */ - static public function getLanguageForSession() + public static function getLanguageForSession() { $cookieName = Config::getInstance()->General['language_cookie_name']; $cookie = new Cookie($cookieName); @@ -192,7 +192,7 @@ class LanguagesManager extends \Piwik\Plugin * @param string $languageCode ISO language code * @return bool */ - static public function setLanguageForSession($languageCode) + public static function setLanguageForSession($languageCode) { if (!API::getInstance()->isLanguageAvailable($languageCode)) { return false; diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php index b09d3344d6..b4c1c3eb06 100644 --- a/plugins/Live/Visitor.php +++ b/plugins/Live/Visitor.php @@ -892,7 +892,7 @@ class Visitor implements VisitorInterface // Enrich ecommerce carts/orders with the list of products usort($ecommerceDetails, array('static', 'sortByServerTime')); - foreach ($ecommerceDetails as $key => &$ecommerceConversion) { + foreach ($ecommerceDetails as &$ecommerceConversion) { $sql = "SELECT log_action_sku.name as itemSKU, log_action_name.name as itemName, diff --git a/plugins/Login/Controller.php b/plugins/Login/Controller.php index 395c26d7b4..cce38665a6 100644 --- a/plugins/Login/Controller.php +++ b/plugins/Login/Controller.php @@ -430,7 +430,7 @@ class Controller extends \Piwik\Plugin\Controller * @param none * @return void */ - static public function clearSession() + public static function clearSession() { $authCookieName = Config::getInstance()->General['login_cookie_name']; $cookie = new Cookie($authCookieName); diff --git a/plugins/Login/Login.php b/plugins/Login/Login.php index e44486a24a..a805094df8 100644 --- a/plugins/Login/Login.php +++ b/plugins/Login/Login.php @@ -62,7 +62,7 @@ class Login extends \Piwik\Plugin \Piwik\Registry::get('auth')->setTokenAuth($tokenAuth); } - static protected function isModuleIsAPI() + protected static function isModuleIsAPI() { return Piwik::getModule() === 'API' && (Piwik::getAction() == '' || Piwik::getAction() == 'index'); diff --git a/plugins/MobileMessaging/API.php b/plugins/MobileMessaging/API.php index 51b14d851e..c8268c76a7 100644 --- a/plugins/MobileMessaging/API.php +++ b/plugins/MobileMessaging/API.php @@ -30,7 +30,7 @@ class API extends \Piwik\Plugin\API * @param string $provider * @return SMSProvider */ - static private function getSMSProviderInstance($provider) + private static function getSMSProviderInstance($provider) { return SMSProvider::factory($provider); } diff --git a/plugins/MobileMessaging/MobileMessaging.php b/plugins/MobileMessaging/MobileMessaging.php index fb53b75262..884ff9b63a 100644 --- a/plugins/MobileMessaging/MobileMessaging.php +++ b/plugins/MobileMessaging/MobileMessaging.php @@ -36,19 +36,19 @@ class MobileMessaging extends \Piwik\Plugin const MOBILE_TYPE = 'mobile'; const SMS_FORMAT = 'sms'; - static private $availableParameters = array( + private static $availableParameters = array( self::PHONE_NUMBERS_PARAMETER => true, ); - static private $managedReportTypes = array( + private static $managedReportTypes = array( self::MOBILE_TYPE => 'plugins/MobileMessaging/images/phone.png' ); - static private $managedReportFormats = array( + private static $managedReportFormats = array( self::SMS_FORMAT => 'plugins/MobileMessaging/images/phone.png' ); - static private $availableReports = array( + private static $availableReports = array( array( 'module' => 'MultiSites', 'action' => 'getAll', @@ -199,7 +199,7 @@ class MobileMessaging extends \Piwik\Plugin } } - static public function template_reportParametersScheduledReports(&$out) + public static function template_reportParametersScheduledReports(&$out) { if (Piwik::isUserIsAnonymous()) { return; diff --git a/plugins/MobileMessaging/SMSProvider.php b/plugins/MobileMessaging/SMSProvider.php index 9f470ef4d1..9bbf0758ed 100644 --- a/plugins/MobileMessaging/SMSProvider.php +++ b/plugins/MobileMessaging/SMSProvider.php @@ -23,7 +23,7 @@ abstract class SMSProvider const MAX_UCS2_CHARS_IN_ONE_UNIQUE_SMS = 70; const MAX_UCS2_CHARS_IN_ONE_CONCATENATED_SMS = 67; - static public $availableSMSProviders = array( + public static $availableSMSProviders = array( 'Clockwork' => 'You can use <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/"><img src="plugins/MobileMessaging/images/Clockwork.png"/></a> to send SMS Reports from Piwik.<br/> <ul> <li> First, <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/">get an API Key from Clockwork</a> (Signup is free!) @@ -45,7 +45,7 @@ abstract class SMSProvider * @param string $providerName * @return \Piwik\Plugins\MobileMessaging\SMSProvider */ - static public function factory($providerName) + public static function factory($providerName) { $className = __NAMESPACE__ . '\\SMSProvider\\' . $providerName; @@ -68,7 +68,7 @@ abstract class SMSProvider * @param string $string * @return bool true if $string contains UCS2 characters */ - static public function containsUCS2Characters($string) + public static function containsUCS2Characters($string) { $GSMCharsetAsString = implode(array_keys(GSMCharset::$GSMCharset)); @@ -90,7 +90,7 @@ abstract class SMSProvider * @param string $appendedString * @return string original $string or truncated $string appended with $appendedString */ - static public function truncate($string, $maximumNumberOfConcatenatedSMS, $appendedString = 'MobileMessaging_SMS_Content_Too_Long') + public static function truncate($string, $maximumNumberOfConcatenatedSMS, $appendedString = 'MobileMessaging_SMS_Content_Too_Long') { $appendedString = Piwik::translate($appendedString); @@ -117,12 +117,12 @@ abstract class SMSProvider return preg_replace('/' . preg_quote($subStrToTruncate, '/') . '$/', $appendedString, $string); } - static private function mb_str_split($string) + private static function mb_str_split($string) { return preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY); } - static private function sizeOfSMSContent($smsContent, $containsUCS2Chars) + private static function sizeOfSMSContent($smsContent, $containsUCS2Chars) { if ($containsUCS2Chars) return mb_strlen($smsContent, 'UTF-8'); @@ -133,7 +133,7 @@ abstract class SMSProvider return $sizeOfSMSContent; } - static private function maxCharsAllowed($maximumNumberOfConcatenatedSMS, $containsUCS2Chars) + private static function maxCharsAllowed($maximumNumberOfConcatenatedSMS, $containsUCS2Chars) { $maxCharsInOneUniqueSMS = $containsUCS2Chars ? self::MAX_UCS2_CHARS_IN_ONE_UNIQUE_SMS : self::MAX_GSM_CHARS_IN_ONE_UNIQUE_SMS; $maxCharsInOneConcatenatedSMS = $containsUCS2Chars ? self::MAX_UCS2_CHARS_IN_ONE_CONCATENATED_SMS : self::MAX_GSM_CHARS_IN_ONE_CONCATENATED_SMS; diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php index 37f3b73b0b..3095dce6aa 100755 --- a/plugins/MultiSites/API.php +++ b/plugins/MultiSites/API.php @@ -40,7 +40,7 @@ class API extends \Piwik\Plugin\API const ECOMMERCE_ORDERS_METRIC = 'orders'; const ECOMMERCE_REVENUE_METRIC = 'ecommerce_revenue'; - static private $baseMetrics = array( + private static $baseMetrics = array( self::NB_VISITS_METRIC => array( self::METRIC_TRANSLATION_KEY => 'General_ColumnNbVisits', self::METRIC_EVOLUTION_COL_NAME_KEY => 'visits_evolution', @@ -398,11 +398,6 @@ class API extends \Piwik\Plugin\API $this->setMetricsTotalsMetadata($table, $apiMetrics); } } else { - $revenueMetric = ''; - if (Common::isGoalPluginEnabled()) { - $revenueMetric = Archiver::getRecordName(self::GOAL_REVENUE_METRIC); - } - $totals = array(); foreach ($apiMetrics as $label => $metricInfo) { $totalMetadataName = self::getTotalMetadataName($label); diff --git a/plugins/Provider/Provider.php b/plugins/Provider/Provider.php index d98d0571b0..9c06887c1e 100644 --- a/plugins/Provider/Provider.php +++ b/plugins/Provider/Provider.php @@ -44,7 +44,7 @@ class Provider extends \Piwik\Plugin Piwik::addAction('Template.footerUserCountry', array('Piwik\Plugins\Provider\Provider', 'footerUserCountry')); } - static public function footerUserCountry(&$out) + public static function footerUserCountry(&$out) { $out = '<div> <h2>' . Piwik::translate('Provider_WidgetProviders') . '</h2>'; diff --git a/plugins/Proxy/Controller.php b/plugins/Proxy/Controller.php index 1b8d054481..3097c786b5 100644 --- a/plugins/Proxy/Controller.php +++ b/plugins/Proxy/Controller.php @@ -108,7 +108,7 @@ class Controller extends \Piwik\Plugin\Controller * @param string $url * @return bool True if valid; false otherwise */ - static public function isPiwikUrl($url) + public static function isPiwikUrl($url) { // guard for IE6 meta refresh parsing weakness (OSVDB 19029) if (strpos($url, ';') !== false diff --git a/plugins/Referrers/API.php b/plugins/Referrers/API.php index 9f97da3fe7..91fe2dbab2 100644 --- a/plugins/Referrers/API.php +++ b/plugins/Referrers/API.php @@ -151,7 +151,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function getKeywordNotDefinedString() + public static function getKeywordNotDefinedString() { return Piwik::translate('General_NotDefined', Piwik::translate('General_ColumnKeyword')); } @@ -159,7 +159,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function getCleanKeyword($label) + public static function getCleanKeyword($label) { return $label == self::LABEL_KEYWORD_NOT_DEFINED ? self::getKeywordNotDefinedString() @@ -452,7 +452,7 @@ class API extends \Piwik\Plugin\API $socialName = $row->getColumn('label'); $i = 1; // start at one because idSubtable=0 is equivalent to idSubtable=false - foreach (Common::getSocialUrls() as $domain => $name) { + foreach (Common::getSocialUrls() as $name) { if ($name == $socialName) { $row->c[Row::DATATABLE_ASSOCIATED] = $i; break; diff --git a/plugins/SEO/RankChecker.php b/plugins/SEO/RankChecker.php index 0a54ca63e7..88010814a1 100644 --- a/plugins/SEO/RankChecker.php +++ b/plugins/SEO/RankChecker.php @@ -38,7 +38,7 @@ class RankChecker * @param string $url * @return string */ - static public function extractDomainFromUrl($url) + public static function extractDomainFromUrl($url) { return preg_replace( array( diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php index 67ed97cc8f..4f09960119 100644 --- a/plugins/ScheduledReports/API.php +++ b/plugins/ScheduledReports/API.php @@ -729,7 +729,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function getReportMetadata($idSite, $reportType) + public static function getReportMetadata($idSite, $reportType) { $availableReportMetadata = array(); @@ -758,7 +758,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function allowMultipleReports($reportType) + public static function allowMultipleReports($reportType) { $allowMultipleReports = null; @@ -785,7 +785,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function getReportTypes() + public static function getReportTypes() { $reportTypes = array(); @@ -806,7 +806,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function getReportFormats($reportType) + public static function getReportFormats($reportType) { $reportFormats = array(); @@ -833,7 +833,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function getReportRecipients($report) + public static function getReportRecipients($report) { $recipients = array(); @@ -861,7 +861,7 @@ class API extends \Piwik\Plugin\API /** * @ignore */ - static public function getSegment($idSegment) + public static function getSegment($idSegment) { if (self::isSegmentEditorActivated() && !empty($idSegment)) { diff --git a/plugins/ScheduledReports/ScheduledReports.php b/plugins/ScheduledReports/ScheduledReports.php index 41d8306c10..776deea520 100644 --- a/plugins/ScheduledReports/ScheduledReports.php +++ b/plugins/ScheduledReports/ScheduledReports.php @@ -48,18 +48,18 @@ class ScheduledReports extends \Piwik\Plugin const EMAIL_TYPE = 'email'; - static private $availableParameters = array( + private static $availableParameters = array( self::EMAIL_ME_PARAMETER => false, self::EVOLUTION_GRAPH_PARAMETER => false, self::ADDITIONAL_EMAILS_PARAMETER => false, self::DISPLAY_FORMAT_PARAMETER => true, ); - static private $managedReportTypes = array( + private static $managedReportTypes = array( self::EMAIL_TYPE => 'plugins/Morpheus/images/email.png' ); - static private $managedReportFormats = array( + private static $managedReportFormats = array( ReportRenderer::HTML_FORMAT => 'plugins/Morpheus/images/html_icon.png', ReportRenderer::PDF_FORMAT => 'plugins/UserSettings/images/plugins/pdf.gif', ReportRenderer::CSV_FORMAT => 'plugins/Morpheus/images/export.png', @@ -153,7 +153,7 @@ class ScheduledReports extends \Piwik\Plugin } // based on http://www.php.net/manual/en/filter.filters.validate.php -> FILTER_VALIDATE_BOOLEAN - static private function valueIsTrue($value) + private static function valueIsTrue($value) { return $value == 'true' || $value == 1 || $value == '1' || $value === true; } @@ -447,7 +447,7 @@ class ScheduledReports extends \Piwik\Plugin } } - static public function template_reportParametersScheduledReports(&$out) + public static function template_reportParametersScheduledReports(&$out) { $view = new View('@ScheduledReports/reportParametersScheduledReports'); $view->currentUserEmail = Piwik::getCurrentUserEmail(); @@ -582,7 +582,7 @@ class ScheduledReports extends \Piwik\Plugin * Used in the Report Listing * @ignore */ - static public function getPeriodToFrequency() + public static function getPeriodToFrequency() { return array( ScheduledTime::PERIOD_NEVER => Piwik::translate('General_Never'), @@ -596,7 +596,7 @@ class ScheduledReports extends \Piwik\Plugin * Used in the Report's email content, ie "monthly report" * @ignore */ - static public function getPeriodToFrequencyAsAdjective() + public static function getPeriodToFrequencyAsAdjective() { return array( ScheduledTime::PERIOD_DAY => Piwik::translate('General_DailyReport'), diff --git a/plugins/SegmentEditor/SegmentSelectorControl.php b/plugins/SegmentEditor/SegmentSelectorControl.php index 9188a707db..bb58caa297 100644 --- a/plugins/SegmentEditor/SegmentSelectorControl.php +++ b/plugins/SegmentEditor/SegmentSelectorControl.php @@ -39,7 +39,7 @@ class SegmentSelectorControl extends UIControl $segments = APIMetadata::getInstance()->getSegmentsMetadata($this->idSite); - $segmentsByCategory = $customVariablesSegments = array(); + $segmentsByCategory = array(); foreach ($segments as $segment) { if ($segment['category'] == Piwik::translate('General_Visit') && ($segment['type'] == 'metric' && $segment['segment'] != 'visitIp') diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php index edd72bdb4c..82d12e3cee 100644 --- a/plugins/SitesManager/SitesManager.php +++ b/plugins/SitesManager/SitesManager.php @@ -171,7 +171,7 @@ class SitesManager extends \Piwik\Plugin * @param string $parameters The unfiltered list. * @return array The filtered list of strings as an array. */ - static private function filterBlankFromCommaSepList($parameters) + private static function filterBlankFromCommaSepList($parameters) { $parameters = explode(',', $parameters); $parameters = array_filter($parameters, 'strlen'); diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php index 0e65eff824..faeddf9f0b 100644 --- a/plugins/Transitions/API.php +++ b/plugins/Transitions/API.php @@ -128,7 +128,6 @@ class API extends \Piwik\Plugin\API */ private function deriveIdAction($actionName, $actionType) { - $actionsPlugin = new Actions; switch ($actionType) { case 'url': $originalActionName = $actionName; diff --git a/plugins/UserCountryMap/UserCountryMap.php b/plugins/UserCountryMap/UserCountryMap.php index 8bc5a93ff9..75df3df8c9 100644 --- a/plugins/UserCountryMap/UserCountryMap.php +++ b/plugins/UserCountryMap/UserCountryMap.php @@ -40,7 +40,7 @@ class UserCountryMap extends \Piwik\Plugin Piwik::addAction('Template.leftColumnUserCountry', array('Piwik\Plugins\UserCountryMap\UserCountryMap', 'insertMapInLocationReport')); } - static public function insertMapInLocationReport(&$out) + public static function insertMapInLocationReport(&$out) { $out = '<h2>' . Piwik::translate('UserCountryMap_VisitorMap') . '</h2>'; $out .= FrontController::getInstance()->fetchDispatch('UserCountryMap', 'visitorMap'); diff --git a/plugins/UserSettings/UserSettings.php b/plugins/UserSettings/UserSettings.php index 69f9b6519e..86bd119d13 100644 --- a/plugins/UserSettings/UserSettings.php +++ b/plugins/UserSettings/UserSettings.php @@ -22,7 +22,7 @@ class UserSettings extends \Piwik\Plugin * * @type array */ - static public $browserType_display = array( + public static $browserType_display = array( 'ie' => 'Trident (IE)', 'gecko' => 'Gecko (Firefox)', 'khtml' => 'KHTML (Konqueror)', diff --git a/plugins/UsersManager/API.php b/plugins/UsersManager/API.php index 15c8af8bb4..3fff901c38 100644 --- a/plugins/UsersManager/API.php +++ b/plugins/UsersManager/API.php @@ -40,7 +40,7 @@ class API extends \Piwik\Plugin\API const PREFERENCE_DEFAULT_REPORT = 'defaultReport'; const PREFERENCE_DEFAULT_REPORT_DATE = 'defaultReportDate'; - static private $instance = null; + private static $instance = null; protected function __construct() { @@ -57,7 +57,7 @@ class API extends \Piwik\Plugin\API * @throws Exception * @return \Piwik\Plugins\UsersManager\API */ - static public function getInstance() + public static function getInstance() { try { $instance = \Piwik\Registry::get('UsersManager_API'); diff --git a/plugins/UsersManager/LastSeenTimeLogger.php b/plugins/UsersManager/LastSeenTimeLogger.php index 61e6c8b130..a89ebd0018 100644 --- a/plugins/UsersManager/LastSeenTimeLogger.php +++ b/plugins/UsersManager/LastSeenTimeLogger.php @@ -35,7 +35,6 @@ class LastSeenTimeLogger public function logCurrentUserLastSeenTime() { $module = Common::getRequestVar('module', false); - $action = Common::getRequestVar('action', false); $currentUserLogin = Piwik::getCurrentUserLogin(); // only log time for non-anonymous visits to the reporting UI diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php index 3a38f40c18..70f5c48e4f 100644 --- a/plugins/VisitorInterest/VisitorInterest.php +++ b/plugins/VisitorInterest/VisitorInterest.php @@ -27,12 +27,12 @@ class VisitorInterest extends \Piwik\Plugin Piwik::addAction('Template.footerVisitsFrequency', array('Piwik\Plugins\VisitorInterest\VisitorInterest', 'footerVisitsFrequency')); } - static public function headerVisitsFrequency(&$out) + public static function headerVisitsFrequency(&$out) { $out = '<div id="leftcolumn">'; } - static public function footerVisitsFrequency(&$out) + public static function footerVisitsFrequency(&$out) { $out = '</div> <div id="rightcolumn"> diff --git a/plugins/VisitsSummary/Controller.php b/plugins/VisitsSummary/Controller.php index 44c1565b27..1804ebea54 100644 --- a/plugins/VisitsSummary/Controller.php +++ b/plugins/VisitsSummary/Controller.php @@ -100,7 +100,7 @@ class Controller extends \Piwik\Plugin\Controller return $this->renderView($view); } - static public function getVisitsSummary() + public static function getVisitsSummary() { $requestString = "method=VisitsSummary.get" . "&format=original" . @@ -112,7 +112,7 @@ class Controller extends \Piwik\Plugin\Controller return empty($result) ? new DataTable() : $result; } - static public function getVisits() + public static function getVisits() { $requestString = "method=VisitsSummary.getVisits" . "&format=original" . |