Improve code for better code analysis by IDE
authorMatthias Schmidt <gravatronics@live.com>
Sun, 2 Oct 2016 11:32:46 +0000 (13:32 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 2 Oct 2016 11:32:49 +0000 (13:32 +0200)
29 files changed:
wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php
wcfsetup/install/files/lib/action/AJAXInvokeAction.class.php
wcfsetup/install/files/lib/data/IFile.class.php
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php
wcfsetup/install/files/lib/data/language/LanguageEditor.class.php
wcfsetup/install/files/lib/data/media/ViewableMedia.class.php
wcfsetup/install/files/lib/data/moderation/queue/ViewableModerationQueue.class.php
wcfsetup/install/files/lib/data/tag/TagCloudTag.class.php
wcfsetup/install/files/lib/data/user/group/option/UserGroupOption.class.php
wcfsetup/install/files/lib/data/user/option/UserOption.class.php
wcfsetup/install/files/lib/form/SearchForm.class.php
wcfsetup/install/files/lib/page/UserPage.class.php
wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/OptionCacheBuilder.class.php
wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php
wcfsetup/install/files/lib/system/condition/AbstractTimestampCondition.class.php
wcfsetup/install/files/lib/system/condition/DaysOfWeekCondition.class.php
wcfsetup/install/files/lib/system/condition/TimeCondition.class.php
wcfsetup/install/files/lib/system/condition/UserOptionsCondition.class.php
wcfsetup/install/files/lib/system/condition/UserRegistrationDateCondition.class.php
wcfsetup/install/files/lib/system/condition/UserRegistrationDateIntervalCondition.class.php
wcfsetup/install/files/lib/system/condition/UserStateCondition.class.php
wcfsetup/install/files/lib/system/message/embedded/object/IMessageEmbeddedObjectHandler.class.php
wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php
wcfsetup/install/files/lib/system/page/handler/TDecoratedCategoryLookupPageHandler.class.php
wcfsetup/install/files/lib/system/tagging/TagEngine.class.php
wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentResponseUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/ModerationQueueCommentUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserFollowFollowingUserNotificationEvent.class.php

index 3ee433fdbe8f985bba45f9fe9c719cfd4067e209..5cf00f6875a05d51ab6b5b309e959566ffc725b6 100644 (file)
@@ -27,10 +27,10 @@ class MenuItemEditForm extends MenuItemAddForm {
        public $itemID = 0;
        
        /**
-        * menu object
-        * @var Menu
+        * menu item object
+        * @var MenuItem
         */
-       public $menuItem = null;
+       public $menuItem;
        
        /**
         * @inheritDoc
index 8fe16e28805834501bf25b4989689e00248f8a94..ff1674a5d022f3413b662ba95e733f9284b25aec 100644 (file)
@@ -136,6 +136,7 @@ class AJAXInvokeAction extends AbstractSecureAction {
                
                // validate accessibility
                $className = $this->className;
+               /** @noinspection PhpUndefinedFieldInspection */
                if (!property_exists($className, 'allowInvoke') || !in_array($this->actionName, $className::$allowInvoke)) {
                        throw new PermissionDeniedException();
                }
index 3edaa128d0234399111b6ec713e2cb13499529ba..02399e43e30ddda83be886d77f89c1b58229a287 100644 (file)
@@ -9,6 +9,11 @@ namespace wcf\data;
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\Data
  * @since      3.0
+ * 
+ * @property-read      string          $fileType       type of the physical attachment file
+ * @property-read      integer         $isImage        is `1` if the file is an image, otherwise `0`
+ * @property-read      integer         $width          width of the file if `$isImage` is `1`, otherwise `0`
+ * @property-read      integer         $height         height of the file if `$isImage` is `1`, otherwise `0`
  */
 interface IFile extends IStorableObject {
        /**
index 8e8b2c8ff0cf357d6ed7a2defa83b4d3cc68c95a..5be8905821ab52607a9f32284da39943903d18cd 100644 (file)
@@ -143,6 +143,8 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                
                /** @noinspection PhpUndefinedMethodInspection */
                $this->parameters['__files']->saveFiles($saveStrategy);
+               
+               /** @var Attachment[] $attachments */
                $attachments = $saveStrategy->getObjects();
                
                // return result
index 5250eccb1de9a5f54906bfb4329327f415d2753e..821536abcdb412746dc5b706379672f8c2d36582 100644 (file)
@@ -212,6 +212,7 @@ class LanguageEditor extends DatabaseObjectEditor implements IEditableCachedObje
                foreach ($usedCategories as $categoryName => $categoryID) {
                        if ($categoryID) continue;
                        
+                       /** @var LanguageCategory $category */
                        $category = LanguageCategoryEditor::create([
                                'languageCategory' => $categoryName
                        ]);
index 2284104177691c550f57ac9bfbe89ce8832ee48e..38c4b5e11a97cb25a8e2f6a3d10ee8d3a99c1341 100644 (file)
@@ -17,7 +17,7 @@ use wcf\util\StringUtil;
  * @method     Media   getDecoratedObject()
  * @mixin      Media
  * @property-read      string|null     $title          title of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
- * @property-read      string|null     $description    description of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
+ * @property-read      string|null     $caption        caption of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
  * @property-read      string|null     $altText        alternative text of the media file in the active user's language or `null` if object has not been fetched via `ViewableMediaList`
  */
 class ViewableMedia extends DatabaseObjectDecorator {
index 41a18f097b217216dcbcb223a7ad5aacc78a033a..c50383898d88da29c0b240a31398c8ffdfb12c60 100644 (file)
@@ -186,6 +186,7 @@ class ViewableModerationQueue extends DatabaseObjectDecorator implements ILinkab
        public function getLabel() {
                $definition = ObjectTypeCache::getInstance()->getDefinition(ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID)->definitionID);
                
+               /** @noinspection PhpUndefinedFieldInspection */
                if ($definition->definitionName == 'com.woltlab.wcf.moderation.activation' && $this->getAffectedObject()->enableTime) {
                        return WCF::getLanguage()->get('wcf.moderation.type.com.woltlab.wcf.moderation.activation.delayed');
                }
index a91d461b97030c069352aa4f6e139f5465564071..66fbc371c27c2c4d35bc64e0c19d72e3e90f1d49 100644 (file)
@@ -12,6 +12,8 @@ use wcf\data\DatabaseObjectDecorator;
  * 
  * @method     Tag     getDecoratedObject()
  * @mixin      Tag
+ * 
+ * @property-read      integer|null    $counter        number of the times the tag has been used for a certain object type or `null`
  */
 class TagCloudTag extends DatabaseObjectDecorator {
        /**
index ad233c6d4fc8eabe1530a06253ca0ff572153989..90f6ab250e61a1c8e12f0615b5b9e7683e3596cb 100644 (file)
@@ -9,7 +9,8 @@ use wcf\data\option\Option;
  * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\Data\User\Group\Option
- * 
+ *
+ * @property-read      string          $defaultValue           default value of the user option
  * @property-read      integer         $usersOnly      is `1` if the option only applies to user groups for registered users, otherwise `1`
  */
 class UserGroupOption extends Option {
index b67e16fb95037bcfe8c0ef9944bb6b7b7afab14e..d25c708c0901b8e4922582b20b7d20a8147bf8be 100644 (file)
@@ -12,6 +12,7 @@ use wcf\system\WCF;
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\Data\User\Option
  * 
+ * @property-read      string          $defaultValue           default value of the user option
  * @property-read      integer         $required               is `1` if the user option has to be filled out, otherwise `0`
  * @property-read      integer         $askDuringRegistration  is `1` if the user option will be shown during registration to be filled out, otherwise `0`
  * @property-read      integer         $editable               setting for who can edit the user option, see `UserOption::EDITABILITY_*` constants
index 8fcb1f7462676867c1fe92e8e49df964351250ab..7cd697e34d19f66c5c8174e934a8a809c6ce6317 100644 (file)
@@ -379,6 +379,7 @@ class SearchForm extends AbstractCaptchaForm {
                $application = 'wcf';
                if (count($this->selectedObjectTypes) == 1) {
                        $objectType = SearchEngine::getInstance()->getObjectType(reset($this->selectedObjectTypes));
+                       /** @noinspection PhpUndefinedFieldInspection */
                        if ($tmp = ApplicationHandler::getInstance()->getAbbreviation($objectType->packageID)) {
                                $application = $tmp;
                        }
index 2812931c009a806122a5827478992e3bf1d1eb2b..7b45b9784440d77581808356811690d99b98228b 100644 (file)
@@ -176,6 +176,7 @@ class UserPage extends AbstractPage {
                        $editor->updateCounters(['profileHits' => 1]);
                        
                        // save visitor
+                       /** @noinspection PhpUndefinedFieldInspection */
                        if (PROFILE_ENABLE_VISITORS && WCF::getUser()->userID && !WCF::getUser()->canViewOnlineStatus) {
                                if (($visitor = UserProfileVisitor::getObject($this->user->userID, WCF::getUser()->userID)) !== null) {
                                        $editor = new UserProfileVisitorEditor($visitor);
index 784f191c9c6207b90c91b5bf0798e714129f388a..d7821fdef6a2aa48c4ce79bbd3fb740d6b25491c 100644 (file)
@@ -26,11 +26,14 @@ class CategoryCacheBuilder extends AbstractCacheBuilder {
                        'objectTypeCategoryIDs' => []
                ];
                foreach ($list as $category) {
-                       if (!isset($data['objectTypeCategoryIDs'][$category->objectType])) {
-                               $data['objectTypeCategoryIDs'][$category->objectType] = [];
+                       /** @noinspection PhpUndefinedFieldInspection */
+                       $objectType = $category->objectType;
+                       
+                       if (!isset($data['objectTypeCategoryIDs'][$objectType])) {
+                               $data['objectTypeCategoryIDs'][$objectType] = [];
                        }
                        
-                       $data['objectTypeCategoryIDs'][$category->objectType][] = $category->categoryID;
+                       $data['objectTypeCategoryIDs'][$objectType][] = $category->categoryID;
                }
                
                return $data;
index cb3160fd719ed35f3c6b3a2171775d3a73d8c24b..d0323dfd9ae150767276e9ed345a2d6e71bfd5dd 100644 (file)
@@ -63,6 +63,8 @@ class OptionCacheBuilder extends AbstractCacheBuilder {
                        ORDER BY        showOrder";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
+               
+               /** @var Option $option */
                while ($option = $statement->fetchObject($this->optionClassName)) {
                        $data['options'][$option->optionName] = $option;
                        if (!isset($data['optionToCategories'][$option->categoryName])) {
index 2f9111e530275bf228118343d627a02e1631f726..ea0390390a141c231824887736691a8cf87b93f3 100644 (file)
@@ -226,12 +226,14 @@ class ClipboardHandler extends SingletonFactory {
                        }
                        
                        if (!isset($data[$objectType->objectType])) {
-                               if ($objectType->listclassname == '') {
+                               /** @noinspection PhpUndefinedFieldInspection */
+                               $listClassName = $objectType->listclassname;
+                               if ($listClassName == '') {
                                        throw new SystemException("Missing list class for object type '".$objectType->objectType."'");
                                }
                                
                                $data[$objectType->objectType] = [
-                                       'className' => $objectType->listclassname,
+                                       'className' => $listClassName,
                                        'objectIDs' => []
                                ];
                        }
index 041007a210973ee9299d2e9488c8945b7bd861e5..d96e78b9ec3c9205bc56d0ab4c8b1e08d93e1f14 100644 (file)
@@ -172,11 +172,16 @@ HTML;
         * @inheritDoc
         */
        public function setData(Condition $condition) {
-               if ($condition->endTime) {
-                       $this->endTime = $condition->endTime;
+               /** @noinspection PhpUndefinedFieldInspection */
+               $endTime = $condition->endTime;
+               if ($endTime) {
+                       $this->endTime = $endTime;
                }
-               if ($condition->startTime) {
-                       $this->startTime = $condition->startTime;
+               
+               /** @noinspection PhpUndefinedFieldInspection */
+               $startTime = $condition->startTime;
+               if ($startTime) {
+                       $this->startTime = $startTime;
                }
        }
        
index 409929001e2c7ea06b4a71afab068783035c2dea..2f6a84ce7e3658da72160aeb08939a4f1adcf5a6 100644 (file)
@@ -49,6 +49,7 @@ class DaysOfWeekCondition extends AbstractMultiSelectCondition implements IConte
                $date = DateUtil::getDateTimeByTimestamp(TIME_NOW);
                $date->setTimezone(WCF::getUser()->getTimeZone());
                
+               /** @noinspection PhpUndefinedFieldInspection */
                return in_array($date->format('w'), $condition->daysOfWeek);
        }
 }
index ea7ecb23db3ed1c95419d0907362b163c0f2be26..5cd2c33ebc530087e4b9241948bc6569fc5f700b 100644 (file)
@@ -130,14 +130,22 @@ HTML;
         * @inheritDoc
         */
        public function setData(Condition $condition) {
-               if ($condition->endTime) {
-                       $this->endTime = $condition->endTime;
+               /** @noinspection PhpUndefinedFieldInspection */
+               $endTime = $condition->endTime;
+               if ($endTime) {
+                       $this->endTime = $endTime;
                }
-               if ($condition->startTime) {
-                       $this->startTime = $condition->startTime;
+               
+               /** @noinspection PhpUndefinedFieldInspection */
+               $startTime = $condition->startTime;
+               if ($startTime) {
+                       $this->startTime = $startTime;
                }
-               if ($condition->timezone) {
-                       $this->timezone = $condition->timezone;
+               
+               /** @noinspection PhpUndefinedFieldInspection */
+               $timezone = $condition->timezone;
+               if ($timezone) {
+                       $this->timezone = $timezone;
                }
        }
        
@@ -188,19 +196,25 @@ HTML;
         */
        public function showContent(Condition $condition) {
                $timezone = WCF::getUser()->getTimeZone();
-               if ($condition->timezone) {
-                       $timezone = new \DateTimeZone($condition->timezone);
+               /** @noinspection PhpUndefinedFieldInspection */
+               $conditionTimezone = $condition->timezone;
+               if ($conditionTimezone) {
+                       $timezone = new \DateTimeZone($conditionTimezone);
                }
                
-               if ($condition->startTime) {
-                       $dateTime = \DateTime::createFromFormat('H:i', $condition->startTime, $timezone);
+               /** @noinspection PhpUndefinedFieldInspection */
+               $startTime = $condition->startTime;
+               if ($startTime) {
+                       $dateTime = \DateTime::createFromFormat('H:i', $startTime, $timezone);
                        if ($dateTime->getTimestamp() > TIME_NOW) {
                                return false;
                        }
                }
                
-               if ($condition->endTime) {
-                       $dateTime = \DateTime::createFromFormat('H:i', $condition->endTime, $timezone);
+               /** @noinspection PhpUndefinedFieldInspection */
+               $endTime = $condition->endTime;
+               if ($endTime) {
+                       $dateTime = \DateTime::createFromFormat('H:i', $endTime, $timezone);
                        if ($dateTime->getTimestamp() < TIME_NOW) {
                                return false;
                        }
index d9e99670b0f7d47d74e00485da34083b4e5a730f..2206dfe3f3071dc6be1fb8169a4d64f2c7c3511c 100644 (file)
@@ -60,6 +60,7 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
         * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
+               /** @noinspection PhpUndefinedFieldInspection */
                $optionValues = $condition->optionValues;
                
                $checkSuccess = true;
index 33f2c5478e5a69a7ca4492b2660edf2d8db4a727..8626831e82db1db816e64545e98d4f0a23b69b1a 100644 (file)
@@ -55,10 +55,15 @@ class UserRegistrationDateCondition extends AbstractSingleFieldCondition impleme
         * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
-               if ($condition->registrationDateStart !== null && $user->registrationDate < strtotime($condition->registrationDateStart)) {
+               /** @noinspection PhpUndefinedFieldInspection */
+               $registrationDateStart = $condition->registrationDateStart;
+               if ($registrationDateStart !== null && $user->registrationDate < strtotime($registrationDateStart)) {
                        return false;
                }
-               if ($condition->registrationDateEnd !== null && $user->registrationDate >= strtotime($condition->registrationDateEnd) + 86400) {
+               
+               /** @noinspection PhpUndefinedFieldInspection */
+               $registrationDateEnd = $condition->registrationDateEnd;
+               if ($registrationDateEnd !== null && $user->registrationDate >= strtotime($registrationDateEnd) + 86400) {
                        return false;
                }
                
@@ -118,11 +123,16 @@ HTML;
         * @inheritDoc
         */
        public function setData(Condition $condition) {
-               if ($condition->registrationDateEnd) {
-                       $this->registrationDateEnd = $condition->registrationDateEnd;
+               /** @noinspection PhpUndefinedFieldInspection */
+               $registrationDateEnd = $condition->registrationDateEnd;
+               if ($registrationDateEnd) {
+                       $this->registrationDateEnd = $registrationDateEnd;
                }
-               if ($condition->registrationDateStart) {
-                       $this->registrationDateStart = $condition->registrationDateStart;
+               
+               /** @noinspection PhpUndefinedFieldInspection */
+               $registrationDateStart = $condition->registrationDateStart;
+               if ($registrationDateStart) {
+                       $this->registrationDateStart = $registrationDateStart;
                }
        }
        
index 6bec80d331cff717176c7fa0ef5726dceeef04c7..e201a63adb7d47bee3a101de1d9448ed8dbe5e84 100644 (file)
@@ -48,10 +48,15 @@ class UserRegistrationDateIntervalCondition extends AbstractIntegerCondition imp
         * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
-               if ($condition->greaterThan !== null && $user->registrationDate >= TIME_NOW - $condition->greaterThan * 86400) {
+               /** @noinspection PhpUndefinedFieldInspection */
+               $greaterThan = $condition->greaterThan;
+               if ($greaterThan !== null && $user->registrationDate >= TIME_NOW - $greaterThan * 86400) {
                        return false;
                }
-               if ($condition->lessThan !== null && $user->registrationDate <= TIME_NOW - $condition->lessThan * 86400) {
+               
+               /** @noinspection PhpUndefinedFieldInspection */
+               $lessThan = $condition->lessThan;
+               if ($lessThan !== null && $user->registrationDate <= TIME_NOW - $lessThan * 86400) {
                        return false;
                }
                
index b812caa99f0cd186c428f1ce762676ac573032cc..9fd4a29c879b24aa593170243b4db09e73a6e252 100644 (file)
@@ -73,15 +73,19 @@ class UserStateCondition extends AbstractSingleFieldCondition implements IConten
         * @inheritDoc
         */
        public function checkUser(Condition $condition, User $user) {
-               if ($condition->userIsBanned !== null && $user->banned != $condition->userIsBanned) {
+               /** @noinspection PhpUndefinedFieldInspection */
+               $userIsBanned = $condition->userIsBanned;
+               if ($userIsBanned !== null && $user->banned != $userIsBanned) {
                        return false;
                }
                
-               if ($condition->userIsEnabled !== null) {
-                       if ($condition->userIsEnabled && $user->activationCode) {
+               /** @noinspection PhpUndefinedFieldInspection */
+               $userIsEnabled = $condition->userIsEnabled;
+               if ($userIsEnabled !== null) {
+                       if ($userIsEnabled && $user->activationCode) {
                                return false;
                        }
-                       else if (!$condition->userIsEnabled && !$user->activationCode) {
+                       else if (!$userIsEnabled && !$user->activationCode) {
                                return false;
                        }
                }
@@ -171,13 +175,18 @@ HTML;
         * @inheritDoc
         */
        public function setData(Condition $condition) {
+               /** @noinspection PhpUndefinedFieldInspection */
+               $userIsBanned = $condition->userIsBanned;
                if ($condition->userIsBanned !== null) {
-                       $this->userIsBanned = $condition->userIsBanned;
-                       $this->userIsNotBanned = !$condition->userIsBanned;
+                       $this->userIsBanned = $userIsBanned;
+                       $this->userIsNotBanned = !$userIsBanned;
                }
+               
+               /** @noinspection PhpUndefinedFieldInspection */
+               $userIsEnabled = $condition->userIsEnabled;
                if ($condition->userIsEnabled !== null) {
-                       $this->userIsEnabled = $condition->userIsEnabled;
-                       $this->userIsDisabled = !$condition->userIsEnabled;
+                       $this->userIsEnabled = $userIsEnabled;
+                       $this->userIsDisabled = !$userIsEnabled;
                }
        }
        
index e23b64c44f1965fd5453976480f833601d24f349..f0bb165117d53b4c1129eac2165ec046bbc59d71 100644 (file)
@@ -10,6 +10,8 @@ use wcf\system\html\input\HtmlInputProcessor;
  * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\System\Message\Embedded\Object
+ * 
+ * @property-read      integer         $objectTypeID   id of the embedded object type
  */
 interface IMessageEmbeddedObjectHandler {
        /**
index 5903fcf6dd1256d50bdae8d7b66b2a49598fb551..cd81f18d1942bd763581428355ef98d79b9526f2 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\system\option\user;
 use wcf\data\option\category\OptionCategory;
 use wcf\data\option\Option;
+use wcf\data\user\option\category\UserOptionCategory;
 use wcf\data\user\option\UserOption;
 use wcf\data\user\option\ViewableUserOption;
 use wcf\data\user\User;
@@ -19,6 +20,10 @@ use wcf\util\MessageUtil;
  * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\System\Option\User
+ * 
+ * @property   UserOptionCategory      $cachedCategories
+ * @property   UserOption[]            $cachedOptions
+ * @property   UserOption[]            $options
  */
 class UserOptionHandler extends OptionHandler {
        /**
@@ -198,6 +203,8 @@ class UserOptionHandler extends OptionHandler {
         * @inheritDoc
         */
        protected function validateOption(Option $option) {
+               /** @var UserOption $option */
+               
                parent::validateOption($option);
                
                if ($option->required && $option->optionType != 'boolean' && empty($this->optionValues[$option->optionName])) {
index e77d67a255092b969579a714db4e1f4f46cb5450..22f015f2ef32a996da6f18ce1b273eb8f23bc2f7 100644 (file)
@@ -84,6 +84,7 @@ trait TDecoratedCategoryLookupPageHandler {
                }
                
                $conditionBuilder = new PreparedStatementConditionBuilder();
+               /** @noinspection PhpUndefinedFieldInspection */
                $conditionBuilder->add('category.objectTypeID = ?', [ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.category', $className::OBJECT_TYPE_NAME)]);
                $conditionBuilder->add('(category.title LIKE ? OR language_item.languageItemValue LIKE ?)', ['%' . $searchString . '%', '%' . $searchString . '%']);
                $sql = "SELECT          DISTINCT categoryID
index af07adab5463064f414ea0db9ca8cf7a8c145d11..5b7e9ab6e13c4052f15c65b9ac28af6caf0796dc 100644 (file)
@@ -174,10 +174,12 @@ class TagEngine extends SingletonFactory {
                
                $tags = [];
                while ($tag = $statement->fetchObject(Tag::class)) {
-                       if (!isset($tags[$tag->objectID])) {
-                               $tags[$tag->objectID] = [];
+                       /** @noinspection PhpUndefinedFieldInspection */
+                       $objectID = $tag->objectID;
+                       if (!isset($tags[$objectID])) {
+                               $tags[$objectID] = [];
                        }
-                       $tags[$tag->objectID][$tag->tagID] = $tag;
+                       $tags[$objectID][$tag->tagID] = $tag;
                }
                
                return $tags;
index 52da16177cc9471909b3ecd5fa7b5ce53d908266..9b70f26f5acaa9ca1ec5259c2d765aff0c0b47dd 100644 (file)
@@ -7,6 +7,7 @@ use wcf\system\cache\runtime\CommentRuntimeCache;
 use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\email\Email;
 use wcf\system\moderation\queue\report\IModerationQueueReportHandler;
+use wcf\system\user\notification\object\CommentResponseUserNotificationObject;
 use wcf\system\WCF;
 
 /**
@@ -17,6 +18,8 @@ use wcf\system\WCF;
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\System\User\Notification\Event
  * @since      3.0
+ *
+ * @method     CommentResponseUserNotificationObject   getUserNotificationObject()
  */
 class ModerationQueueCommentResponseUserNotificationEvent extends AbstractSharedUserNotificationEvent {
        /**
@@ -57,7 +60,7 @@ class ModerationQueueCommentResponseUserNotificationEvent extends AbstractShared
         * @inheritDoc
         */
        public function getEmailMessage($notificationType = 'instant') {
-               $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
+               $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID);
                if ($comment->userID) {
                        $commentAuthor = UserProfileRuntimeCache::getInstance()->getObject($comment->userID);
                }
@@ -116,7 +119,7 @@ class ModerationQueueCommentResponseUserNotificationEvent extends AbstractShared
                        ]);
                }
                
-               $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
+               $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID);
                if ($comment->userID) {
                        $commentAuthor = UserProfileRuntimeCache::getInstance()->getObject($comment->userID);
                }
@@ -139,7 +142,7 @@ class ModerationQueueCommentResponseUserNotificationEvent extends AbstractShared
         */
        public function getModerationQueue() {
                if (!$this->moderationQueueLoaded) {
-                       $comment = CommentRuntimeCache::getInstance()->getObject($this->userNotificationObject->commentID);
+                       $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID);
                        
                        $this->moderationQueue = ViewableModerationQueue::getViewableModerationQueue($comment->objectID);
                        $this->moderationQueueLoaded = true;
@@ -182,7 +185,7 @@ class ModerationQueueCommentResponseUserNotificationEvent extends AbstractShared
         * @inheritDoc
         */
        protected function prepare() {
-               CommentRuntimeCache::getInstance()->cacheObjectID($this->userNotificationObject->commentID);
+               CommentRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->commentID);
                UserProfileRuntimeCache::getInstance()->cacheObjectID($this->additionalData['userID']);
        }
 }
index 9dd34cf044e7521ddc1a384e8ae6ea026cfee9e4..0218732b58e5de327d2fdfa61f1241c5b1d83a58 100644 (file)
@@ -6,6 +6,7 @@ use wcf\data\user\notification\UserNotification;
 use wcf\data\user\UserProfile;
 use wcf\system\email\Email;
 use wcf\system\moderation\queue\IModerationQueueHandler;
+use wcf\system\user\notification\object\CommentUserNotificationObject;
 use wcf\system\user\notification\object\IUserNotificationObject;
 use wcf\system\WCF;
 
@@ -17,6 +18,8 @@ use wcf\system\WCF;
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\System\User\Notification\Event
  * @since      3.0
+ * 
+ * @method     CommentUserNotificationObject   getUserNotificationObject()
  */
 class ModerationQueueCommentUserNotificationEvent extends AbstractUserNotificationEvent {
        /**
@@ -127,7 +130,7 @@ class ModerationQueueCommentUserNotificationEvent extends AbstractUserNotificati
                parent::setObject($notification, $object, $author, $additionalData);
                
                // if the active user has no access, $this->moderationQueue is null
-               $this->moderationQueue = ViewableModerationQueue::getViewableModerationQueue($this->userNotificationObject->objectID);
+               $this->moderationQueue = ViewableModerationQueue::getViewableModerationQueue($this->getUserNotificationObject()->objectID);
                
                if ($this->moderationQueue) {
                        /** @var IModerationQueueHandler $moderationHandler */
index 882ac722054e04dbc5ccd66ae3e7f86e2214890e..4f7a2aad7d30e63a243ed36084c0c13c5e810a1a 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\user\notification\event;
 use wcf\system\request\LinkHandler;
+use wcf\system\user\notification\object\UserFollowUserNotificationObject;
 
 /**
  * Notification event for followers.
@@ -9,6 +10,8 @@ use wcf\system\request\LinkHandler;
  * @copyright  2001-2016 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    WoltLabSuite\Core\System\User\Notification\Event
+ * 
+ * @method     UserFollowUserNotificationObject        getUserNotificationObject()
  */
 class UserFollowFollowingUserNotificationEvent extends AbstractUserNotificationEvent {
        /**
@@ -68,6 +71,6 @@ class UserFollowFollowingUserNotificationEvent extends AbstractUserNotificationE
         * @inheritDoc
         */
        public function getEventHash() {
-               return sha1($this->eventID . '-' . $this->userNotificationObject->followUserID);
+               return sha1($this->eventID . '-' . $this->getUserNotificationObject()->followUserID);
        }
 }