Remove unused local variables
authorMatthias Schmidt <gravatronics@live.com>
Sun, 15 May 2016 14:17:37 +0000 (16:17 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 15 May 2016 14:17:37 +0000 (16:17 +0200)
15 files changed:
wcfsetup/install.php
wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php
wcfsetup/install/files/lib/data/style/StyleAction.class.php
wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php
wcfsetup/install/files/lib/system/bbcode/ImageBBCode.class.php
wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php
wcfsetup/install/files/lib/system/io/Zip.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/poll/PollManager.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php
wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentResponseUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index c8e5ad088c7b554cc204a8557a5951ce91013a15..15dc5d1f1023a8486f9375493972a53cfcd7471c 100644 (file)
@@ -344,7 +344,6 @@ class BasicFileUtil {
                        }
                }
                
-               $startIndex = 0;
                if (is_dir($filename)) {
                        if (self::$mode == 0644) {
                                @chmod($filename, 0755);
index f0862d204f4661ddb122af850580506f9478474a..0629a52c585c5693cc94f2dc1212838d467dd415 100644 (file)
@@ -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();
index 321970b148b88277e376ae159a8b1b1a40f4554e..13646a7f54aa5ee10fe7292ebc045dc72876e01a 100644 (file)
@@ -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));
index a00815145a5f52db1be4bb54e0c7f4a09484d61d..1f39e81c5d5b97c029117a51005f8f863e434638 100644 (file)
@@ -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) {
index 3e253fd00752eca82170771aa7dbb04f71bcb5ff..064b74c5c90ba1e74f8f507da0538e676df968fb 100644 (file)
@@ -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';
        }
        
index fe78a028641e2a922e468405cc8f5d0d313cb9f3..1a59b7e3236ecd16cc3f77cd348ec836226bebdb 100644 (file)
@@ -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 '<img src="'.$src.'" class="jsResizeImage" alt=""'.($style ? ' style="' . $style . '"' : '').($dataSource ? ' data-source="'.StringUtil::encodeJS($dataSource).'"' : '').' />';
index 9aa27c20e712ec060c94c970eaba70a2603843cb..563f25489adc98387ca6d5538f34b33d7141b03b 100644 (file)
@@ -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;
                }
index 18135e0b249a2306712f0b9c10d1bb4d6b93b4d5..6287e73e02ed4753ec74b11281c95e6c425b005d 100644 (file)
@@ -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);
index 2a3d5ae4e184421ab03de847f4d77782b1fac3fd..191b7e8362c6916f1234bb1a25d68156b5064c1a 100644 (file)
@@ -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'], '<')) {
index a1d717b3bcff4a19fb65193fd684789eba86fff7..360f4dff0153e5336b733fd35c13303335b1eca0 100644 (file)
@@ -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();
index 15e09fd2b921ad989c667f3aff22bef0ade3beae..2571a0b6edc78b21d461d7a7215a12fbef8f7d14 100644 (file)
@@ -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();
                        }
                }
                
index 10a7569c9f9c6fe2bd2050e74b399af3db4b5abf..24c7836dca6ef2241abbb9c7a8a6d25838934b20 100644 (file)
@@ -256,7 +256,6 @@ class SessionHandler extends SingletonFactory {
         * attacker.
         */
        protected function changeSessionID() {
-               $oldSessionID = $this->session->sessionID;
                $newSessionID = StringUtil::getRandomID();
                
                /** @var \wcf\data\DatabaseObjectEditor $sessionEditor */
index a683fbe6a0ad84fb2e8f349a5c8b1a7e2ce16ab8..ed7980b023c7550cf5b5fe5a231af12549dc2b31 100644 (file)
@@ -25,7 +25,7 @@ class ProfileCommentResponseUserActivityEvent extends SingletonFactory implement
                        return;
                }
                
-               $responses = $responseIDs = [];
+               $responseIDs = [];
                foreach ($events as $event) {
                        $responseIDs[] = $event->objectID;
                }
index 9c47e732d8afdc9017de58a144b6a9d40a0b49cb..82aa14fcd422a86fd110a062849aaf054ac7c217 100644 (file)
@@ -24,7 +24,7 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA
                        return;
                }
                
-               $comments = $commentIDs = array();
+               $commentIDs = array();
                foreach ($events as $event) {
                        $commentIDs[] = $event->objectID;
                }
index 1dd365bfc20c9da1f6be5b7b2e5a9f97f08662ea..e63be983474a0f36b2d1450a02bc90fc91551629 100644 (file)
@@ -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