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:
authorStefan Giehl <stefan@matomo.org>2021-01-15 10:53:48 +0300
committerGitHub <noreply@github.com>2021-01-15 10:53:48 +0300
commitb38578b468d694534db5fabe356db5ffdc58bd6e (patch)
treef9d0307513b614d966075d946ac5e68bed1c660a /plugins/ScheduledReports
parent6f957d15b4db3b0d8d54f046de33207044f87681 (diff)
Introduce PHP CS to improve code quality (#16755)
* Adds PHP CS with a basic config * automatically check coding style for pull requests * Disallow usage of eval & create_function and force using Common::safe_unserialize instead of unserialize * Forbid inline control structures * fix test
Diffstat (limited to 'plugins/ScheduledReports')
-rw-r--r--plugins/ScheduledReports/Menu.php3
-rw-r--r--plugins/ScheduledReports/tests/Integration/ApiTest.php4
2 files changed, 5 insertions, 2 deletions
diff --git a/plugins/ScheduledReports/Menu.php b/plugins/ScheduledReports/Menu.php
index c40910d3db..d1cb6a5b3e 100644
--- a/plugins/ScheduledReports/Menu.php
+++ b/plugins/ScheduledReports/Menu.php
@@ -35,8 +35,9 @@ class Menu extends \Piwik\Plugin\Menu
function getTopMenuTranslationKey()
{
// if MobileMessaging is not activated, display 'Email reports'
- if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging'))
+ if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging')) {
return self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
+ }
if (Piwik::isUserIsAnonymous()) {
return self::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY;
diff --git a/plugins/ScheduledReports/tests/Integration/ApiTest.php b/plugins/ScheduledReports/tests/Integration/ApiTest.php
index 240af9fab7..0eab86b3ad 100644
--- a/plugins/ScheduledReports/tests/Integration/ApiTest.php
+++ b/plugins/ScheduledReports/tests/Integration/ApiTest.php
@@ -742,7 +742,9 @@ class ApiTest extends IntegrationTestCase
private function assertReportsEqual($report, $data)
{
foreach ($data as $key => $value) {
- if ($key == 'description') $value = substr($value, 0, 250);
+ if ($key == 'description') {
+ $value = substr($value, 0, 250);
+ }
$this->assertEquals($value, $report[$key], "Error for $key for report " . var_export($report, true) . " and data " . var_export($data, true));
}
}