diff --git a/plugins/Dashboard/Model.php b/plugins/Dashboard/Model.php index 363052f3dd3..31feeb609bb 100644 --- a/plugins/Dashboard/Model.php +++ b/plugins/Dashboard/Model.php @@ -33,8 +33,10 @@ public function __construct() */ public function getLayoutForUser($login, $idDashboard) { - $query = sprintf('SELECT layout FROM %s WHERE login = ? AND iddashboard = ?', - $this->table); + $query = sprintf( + 'SELECT layout FROM %s WHERE login = ? AND iddashboard = ?', + $this->table + ); $bind = array($login, $idDashboard); $layouts = Db::fetchAll($query, $bind); @@ -98,8 +100,10 @@ public function createNewDashboardForUser($login, $name, $layout) public function createOrUpdateDashboard($login, $idDashboard, $layout) { $bind = array($login, $idDashboard, $layout, $layout); - $query = sprintf('INSERT INTO %s (login, iddashboard, layout) VALUES (?,?,?) ON DUPLICATE KEY UPDATE layout=?', - $this->table); + $query = sprintf( + 'INSERT INTO %s (login, iddashboard, layout) VALUES (?,?,?) ON DUPLICATE KEY UPDATE layout=?', + $this->table + ); Db::query($query, $bind); } @@ -125,8 +129,10 @@ private function getNextIdDashboard($login) public function updateLayoutForUser($login, $idDashboard, $layout) { $bind = array($login, $idDashboard, $layout, $layout); - $query = sprintf('INSERT INTO %s (login, iddashboard, layout) VALUES (?,?,?) ON DUPLICATE KEY UPDATE layout=?', - $this->table); + $query = sprintf( + 'INSERT INTO %s (login, iddashboard, layout) VALUES (?,?,?) ON DUPLICATE KEY UPDATE layout=?', + $this->table + ); Db::query($query, $bind); } diff --git a/plugins/DevicesDetection/Columns/Os.php b/plugins/DevicesDetection/Columns/Os.php index 2380ecc0a73..d06b55df3be 100644 --- a/plugins/DevicesDetection/Columns/Os.php +++ b/plugins/DevicesDetection/Columns/Os.php @@ -54,8 +54,12 @@ public function configureSegments(SegmentsList $segmentsList, DimensionSegmentFa return $result; }); $segment->setSuggestedValuesCallback(function ($idSite, $maxValuesToReturn, $table) { - return $this->sortStaticListByUsage(OperatingSystem::getAvailableOperatingSystems(), $table, - 'operatingSystemCode', $maxValuesToReturn); + return $this->sortStaticListByUsage( + OperatingSystem::getAvailableOperatingSystems(), + $table, + 'operatingSystemCode', + $maxValuesToReturn + ); }); $segmentsList->addSegment($dimensionSegmentFactory->createSegment($segment)); } diff --git a/plugins/DevicesDetection/Menu.php b/plugins/DevicesDetection/Menu.php index a7b3055b249..fd1c58245c4 100644 --- a/plugins/DevicesDetection/Menu.php +++ b/plugins/DevicesDetection/Menu.php @@ -18,9 +18,11 @@ class Menu extends \Piwik\Plugin\Menu public function configureAdminMenu(MenuAdmin $menu) { if (Piwik::isUserHasSomeAdminAccess()) { - $menu->addDiagnosticItem('DevicesDetection_DeviceDetection', - $this->urlForAction('detection'), - $order = 40); + $menu->addDiagnosticItem( + 'DevicesDetection_DeviceDetection', + $this->urlForAction('detection'), + $order = 40 + ); } } } diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php index 0eb37969981..23a32606e23 100644 --- a/plugins/DevicesDetection/functions.php +++ b/plugins/DevicesDetection/functions.php @@ -331,9 +331,9 @@ function _mapLegacyOsShortCodes($shortCode): string //'VMS' => '', // OpenVMS => ?? ]; return ($shortCode && array_key_exists( - $shortCode, - $legacyShortCodes - )) ? $legacyShortCodes[$shortCode] : (string)$shortCode; + $shortCode, + $legacyShortCodes + )) ? $legacyShortCodes[$shortCode] : (string)$shortCode; } /** diff --git a/plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php b/plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php index d1b679b4a5d..e3be660ad8b 100644 --- a/plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php +++ b/plugins/DevicesDetection/tests/Fixtures/MultiDeviceGoalConversions.php @@ -41,8 +41,14 @@ private function setUpWebsitesAndGoals() if (!self::goalExists($idSite = 1, $idGoal = 1)) { API::getInstance()->addGoal( - $this->idSite, 'Goal 1 - Thank you', 'title', 'Thank you', 'contains', $caseSensitive = false, - $revenue = 10, $allowMultipleConversions = 1 + $this->idSite, + 'Goal 1 - Thank you', + 'title', + 'Thank you', + 'contains', + $caseSensitive = false, + $revenue = 10, + $allowMultipleConversions = 1 ); } } diff --git a/plugins/Diagnostics/Commands/ArchivingConfig.php b/plugins/Diagnostics/Commands/ArchivingConfig.php index ae6e4000a00..dc43c25529f 100644 --- a/plugins/Diagnostics/Commands/ArchivingConfig.php +++ b/plugins/Diagnostics/Commands/ArchivingConfig.php @@ -21,8 +21,11 @@ class ArchivingConfig extends ConsoleCommand protected function configure() { $this->setName('diagnostics:archiving-config'); - $this->addNoValueOption('json', null, - "If supplied, the command will return data in json format"); + $this->addNoValueOption( + 'json', + null, + "If supplied, the command will return data in json format" + ); $this->setDescription('Show configuration settings that can affect archiving performance'); } diff --git a/plugins/Diagnostics/Commands/ArchivingInstanceStatistics.php b/plugins/Diagnostics/Commands/ArchivingInstanceStatistics.php index 848a1e42267..5e47cfc5bd9 100644 --- a/plugins/Diagnostics/Commands/ArchivingInstanceStatistics.php +++ b/plugins/Diagnostics/Commands/ArchivingInstanceStatistics.php @@ -21,8 +21,11 @@ class ArchivingInstanceStatistics extends ConsoleCommand protected function configure() { $this->setName('diagnostics:archiving-instance-statistics'); - $this->addNoValueOption('json', null, - "If supplied, the command will return data in json format"); + $this->addNoValueOption( + 'json', + null, + "If supplied, the command will return data in json format" + ); $this->setDescription('Show data statistics which can affect archiving performance'); } @@ -59,14 +62,16 @@ public function getArchivingInstanceStatistics(): array [ Date::now()->setDay(1)->subMonth(1)->setTime('00:00:00')->toString('Y-m-d H:i:s'), Date::now()->setDay(1)->subDay(1)->setTime('23:59:59')->toString('Y-m-d H:i:s') - ]) + ] + ) ]; $stats[] = ['Last 12 Month Hits', (int) Db::fetchOne( "SELECT COUNT(*) FROM " . Common::prefixTable("log_link_visit_action") . " WHERE server_time >= ? AND server_time <= ?", [ Date::now()->setDay(1)->subMonth(12)->setTime('00:00:00')->toString('Y-m-d H:i:s'), Date::now()->setDay(1)->subDay(1)->setTime('23:59:59')->toString('Y-m-d H:i:s') - ]) + ] + ) ]; return $stats; } diff --git a/plugins/Diagnostics/Commands/ArchivingMetrics.php b/plugins/Diagnostics/Commands/ArchivingMetrics.php index d11024807f4..2d848c5e685 100644 --- a/plugins/Diagnostics/Commands/ArchivingMetrics.php +++ b/plugins/Diagnostics/Commands/ArchivingMetrics.php @@ -21,8 +21,11 @@ class ArchivingMetrics extends ConsoleCommand protected function configure() { $this->setName('diagnostics:archiving-metrics'); - $this->addNoValueOption('json', null, - "If supplied, the command will return data in json format"); + $this->addNoValueOption( + 'json', + null, + "If supplied, the command will return data in json format" + ); $this->setDescription('Show metrics describing the current archiving status'); } diff --git a/plugins/Diagnostics/Commands/ArchivingQueue.php b/plugins/Diagnostics/Commands/ArchivingQueue.php index 732ed4f79f8..d3169fe2381 100644 --- a/plugins/Diagnostics/Commands/ArchivingQueue.php +++ b/plugins/Diagnostics/Commands/ArchivingQueue.php @@ -19,8 +19,11 @@ class ArchivingQueue extends ConsoleCommand protected function configure() { $this->setName('diagnostics:archiving-queue'); - $this->addNoValueOption('json', null, - "If supplied, the command will return table data in json format"); + $this->addNoValueOption( + 'json', + null, + "If supplied, the command will return table data in json format" + ); $this->setDescription('Show the current state of the archive invalidations queue as a table'); } diff --git a/plugins/Diagnostics/Commands/ArchivingStatus.php b/plugins/Diagnostics/Commands/ArchivingStatus.php index f21758301b2..e8f2263b184 100644 --- a/plugins/Diagnostics/Commands/ArchivingStatus.php +++ b/plugins/Diagnostics/Commands/ArchivingStatus.php @@ -22,10 +22,16 @@ class ArchivingStatus extends ConsoleCommand protected function configure() { $this->setName('diagnostics:archiving-status'); - $this->addNoValueOption('with-stats', null, - "If supplied, the command will include instance statistics such as monthly hits and site count"); - $this->addOptionalValueOption('email', null, - "If supplied, the command will email the output to the supplied email address"); + $this->addNoValueOption( + 'with-stats', + null, + "If supplied, the command will include instance statistics such as monthly hits and site count" + ); + $this->addOptionalValueOption( + 'email', + null, + "If supplied, the command will email the output to the supplied email address" + ); $this->setDescription(''); } diff --git a/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php b/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php index 36add393ae2..2a04ea6ceb3 100644 --- a/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php +++ b/plugins/Diagnostics/Diagnostic/CronArchivingCheck.php @@ -75,8 +75,10 @@ public function execute() $comment .= $this->translator->translate('Installation_NotSupported') . ' ' . $this->translator->translate('Goals_Optional') . ' (' . $this->translator->translate('General_Reasons') . ': ' . $reasonText . ')' - . $this->translator->translate('General_LearnMore', - [' ', '']); + . $this->translator->translate( + 'General_LearnMore', + [' ', ''] + ); $status = DiagnosticResult::STATUS_INFORMATIONAL; } diff --git a/plugins/Diagnostics/Diagnostic/CronArchivingLastRunCheck.php b/plugins/Diagnostics/Diagnostic/CronArchivingLastRunCheck.php index 6999de817f5..a633bdce054 100644 --- a/plugins/Diagnostics/Diagnostic/CronArchivingLastRunCheck.php +++ b/plugins/Diagnostics/Diagnostic/CronArchivingLastRunCheck.php @@ -57,8 +57,10 @@ public function execute() $lastRunTime = (int)Option::get(CronArchive::OPTION_ARCHIVING_FINISHED_TS); if (empty($lastRunTime)) { $comment = $this->translator->translate('Diagnostics_CronArchivingHasNotRun') - . '

' . $this->translator->translate('Diagnostics_CronArchivingRunDetails', - [$coreArchiveShort, $mailto, $commandToRerun, '', '']); + . '

' . $this->translator->translate( + 'Diagnostics_CronArchivingRunDetails', + [$coreArchiveShort, $mailto, $commandToRerun, '', ''] + ); return [DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_ERROR, $comment)]; } diff --git a/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php b/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php index f683c04c8f9..d47dfa3a3ff 100644 --- a/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php +++ b/plugins/Diagnostics/Diagnostic/DatabaseAbilitiesCheck.php @@ -62,7 +62,8 @@ protected function checkUtf8mb4Charset() if (DbHelper::getDefaultCharset() === 'utf8mb4') { return new DiagnosticResultItem( - DiagnosticResult::STATUS_WARNING, 'UTF8mb4 charset

' . + DiagnosticResult::STATUS_WARNING, + 'UTF8mb4 charset

' . $this->translator->translate('Diagnostics_DatabaseUtf8mb4CharsetAvailableButNotUsed', '' . PIWIK_INCLUDE_PATH . '/console core:convert-to-utf8mb4') . '

' . $this->translator->translate('Diagnostics_DatabaseUtf8Requirement', ['�', @@ -72,7 +73,8 @@ protected function checkUtf8mb4Charset() } return new DiagnosticResultItem( - DiagnosticResult::STATUS_WARNING, 'UTF8mb4 charset

' . + DiagnosticResult::STATUS_WARNING, + 'UTF8mb4 charset

' . $this->translator->translate('Diagnostics_DatabaseUtf8mb4CharsetRecommended') . '

' . $this->translator->translate('Diagnostics_DatabaseUtf8Requirement', ['�', diff --git a/plugins/Diagnostics/Diagnostic/DbMaxPacket.php b/plugins/Diagnostics/Diagnostic/DbMaxPacket.php index 6fe71aaf197..cc0ca14da89 100644 --- a/plugins/Diagnostics/Diagnostic/DbMaxPacket.php +++ b/plugins/Diagnostics/Diagnostic/DbMaxPacket.php @@ -43,9 +43,13 @@ public function execute() $formatter = new Formatter\Html(); $pretty = $formatter->getPrettySizeFromBytes($maxPacketBytes['Value'], 'M', $precision = 1); $configured = str_replace(array(' M', ' M'), 'MB', $pretty); - $comment = Piwik::translate('Diagnostics_MysqlMaxPacketSizeWarning', + $comment = Piwik::translate( + 'Diagnostics_MysqlMaxPacketSizeWarning', ['', - '', '64MB', $configured]); + '', + '64MB', + $configured] + ); } return array(DiagnosticResult::singleResult($label, $status, $comment)); diff --git a/plugins/Diagnostics/Diagnostic/RecommendedPrivateDirectories.php b/plugins/Diagnostics/Diagnostic/RecommendedPrivateDirectories.php index 0e4640e0550..bbe26edfffc 100644 --- a/plugins/Diagnostics/Diagnostic/RecommendedPrivateDirectories.php +++ b/plugins/Diagnostics/Diagnostic/RecommendedPrivateDirectories.php @@ -26,11 +26,13 @@ public function __construct(Translator $translator) protected function addError(DiagnosticResult &$result) { - $result->addItem(new DiagnosticResultItem(DiagnosticResult::STATUS_INFORMATIONAL, + $result->addItem(new DiagnosticResultItem( + DiagnosticResult::STATUS_INFORMATIONAL, $this->translator->translate('Diagnostics_UrlsAccessibleViaBrowser') . ' ' . $this->translator->translate('General_ReadThisToLearnMore', [ '', '', - ]))); + ]) + )); } } diff --git a/plugins/Ecommerce/Reports/BaseItem.php b/plugins/Ecommerce/Reports/BaseItem.php index 407ac4e1a18..31bebd385ea 100644 --- a/plugins/Ecommerce/Reports/BaseItem.php +++ b/plugins/Ecommerce/Reports/BaseItem.php @@ -50,8 +50,10 @@ public function getMetricsDocumentation() // we do not check whether it is abandon carts if not set re performance improvements if ($this->isAbandonedCart($fetchIfNotSet = false)) { return array( - 'revenue' => Piwik::translate('Goals_ColumnRevenueDocumentation', - Piwik::translate('Goals_DocumentationRevenueGeneratedByProductSales')), + 'revenue' => Piwik::translate( + 'Goals_ColumnRevenueDocumentation', + Piwik::translate('Goals_DocumentationRevenueGeneratedByProductSales') + ), 'quantity' => Piwik::translate('Goals_ColumnQuantityDocumentation', $this->name), 'orders' => Piwik::translate('Goals_ColumnOrdersDocumentation', $this->name), 'avg_price' => Piwik::translate('Goals_ColumnAveragePriceDocumentation', $this->name), diff --git a/plugins/Ecommerce/Tracker/EcommerceRequestProcessor.php b/plugins/Ecommerce/Tracker/EcommerceRequestProcessor.php index 2bca4163d08..f5e283d2c7f 100644 --- a/plugins/Ecommerce/Tracker/EcommerceRequestProcessor.php +++ b/plugins/Ecommerce/Tracker/EcommerceRequestProcessor.php @@ -68,7 +68,8 @@ public function afterRequestProcessed(VisitProperties $visitProperties, Request $goalsConverted = $request->getMetadata('Goals', 'goalsConverted'); if (!empty($goalsConverted)) { $isThereExistingCartInVisit = $this->goalManager->detectIsThereExistingCartInVisit( - $visitProperties->getProperties()); + $visitProperties->getProperties() + ); $request->setMetadata('Goals', 'isThereExistingCartInVisit', $isThereExistingCartInVisit); } } diff --git a/plugins/Ecommerce/VisitorDetails.php b/plugins/Ecommerce/VisitorDetails.php index e4640cc3c58..30bef067166 100644 --- a/plugins/Ecommerce/VisitorDetails.php +++ b/plugins/Ecommerce/VisitorDetails.php @@ -33,8 +33,10 @@ public function extendVisitorDetails(&$visitor) { if(Site::isEcommerceEnabledFor($visitor['idSite'])) { - $ecommerceMetrics = $this->queryEcommerceConversionsVisitorLifeTimeMetricsForVisitor($visitor['idSite'], - $visitor['visitorId']); + $ecommerceMetrics = $this->queryEcommerceConversionsVisitorLifeTimeMetricsForVisitor( + $visitor['idSite'], + $visitor['visitorId'] + ); $visitor['totalEcommerceRevenue'] = $ecommerceMetrics['totalEcommerceRevenue']; $visitor['totalEcommerceConversions'] = $ecommerceMetrics['totalEcommerceConversions']; $visitor['totalEcommerceItems'] = $ecommerceMetrics['totalEcommerceItems']; diff --git a/plugins/Ecommerce/tests/Fixtures/AbandonedCartWithoutConversions.php b/plugins/Ecommerce/tests/Fixtures/AbandonedCartWithoutConversions.php index ff0905af295..876a024014c 100644 --- a/plugins/Ecommerce/tests/Fixtures/AbandonedCartWithoutConversions.php +++ b/plugins/Ecommerce/tests/Fixtures/AbandonedCartWithoutConversions.php @@ -34,8 +34,14 @@ private function setUpWebsitesAndGoals() if (!self::goalExists($this->idSite, $this->idGoalStandard)) { GoalsAPI::getInstance()->addGoal( - $this->idSite, 'title match, triggered NEVER', 'title', 'saldkfjaslkdfjsalkdjf', 'contains', - $caseSensitive = false, $revenue = 10, $allowMultipleConversions = true + $this->idSite, + 'title match, triggered NEVER', + 'title', + 'saldkfjaslkdfjsalkdjf', + 'contains', + $caseSensitive = false, + $revenue = 10, + $allowMultipleConversions = true ); } } diff --git a/plugins/ExampleLogTables/Dao/CustomGroupLog.php b/plugins/ExampleLogTables/Dao/CustomGroupLog.php index d0a59291fd7..f195112b33f 100644 --- a/plugins/ExampleLogTables/Dao/CustomGroupLog.php +++ b/plugins/ExampleLogTables/Dao/CustomGroupLog.php @@ -55,8 +55,12 @@ public function addGroupInformation($group, $isAdmin) $bind = array_values($columns); $placeholder = Common::getSqlStringFieldsArray($columns); - $sql = sprintf('INSERT INTO %s (`%s`) VALUES(%s)', - $this->tablePrefixed, implode('`,`', array_keys($columns)), $placeholder); + $sql = sprintf( + 'INSERT INTO %s (`%s`) VALUES(%s)', + $this->tablePrefixed, + implode('`,`', array_keys($columns)), + $placeholder + ); $db = $this->getDb(); diff --git a/plugins/ExampleLogTables/Dao/CustomUserLog.php b/plugins/ExampleLogTables/Dao/CustomUserLog.php index e6e51153a54..85b1f210879 100644 --- a/plugins/ExampleLogTables/Dao/CustomUserLog.php +++ b/plugins/ExampleLogTables/Dao/CustomUserLog.php @@ -57,8 +57,12 @@ public function addUserInformation($userId, $group, $gender) $bind = array_values($columns); $placeholder = Common::getSqlStringFieldsArray($columns); - $sql = sprintf('INSERT INTO %s (`%s`) VALUES(%s)', - $this->tablePrefixed, implode('`,`', array_keys($columns)), $placeholder); + $sql = sprintf( + 'INSERT INTO %s (`%s`) VALUES(%s)', + $this->tablePrefixed, + implode('`,`', array_keys($columns)), + $placeholder + ); $db = $this->getDb(); diff --git a/plugins/Feedback/API.php b/plugins/Feedback/API.php index 67e0cc0df25..270d2260b56 100644 --- a/plugins/Feedback/API.php +++ b/plugins/Feedback/API.php @@ -58,7 +58,8 @@ public function sendFeedbackForFeature($featureName, $like = null, $choice = nul $body .= sprintf("Feedback:\n%s\n", trim($message)); - $subject = sprintf("%s for %s", + $subject = sprintf( + "%s for %s", empty($like) ? "-1" : "+1", $featureName ); @@ -106,10 +107,11 @@ public function sendFeedbackForSurvey($question, $message = false) $body .= $feedbackMessage ? $feedbackMessage : " \n"; - $subject = sprintf("%s for %s %s", - empty($like) ? "-1" : "+1", - $featureName, - empty($feedbackMessage) ? "" : "(w/ feedback Survey)" + $subject = sprintf( + "%s for %s %s", + empty($like) ? "-1" : "+1", + $featureName, + empty($feedbackMessage) ? "" : "(w/ feedback Survey)" ); $this->sendMail($subject, $body); diff --git a/plugins/Feedback/tests/Integration/FeedbackTest.php b/plugins/Feedback/tests/Integration/FeedbackTest.php index 3a75112265e..ba48c2626b3 100644 --- a/plugins/Feedback/tests/Integration/FeedbackTest.php +++ b/plugins/Feedback/tests/Integration/FeedbackTest.php @@ -37,17 +37,17 @@ public function setUp(): void $this->userModel = new Model(); $this->userModel->addUser( - 'user1', - 'a98732d98732', - 'user1@example.com', - '2019-03-03' + 'user1', + 'a98732d98732', + 'user1@example.com', + '2019-03-03' ); $this->userModel->addUser( - 'user2', - 'a98732d98732', - 'user2@example.com', - Date('Y-m-d') + 'user2', + 'a98732d98732', + 'user2@example.com', + Date('Y-m-d') ); FakeAccess::$identity = 'user1'; FakeAccess::$superUser = false; diff --git a/plugins/GeoIp2/Commands/ConvertRegionCodesToIso.php b/plugins/GeoIp2/Commands/ConvertRegionCodesToIso.php index be003f7935a..15436bd37f8 100644 --- a/plugins/GeoIp2/Commands/ConvertRegionCodesToIso.php +++ b/plugins/GeoIp2/Commands/ConvertRegionCodesToIso.php @@ -51,11 +51,13 @@ protected function doExecute(): int Db::query('DROP table if exists ' . self::MAPPING_TABLE_NAME); - DbHelper::createTable(self::MAPPING_TABLE_NAME, + DbHelper::createTable( + self::MAPPING_TABLE_NAME, "`country_code` VARCHAR(2) NOT NULL, `fips_code` VARCHAR(2) NOT NULL, `iso_code` VARCHAR(4) NULL DEFAULT NULL, - PRIMARY KEY (`country_code`, `fips_code`)"); + PRIMARY KEY (`country_code`, `fips_code`)" + ); $output->writeln(' ✓'); diff --git a/plugins/GeoIp2/Controller.php b/plugins/GeoIp2/Controller.php index 9a66c885bbf..e908e9a3bb0 100644 --- a/plugins/GeoIp2/Controller.php +++ b/plugins/GeoIp2/Controller.php @@ -150,7 +150,10 @@ public function downloadMissingGeoIpDb() // download part of the file $result = Http::downloadChunk( - $url, $outputPath, Common::getRequestVar('continue', true, 'int')); + $url, + $outputPath, + Common::getRequestVar('continue', true, 'int') + ); // if the file is done if ($result['current_size'] >= $result['expected_file_size']) { diff --git a/plugins/GeoIp2/GeoIP2AutoUpdater.php b/plugins/GeoIp2/GeoIP2AutoUpdater.php index b4129c9e11d..e33fc735ca3 100644 --- a/plugins/GeoIp2/GeoIP2AutoUpdater.php +++ b/plugins/GeoIp2/GeoIP2AutoUpdater.php @@ -232,8 +232,10 @@ public static function unzipDownloadedFile($path, $dbType, $url, $unlink = false $content = $unzip->listContent(); if (empty($content)) { - throw new Exception(Piwik::translate('GeoIp2_CannotListContent', - array("'$path'", $unzip->errorInfo()))); + throw new Exception(Piwik::translate( + 'GeoIp2_CannotListContent', + array("'$path'", $unzip->errorInfo()) + )); } $fileToExtract = null; @@ -249,16 +251,20 @@ public static function unzipDownloadedFile($path, $dbType, $url, $unlink = false } if ($fileToExtract === null) { - throw new Exception(Piwik::translate('GeoIp2_CannotFindGeoIPDatabaseInArchive', - array("'$path'"))); + throw new Exception(Piwik::translate( + 'GeoIp2_CannotFindGeoIPDatabaseInArchive', + array("'$path'") + )); } // extract JUST the .dat file $unzipped = $unzip->extractInString($fileToExtract); if (empty($unzipped)) { - throw new Exception(Piwik::translate('GeoIp2_CannotUnzipGeoIPFile', - array("'$path'", $unzip->errorInfo()))); + throw new Exception(Piwik::translate( + 'GeoIp2_CannotUnzipGeoIPFile', + array("'$path'", $unzip->errorInfo()) + )); } $dbFilename = basename($fileToExtract); @@ -285,8 +291,10 @@ public static function unzipDownloadedFile($path, $dbType, $url, $unlink = false $success = $unzip->extract($outputPath); if ($success !== true) { - throw new Exception(Piwik::translate('General_CannotUnzipFile', - array("'$path'", $unzip->errorInfo()))); + throw new Exception(Piwik::translate( + 'General_CannotUnzipFile', + array("'$path'", $unzip->errorInfo()) + )); } if ($isDbIpUnknownDbType) { @@ -578,7 +586,8 @@ public static function getMissingDatabases() // if a database of the type does not exist, but there's a url to update, then // a database is missing $path = LocationProviderGeoIp2::getPathToGeoIpDatabase( - LocationProviderGeoIp2::$dbNames[$key]); + LocationProviderGeoIp2::$dbNames[$key] + ); if ($path === false) { $result[] = $key; } diff --git a/plugins/GeoIp2/GeoIp2.php b/plugins/GeoIp2/GeoIp2.php index 273cffeacdd..4eb29a052c1 100644 --- a/plugins/GeoIp2/GeoIp2.php +++ b/plugins/GeoIp2/GeoIp2.php @@ -82,7 +82,10 @@ public function getClientSideTranslationKeys(&$translationKeys) */ public function installationFormInit(FormDefaultSettings $form) { - $form->addElement('checkbox', 'setup_geoip2', null, + $form->addElement( + 'checkbox', + 'setup_geoip2', + null, [ 'content' => '
' . Piwik::translate('GeoIp2_AutomaticSetupDescription', ['','']) . '
  ' . Piwik::translate('GeoIp2_AutomaticSetup') ] @@ -116,8 +119,11 @@ public function installationFormSubmit(FormDefaultSettings $form) // otherwise ensure it will be run soonish as scheduled task if ($cliMulti->supportsAsync()) { $phpCli = new CliMulti\CliPhp(); - $command = sprintf('%s %s/console core:run-scheduled-tasks --force "Piwik\Plugins\GeoIp2\GeoIP2AutoUpdater.update" > /dev/null 2>&1 &', - $phpCli->findPhpBinary(), PIWIK_INCLUDE_PATH); + $command = sprintf( + '%s %s/console core:run-scheduled-tasks --force "Piwik\Plugins\GeoIp2\GeoIP2AutoUpdater.update" > /dev/null 2>&1 &', + $phpCli->findPhpBinary(), + PIWIK_INCLUDE_PATH + ); shell_exec($command); } else { /** @var Scheduler $scheduler */ diff --git a/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php b/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php index 1841c12cd52..03baef50c1d 100644 --- a/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php +++ b/plugins/GeoIp2/LocationProvider/GeoIp2/Php.php @@ -432,8 +432,10 @@ public function getInfo() $desc = Piwik::translate('GeoIp2_LocationProviderDesc_Php') . '

'; if (extension_loaded('maxminddb')) { - $desc .= Piwik::translate('GeoIp2_LocationProviderDesc_Php_WithExtension', - array('', '')); + $desc .= Piwik::translate( + 'GeoIp2_LocationProviderDesc_Php_WithExtension', + array('', '') + ); } $installDocs = '' diff --git a/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php b/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php index 07658e43556..16a7721a95a 100644 --- a/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php +++ b/plugins/GeoIp2/LocationProvider/GeoIp2/ServerModule.php @@ -220,8 +220,10 @@ public function getInfo() . '

' . Piwik::translate('GeoIp2_GeoIPLocationProviderDesc_ServerBasedAnonWarn') . '

' - . Piwik::translate('GeoIp2_LocationProviderDesc_ServerModule2', - array('', '', '', '')); + . Piwik::translate( + 'GeoIp2_LocationProviderDesc_ServerModule2', + array('', '', '', '') + ); $installDocs = '
' diff --git a/plugins/Goals/API.php b/plugins/Goals/API.php index 6c0c12df7ff..7cc4fb10628 100644 --- a/plugins/Goals/API.php +++ b/plugins/Goals/API.php @@ -541,8 +541,10 @@ public function get($idSite, $period, $date, $segment = false, $idGoal = false, } finally { \Piwik\Plugin\Archiver::$ARCHIVE_DEPENDENT = $startingArchiveDependent; } - $tableSegmented->filter('Piwik\Plugins\Goals\DataTable\Filter\AppendNameToColumnNames', - array($appendToMetricName)); + $tableSegmented->filter( + 'Piwik\Plugins\Goals\DataTable\Filter\AppendNameToColumnNames', + array($appendToMetricName) + ); if (!isset($table)) { $table = $tableSegmented; @@ -779,11 +781,19 @@ protected function getGoalSpecificDataTable($recordName, $idSite, $period, $date public function getDaysToConversion($idSite, $period, $date, $segment = false, $idGoal = false) { $dataTable = $this->getGoalSpecificDataTable( - Archiver::DAYS_UNTIL_CONV_RECORD_NAME, $idSite, $period, $date, $segment, $idGoal); + Archiver::DAYS_UNTIL_CONV_RECORD_NAME, + $idSite, + $period, + $date, + $segment, + $idGoal + ); $dataTable->queueFilter('Sort', array('label', 'asc', true, false)); $dataTable->queueFilter( - 'BeautifyRangeLabels', array(Piwik::translate('Intl_OneDay'), Piwik::translate('Intl_NDays'))); + 'BeautifyRangeLabels', + array(Piwik::translate('Intl_OneDay'), Piwik::translate('Intl_NDays')) + ); return $dataTable; } @@ -804,11 +814,19 @@ public function getDaysToConversion($idSite, $period, $date, $segment = false, $ public function getVisitsUntilConversion($idSite, $period, $date, $segment = false, $idGoal = false) { $dataTable = $this->getGoalSpecificDataTable( - Archiver::VISITS_UNTIL_RECORD_NAME, $idSite, $period, $date, $segment, $idGoal); + Archiver::VISITS_UNTIL_RECORD_NAME, + $idSite, + $period, + $date, + $segment, + $idGoal + ); $dataTable->queueFilter('Sort', array('label', 'asc', true, false)); $dataTable->queueFilter( - 'BeautifyRangeLabels', array(Piwik::translate('General_OneVisit'), Piwik::translate('General_NVisits'))); + 'BeautifyRangeLabels', + array(Piwik::translate('General_OneVisit'), Piwik::translate('General_NVisits')) + ); return $dataTable; } @@ -830,8 +848,14 @@ protected function enrichItemsTableWithViewMetrics($dataTable, $recordName, $idS } // Enrich the datatable with Product/Categories views, and conversion rates - $customVariables = \Piwik\Plugins\CustomVariables\API::getInstance()->getCustomVariables($idSite, $period, $date, $segment, $expanded = false, - $_leavePiwikCoreVariables = true); + $customVariables = \Piwik\Plugins\CustomVariables\API::getInstance()->getCustomVariables( + $idSite, + $period, + $date, + $segment, + $expanded = false, + $_leavePiwikCoreVariables = true + ); $mapping = array( 'Goals_ItemsSku' => '_pks', 'Goals_ItemsName' => '_pkn',