From 241627da927e149308ad311edd05c37084d04530 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 30 Jul 2016 16:24:10 +0200 Subject: [PATCH] Remove redundant one-time use variables --- .../attachment/AdministrativeAttachmentList.class.php | 3 +-- .../moderation/queue/ViewableModerationQueue.class.php | 3 +-- wcfsetup/install/files/lib/data/page/Page.class.php | 4 +--- wcfsetup/install/files/lib/data/user/UserAction.class.php | 4 +--- .../system/bbcode/highlighter/DiffHighlighter.class.php | 3 +-- .../install/files/lib/system/like/LikeHandler.class.php | 3 +-- .../package/PackageInstallationFormManager.class.php | 3 +-- .../install/files/lib/system/poll/PollManager.class.php | 3 +-- .../AbstractCategorizedACPSearchResultProvider.class.php | 8 ++------ 9 files changed, 10 insertions(+), 24 deletions(-) diff --git a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php index 563f917c83..f7d38c41a7 100644 --- a/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php +++ b/wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php @@ -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(); } } diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php index 074908e647..41a18f097b 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php @@ -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; } /** diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index 183d598f8d..c53c3b5bac 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -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); } /** diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index 7f291dc38a..ea046225c3 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -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(); } /** diff --git a/wcfsetup/install/files/lib/system/bbcode/highlighter/DiffHighlighter.class.php b/wcfsetup/install/files/lib/system/bbcode/highlighter/DiffHighlighter.class.php index 9a36698613..0997712b77 100644 --- a/wcfsetup/install/files/lib/system/bbcode/highlighter/DiffHighlighter.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/highlighter/DiffHighlighter.class.php @@ -58,7 +58,6 @@ class DiffHighlighter extends Highlighter { } } - $data = implode("\n", $lines); - return $data; + return implode("\n", $lines); } } diff --git a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php index 028494d01d..a2e916707b 100644 --- a/wcfsetup/install/files/lib/system/like/LikeHandler.class.php +++ b/wcfsetup/install/files/lib/system/like/LikeHandler.class.php @@ -511,8 +511,7 @@ class LikeHandler extends SingletonFactory { $user->userID, $likeObject->likeObjectID ]); - $row = $statement->fetchArray(); - return $row; + return $statement->fetchArray(); } } diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php index 56d0230680..8a677df00a 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 71ee8c1f6e..45daa13883 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -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']); } } diff --git a/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php index aaf9461f45..951d67fe3a 100644 --- a/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php @@ -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; } /** -- 2.20.1