Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert five variable assignments to the usage of combined operators #1266

Open
elfring opened this issue Nov 26, 2021 · 0 comments
Open

Convert five variable assignments to the usage of combined operators #1266

elfring opened this issue Nov 26, 2021 · 0 comments

Comments

@elfring
Copy link

elfring commented Nov 26, 2021

馃憖 Some source code analysis tools can help to find opportunities for improving software components.
馃挱 I propose to increase the usage of combined operators accordingly.

diff --git a/lib/eventum/class.language.php b/lib/eventum/class.language.php
index 4b532d6bb..8d4b3b9aa 100644
--- a/lib/eventum/class.language.php
+++ b/lib/eventum/class.language.php
@@ -149,7 +149,7 @@ class Language
     {
         // XXX do not append charset to en_US locale
         if ($locale !== 'en_US') {
-            $locale = $locale . '.' . self::CHARSET;
+            $locale .= '.' . self::CHARSET;
         }
         $res = setlocale(LC_TIME, $locale);
         if ($res === false) {
diff --git a/lib/eventum/class.reminder.php b/lib/eventum/class.reminder.php
index b3bf7a185..707edd9e7 100644
--- a/lib/eventum/class.reminder.php
+++ b/lib/eventum/class.reminder.php
@@ -918,7 +918,7 @@ class Reminder
                             $cond['rmf_sql_field'] . ')';
                         $cond['rlc_value'] = 'UNIX_TIMESTAMP()';
                     } else {
-                        $cond['rlc_value'] = $cond['rlc_value'] * 60 * 60;
+                        $cond['rlc_value'] *= 60 * 60;
                         if (@$reminder['rem_skip_weekend'] == 1) {
                             $sql_field = Reminder_Condition::getSQLField($cond['rlc_rmf_id']);
                             $cond['rmf_sql_representation'] = DB_Helper::getNoWeekendDateDiffSQL($sql_field);
diff --git a/src/Db/AbstractMigration.php b/src/Db/AbstractMigration.php
index 759cdcece..5d8292caa 100644
--- a/src/Db/AbstractMigration.php
+++ b/src/Db/AbstractMigration.php
@@ -90,9 +90,9 @@ abstract class AbstractMigration extends PhinxAbstractMigration
      */
     public function table($tableName, $options = []): Table
     {
-        $options['engine'] = $options['engine'] ?? $this->engine;
-        $options['charset'] = $options['charset'] ?? $this->charset;
-        $options['collation'] = $options['collation'] ?? $this->collation;
+        $options['engine'] ??= $this->engine;
+        $options['charset'] ??= $this->charset;
+        $options['collation'] ??= $this->collation;
 
         return parent::table($tableName, $options);
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant