Remove redundant one-time use variables
authorMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 14:24:10 +0000 (16:24 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 14:29:38 +0000 (16:29 +0200)
wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php
wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php
wcfsetup/install/files/lib/data/page/Page.class.php
wcfsetup/install/files/lib/data/user/UserAction.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/DiffHighlighter.class.php
wcfsetup/install/files/lib/system/like/LikeHandler.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php
wcfsetup/install/files/lib/system/poll/PollManager.class.php
wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php

index 563f917c83db222750457e6fac65ea64fa302d0f..f7d38c41a7eec373705d5cf05c3ff3795b3a3a8b 100644 (file)
@@ -85,8 +85,7 @@ class AdministrativeAttachmentList extends AttachmentList {
                        ".$this->getConditionBuilder();
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($this->getConditionBuilder()->getParameters());
-               $row = $statement->fetchArray();
                
-               return $row;
+               return $statement->fetchArray();
        }
 }
index 074908e6478bc65e05f7dd6e1a466e3d69ab63d4..41a18f097b217216dcbcb223a7ad5aacc78a033a 100644 (file)
@@ -164,8 +164,7 @@ class ViewableModerationQueue extends DatabaseObjectDecorator implements ILinkab
         * @return      string
         */
        public function getObjectTypeName() {
-               $objectType = ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID);
-               return $objectType->objectType;
+               return ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID)->objectType;
        }
        
        /**
index 183d598f8d4dbe9ed3f4141b81a1a8f3828df4e5..c53c3b5bacab0cd284bc1dec6a8649020edb466d 100644 (file)
@@ -175,9 +175,7 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject {
         * @inheritDoc
         */
        public function getTitle() {
-               $title = PageCache::getInstance()->getPageTitle($this->pageID);
-               
-               return $title;
+               return PageCache::getInstance()->getPageTitle($this->pageID);
        }
        
        /**
index 7f291dc38aa45135470bdae362971ccae9b41b1a..ea046225c3c1bad856d60a5b7dbaf62534f06602 100644 (file)
@@ -139,9 +139,7 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        CommentHandler::getInstance()->deleteObjects('com.woltlab.wcf.user.profileComment', $this->objectIDs);
                }
                
-               $returnValue = parent::delete();
-               
-               return $returnValue;
+               return parent::delete();
        }
        
        /**
index 9a366986136dcbbe118664de7232d1da75828274..0997712b7716923591102f623368bf06d1a529aa 100644 (file)
@@ -58,7 +58,6 @@ class DiffHighlighter extends Highlighter {
                        }
                }
                
-               $data = implode("\n", $lines);
-               return $data;
+               return implode("\n", $lines);
        }
 }
index 028494d01d962f417c48baac1bebdb7f7e1d022d..a2e916707bc2e426f04e77f955ea10c99e539b3c 100644 (file)
@@ -511,8 +511,7 @@ class LikeHandler extends SingletonFactory {
                        $user->userID,
                        $likeObject->likeObjectID
                ]);
-               $row = $statement->fetchArray();
                
-               return $row;
+               return $statement->fetchArray();
        }
 }
index 56d02306800d1640cf547e20cf15c3c4d179f5ed..8a677df00a3328ccea9802543297b870f6663395 100644 (file)
@@ -137,8 +137,7 @@ abstract class PackageInstallationFormManager {
                $row = $statement->fetchArray();
                
                if ($row) {
-                       $document = unserialize(base64_decode($row['document']));
-                       return $document;
+                       return unserialize(base64_decode($row['document']));
                }
                
                return null;
index 71ee8c1f6e1141eca2209261c889e1645c4a488c..45daa138831acd838b936cbe3efe49a8123708bf 100644 (file)
@@ -436,7 +436,6 @@ class PollManager extends SingletonFactory {
                        throw new ParentClassException($className, SingletonFactory::class);
                }
                
-               $object = call_user_func([$className, 'getInstance']);
-               return $object;
+               return call_user_func([$className, 'getInstance']);
        }
 }
index aaf9461f459e04c9a5c72bc5878d743f551104fc..951d67fe3a9f4e3aca297653df47bcb00ada33ad 100644 (file)
@@ -45,9 +45,7 @@ abstract class AbstractCategorizedACPSearchResultProvider extends AbstractACPSea
         * @return      integer
         */
        protected function getCategoryID($categoryName) {
-               $category = $this->getTopCategory($categoryName);
-               
-               return $category->categoryID;
+               return $this->getTopCategory($categoryName)->categoryID;
        }
        
        /**
@@ -57,9 +55,7 @@ abstract class AbstractCategorizedACPSearchResultProvider extends AbstractACPSea
         * @return      string
         */
        protected function getCategoryName($categoryName) {
-               $category = $this->getTopCategory($categoryName);
-               
-               return $category->categoryName;
+               return $this->getTopCategory($categoryName)->categoryName;
        }
        
        /**