From: Matthias Schmidt Date: Sun, 15 May 2016 14:17:37 +0000 (+0200) Subject: Remove unused local variables X-Git-Tag: 3.0.0_Beta_1~1724 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ee29e65ee9bfc25ea05da6e15ec54122cab64414;p=GitHub%2FWoltLab%2FWCF.git Remove unused local variables --- diff --git a/wcfsetup/install.php b/wcfsetup/install.php index c8e5ad088c..15dc5d1f10 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -344,7 +344,6 @@ class BasicFileUtil { } } - $startIndex = 0; if (is_dir($filename)) { if (self::$mode == 0644) { @chmod($filename, 0755); diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php index f0862d204f..0629a52c58 100644 --- a/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php @@ -85,7 +85,7 @@ class UserGroupAssignmentEditForm extends UserGroupAssignmentAddForm { 'title' => $this->title )) )); - $returnValues = $this->objectAction->executeAction(); + $this->objectAction->executeAction(); // transform conditions array into one-dimensional array $conditions = array(); diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php index 321970b148..13646a7f54 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php @@ -101,8 +101,6 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction { * @return string[] */ public function getOutstandingQueues() { - $objectTypeIDs = ModerationQueueManager::getInstance()->getObjectTypeIDs(array_keys(ModerationQueueManager::getInstance()->getDefinitions())); - $conditions = new PreparedStatementConditionBuilder(); $conditions->add("moderation_queue_to_user.userID = ?", array(WCF::getUser()->userID)); $conditions->add("moderation_queue_to_user.isAffected = ?", array(1)); diff --git a/wcfsetup/install/files/lib/data/style/StyleAction.class.php b/wcfsetup/install/files/lib/data/style/StyleAction.class.php index a00815145a..1f39e81c5d 100644 --- a/wcfsetup/install/files/lib/data/style/StyleAction.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleAction.class.php @@ -295,14 +295,13 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction, default: throw new UserInputException('image'); } - + if ($imageData[0] > Style::PREVIEW_IMAGE_MAX_WIDTH || $imageData[1] > Style::PREVIEW_IMAGE_MAX_HEIGHT) { $adapter = ImageHandler::getInstance()->getAdapter(); $adapter->loadFile($fileLocation); $fileLocation = FileUtil::getTemporaryFilename(); $thumbnail = $adapter->createThumbnail(Style::PREVIEW_IMAGE_MAX_WIDTH, Style::PREVIEW_IMAGE_MAX_HEIGHT, false); $adapter->writeImage($thumbnail, $fileLocation); - $imageData = getimagesize($fileLocation); } } catch (SystemException $e) { diff --git a/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php index 3e253fd007..064b74c5c9 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php @@ -24,8 +24,6 @@ class DefaultAvatar implements IUserAvatar { * @see \wcf\data\user\avatar\IUserAvatar::getURL() */ public function getURL($size = null) { - if ($size === null) $size = $this->size; - return WCF::getPath().'images/avatars/avatar-default.svg'; } diff --git a/wcfsetup/install/files/lib/system/bbcode/ImageBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/ImageBBCode.class.php index fe78a02864..1a59b7e323 100644 --- a/wcfsetup/install/files/lib/system/bbcode/ImageBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/ImageBBCode.class.php @@ -43,11 +43,8 @@ class ImageBBCode extends AbstractBBCode { $style = 'float: ' . $float . '; margin: ' . ($float == 'left' ? '0 15px 7px 0' : '0 0 7px 15px') . ';'; } - $width = 0; if (isset($openingTag['attributes'][2])) { - $width = $openingTag['attributes'][2]; - - $style .= 'width: ' . $width . 'px;'; + $style .= 'width: ' . $openingTag['attributes'][2] . 'px;'; } return ''; diff --git a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php index 9aa27c20e7..563f25489a 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php @@ -52,7 +52,7 @@ class ImagickImageAdapter implements IImageAdapter { // check if writing animated gifs is supported $version = $this->imagick->getVersion(); - $versionNumber = preg_match('~([0-9]+\.[0-9]+\.[0-9]+)~', $version['versionString'], $match); + preg_match('~([0-9]+\.[0-9]+\.[0-9]+)~', $version['versionString'], $match); if (version_compare($match[0], '6.3.6') < 0) { $this->supportsWritingAnimatedGIF = false; } diff --git a/wcfsetup/install/files/lib/system/io/Zip.class.php b/wcfsetup/install/files/lib/system/io/Zip.class.php index 18135e0b24..6287e73e02 100644 --- a/wcfsetup/install/files/lib/system/io/Zip.class.php +++ b/wcfsetup/install/files/lib/system/io/Zip.class.php @@ -256,7 +256,6 @@ class Zip extends File implements IArchive { } // read headers - $header = array(); $header = unpack('vminVersion/vgeneralPurposeBit/vcompression/vmtime/vmdate', $this->read(10)); $second = ($header['mtime'] & ((1 << 5) - 1)) * 2; $minute = ($header['mtime'] >> 5) & ((1 << 6) - 1); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 2a3d5ae4e1..191b7e8362 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -276,7 +276,6 @@ class PackageInstallationDispatcher { */ public function getArchive() { if ($this->archive === null) { - $package = $this->getPackage(); // check if we're doing an iterative update of the same package if ($this->previousPackageData !== null && $this->getPackage()->package == $this->previousPackageData['package']) { if (Package::compareVersion($this->getPackage()->packageVersion, $this->previousPackageData['packageVersion'], '<')) { diff --git a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php index a1d717b3bc..360f4dff01 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php @@ -31,8 +31,6 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin { // extract sql file from archive if ($queries = $this->getSQL($this->instruction['value'])) { - $package = $this->installation->getPackage(); - // replace app1_ with app{WCF_N}_ in the table names for // all applications $packageList = new PackageList(); diff --git a/wcfsetup/install/files/lib/system/poll/PollManager.class.php b/wcfsetup/install/files/lib/system/poll/PollManager.class.php index 15e09fd2b9..2571a0b6ed 100644 --- a/wcfsetup/install/files/lib/system/poll/PollManager.class.php +++ b/wcfsetup/install/files/lib/system/poll/PollManager.class.php @@ -273,7 +273,7 @@ class PollManager extends SingletonFactory { // remove poll if (empty($this->pollData['question'])) { $action = new PollAction(array($this->poll), 'delete'); - $returnValues = $action->executeAction(); + $action->executeAction(); $this->poll = null; return 0; @@ -284,7 +284,7 @@ class PollManager extends SingletonFactory { 'data' => $this->pollData, 'options' => $this->pollOptions )); - $returnValues = $action->executeAction(); + $action->executeAction(); } } diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 10a7569c9f..24c7836dca 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -256,7 +256,6 @@ class SessionHandler extends SingletonFactory { * attacker. */ protected function changeSessionID() { - $oldSessionID = $this->session->sessionID; $newSessionID = StringUtil::getRandomID(); /** @var \wcf\data\DatabaseObjectEditor $sessionEditor */ diff --git a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php index a683fbe6a0..ed7980b023 100644 --- a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php @@ -25,7 +25,7 @@ class ProfileCommentResponseUserActivityEvent extends SingletonFactory implement return; } - $responses = $responseIDs = []; + $responseIDs = []; foreach ($events as $event) { $responseIDs[] = $event->objectID; } diff --git a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php index 9c47e732d8..82aa14fcd4 100644 --- a/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php @@ -24,7 +24,7 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA return; } - $comments = $commentIDs = array(); + $commentIDs = array(); foreach ($events as $event) { $commentIDs[] = $event->objectID; } diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index 1dd365bfc2..e63be98347 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -396,7 +396,7 @@ class UserNotificationHandler extends SingletonFactory { ); } - $authorIDs = $eventIDs = $notificationIDs = $objectTypes = array(); + $eventIDs = $notificationIDs = $objectTypes = array(); foreach ($notificationObjects as $notification) { // cache object types if (!isset($objectTypes[$notification->objectType])) { @@ -749,7 +749,6 @@ class UserNotificationHandler extends SingletonFactory { } // get objects - $objectTypeObject = $this->availableObjectTypes[$objectType]; $event = $this->availableEvents[$objectType][$eventName]; // mark as confirmed