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 six variable assignments to the usage of combined operators #328

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

Convert six variable assignments to the usage of combined operators #328

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/User_class.php b/User_class.php
index b9c8fc7..86386df 100644
--- a/User_class.php
+++ b/User_class.php
@@ -446,13 +446,13 @@ if (!defined('User_class')) {
                 foreach ($result as $row) {
                     $dept = $row['dept_id'];
                     if ($index != $num_depts -1) {
-                        $query = $query . " department = :dept OR ";
+                        $query .= " department = :dept OR ";
                     } else {
-                        $query = $query . " department = :dept )";
+                        $query .= " department = :dept )";
                     }
                     $index++;
                 }
-                $query = $query . " AND publishable = 0";
+                $query .= " AND publishable = 0";
 
                 $stmt = $this->connection->prepare($query);
                 $stmt->execute(array(':dept' => $dept));
diff --git a/functions.php b/functions.php
index 9d81b2f..875b43d 100644
--- a/functions.php
+++ b/functions.php
@@ -603,7 +603,7 @@ function makeRandomPassword()
     while ($i <= 7) {
         $num = rand() % 33;
         $tmp = substr($salt, $num, 1);
-        $pass = $pass . $tmp;
+        $pass .= $tmp;
         $i++;
     }
     return $pass;
diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php
index 1f103ad..4a6ca68 100644
--- a/vendor/symfony/console/Helper/Table.php
+++ b/vendor/symfony/console/Helper/Table.php
@@ -601,7 +601,7 @@ class Table
             $cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
             if ($cell instanceof TableCell && $cell->getColspan() > 1) {
                 // we assume that cell value will be across more than one column.
-                $cellWidth = $cellWidth / $cell->getColspan();
+                $cellWidth /= $cell->getColspan();
             }
 
             return $cellWidth;
diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php
index bd64163..fcc8ec3 100644
--- a/vendor/symfony/console/Input/InputDefinition.php
+++ b/vendor/symfony/console/Input/InputDefinition.php
@@ -399,7 +399,7 @@ class InputDefinition
             if (!$argument->isRequired()) {
                 $element = '['.$element.']';
             } elseif ($argument->isArray()) {
-                $element = $element.' ('.$element.')';
+                $element .=' ('.$element.')';
             }
 
             if ($argument->isArray()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant