pel / pel

PHP Exif Library - library for reading and writing Exif headers in JPEG and TIFF files using PHP.

Home Page:https://github.com/pel/pel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert three variable assignments to the usage of combined operators

elfring opened this issue · comments

👀 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/src/PelEntrySShort.php b/src/PelEntrySShort.php
index 94f0f3d..b65fa44 100644
--- a/src/PelEntrySShort.php
+++ b/src/PelEntrySShort.php
@@ -793,7 +793,7 @@ class PelEntrySShort extends PelEntryNumber
             $val = $this->value[0];
             if ($this->ifd_type === PelIfd::CANON_CAMERA_SETTINGS && $this->tag === PelTag::CANON_CS_LENS_TYPE) {
                 // special handling: lens types must be multtiplied by 100 because digits canÄt be used in arrays
-                $val = $val * 100;
+                $val *= 100;
             }
             if (array_key_exists($val, self::TRANSLATIONS[$this->ifd_type][$this->tag])) {
                 return Pel::tra(self::TRANSLATIONS[$this->ifd_type][$this->tag][$val]);
diff --git a/src/PelEntryTime.php b/src/PelEntryTime.php
index 5275d68..ae3116e 100644
--- a/src/PelEntryTime.php
+++ b/src/PelEntryTime.php
@@ -270,9 +270,9 @@ class PelEntryTime extends PelEntryAscii
 
         $l = $jd + 68569;
         $n = floor((4 * $l) / 146097);
-        $l = $l - floor((146097 * $n + 3) / 4);
+        $l -= floor((146097 * $n + 3) / 4);
         $i = floor((4000 * ($l + 1)) / 1461001);
-        $l = $l - floor((1461 * $i) / 4) + 31;
+        $l -= floor((1461 * $i) / 4) - 31;
         $j = floor((80 * $l) / 2447);
         $d = $l - floor((2447 * $j) / 80);
         $l = floor($j / 11);