IXP-Manager icon indicating copy to clipboard operation
IXP-Manager copied to clipboard

Convert three variable assignments to the usage of combined operators

Open elfring opened this issue 4 years ago • 0 comments

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

diff --git a/app/Mail/Customer/WelcomeEmail.php b/app/Mail/Customer/WelcomeEmail.php
index 436bc7053..06452c53f 100644
--- a/app/Mail/Customer/WelcomeEmail.php
+++ b/app/Mail/Customer/WelcomeEmail.php
@@ -138,7 +138,7 @@ class WelcomeEmail extends Mailable
         $body          = $r->message;
         $this->tmpfile = tempnam( sys_get_temp_dir(), 'welcome_email_' );
         $this->tmpname = basename( $this->tmpfile );
-        $this->tmpfile = $this->tmpfile . '.blade.php';
+        $this->tmpfile .= '.blade.php';
         file_put_contents( $this->tmpfile, "@component('mail::message')\n\n" . $body . "\n\n@endcomponent\n" );
         view()->addNamespace('welcome_emails', sys_get_temp_dir() );
         $this->markdown( 'welcome_emails::' . $this->tmpname );
diff --git a/resources/views/admin/dashboard.foil.php b/resources/views/admin/dashboard.foil.php
index 14c8b8273..b272b9b05 100644
--- a/resources/views/admin/dashboard.foil.php
+++ b/resources/views/admin/dashboard.foil.php
@@ -250,7 +250,7 @@
                                                             <?= $spds[ $speed ] ?>
                                                         </a>
                                                         <?php $rowcount += $spds[ $speed ] ?>
-                                                        <?php $rowcap = $rowcap + $spds[ $speed ] * $speed ?>
+                                                        <?php $rowcap += $spds[ $speed ] * $speed ?>
                                                     <?php else: ?>
                                                         0
                                                     <?php endif; ?>
@@ -275,7 +275,7 @@
                                         <?php $rowcap = 0 ?>
 
                                         <?php foreach( $t->stats[ "speeds"] as $k => $i ): ?>
-                                            <?php $rowcap = $rowcap + $i * $k ?>
+                                            <?php $rowcap += $i * $k ?>
                                             <td class="tw-text-right">
                                                 <b>
                                                     <?= $i ?>

elfring avatar Nov 26 '21 11:11 elfring