Fix warnings about undefined methods (WIP)
authorMatthias Schmidt <gravatronics@live.com>
Fri, 27 May 2016 20:11:27 +0000 (22:11 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 27 May 2016 20:11:27 +0000 (22:11 +0200)
74 files changed:
wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php
wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php
wcfsetup/install/files/lib/acp/form/AbstractBulkProcessingForm.class.php
wcfsetup/install/files/lib/acp/form/AdAddForm.class.php
wcfsetup/install/files/lib/acp/form/NoticeAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupAssignmentAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php
wcfsetup/install/files/lib/acp/page/CacheListPage.class.php
wcfsetup/install/files/lib/acp/page/TemplateListPage.class.php
wcfsetup/install/files/lib/acp/page/UserListPage.class.php
wcfsetup/install/files/lib/action/AJAXProxyAction.class.php
wcfsetup/install/files/lib/action/NotificationConfirmAction.class.php
wcfsetup/install/files/lib/core.functions.php
wcfsetup/install/files/lib/data/TLegacyUserPropertyAccess.class.php
wcfsetup/install/files/lib/data/TMultiCategoryObject.class.php
wcfsetup/install/files/lib/data/attachment/AttachmentAction.class.php
wcfsetup/install/files/lib/data/category/CategoryAction.class.php
wcfsetup/install/files/lib/data/clipboard/item/ClipboardItemAction.class.php
wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php
wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php
wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php
wcfsetup/install/files/lib/data/label/LabelAction.class.php
wcfsetup/install/files/lib/data/media/MediaAction.class.php
wcfsetup/install/files/lib/data/page/PageAction.class.php
wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUserAction.class.php
wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php
wcfsetup/install/files/lib/data/style/ActiveStyle.class.php
wcfsetup/install/files/lib/data/style/StyleAction.class.php
wcfsetup/install/files/lib/data/style/StyleEditor.class.php
wcfsetup/install/files/lib/data/user/activity/event/UserActivityEventAction.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php
wcfsetup/install/files/lib/data/user/online/UserOnline.class.php
wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php
wcfsetup/install/files/lib/form/NotificationSettingsForm.class.php
wcfsetup/install/files/lib/form/RegisterForm.class.php
wcfsetup/install/files/lib/form/UserSearchForm.class.php
wcfsetup/install/files/lib/page/EditHistoryPage.class.php
wcfsetup/install/files/lib/page/UsersOnlineListPage.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/bbcode/CodeBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/MessageParser.class.php
wcfsetup/install/files/lib/system/bbcode/SimpleMessageParser.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/HtmlHighlighter.class.php
wcfsetup/install/files/lib/system/box/FollowingsOnlineBoxController.class.php
wcfsetup/install/files/lib/system/box/PageCommentListBoxController.class.php
wcfsetup/install/files/lib/system/box/RecentActivityListBoxController.class.php
wcfsetup/install/files/lib/system/box/TodaysFollowingBirthdaysBoxController.class.php
wcfsetup/install/files/lib/system/cache/builder/CategoryACLOptionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/LabelCacheBuilder.class.php
wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php
wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php
wcfsetup/install/files/lib/system/condition/AbstractMultiCategoryCondition.class.php
wcfsetup/install/files/lib/system/condition/UserOptionsCondition.class.php
wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php
wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php
wcfsetup/install/files/lib/system/io/File.class.php
wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php
wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php
wcfsetup/install/files/lib/system/message/quote/QuotedMessage.class.php
wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php
wcfsetup/install/files/lib/system/package/PackageUninstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php
wcfsetup/install/files/lib/system/search/acp/ACPSearchResultList.class.php
wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/tagging/TagCloud.class.php
wcfsetup/install/files/lib/system/upload/DefaultUploadFileSaveStrategy.class.php
wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index 5455b9de4a6ab437e0008f8fbb8b93859f752c52..92af17312ceef10a70a4616d1b949d7aa9e972b8 100755 (executable)
@@ -117,6 +117,8 @@ class InstallPackageAction extends AbstractDialogAction {
                                        WHERE   packageID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
                                $statement->execute([$packageID]);
+                               
+                               /** @var Application $application */
                                $application = $statement->fetchObject(Application::class);
                                
                                // build redirect location
index f854e0fb275b919e6289e12c2ac173b838d93550..e0a2ce7901d18a1e5d9e93a4241b92e6ebbbcafb 100644 (file)
@@ -103,6 +103,7 @@ class UninstallPackageAction extends InstallPackageAction {
         * @return      string
         */
        public function stepUninstall() {
+               /** @noinspection PhpUndefinedMethodInspection */
                $node = $this->installation->uninstall($this->node);
                
                if ($node == '') {
@@ -133,6 +134,8 @@ class UninstallPackageAction extends InstallPackageAction {
                                WHERE   packageID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute([$packageID]);
+                       
+                       /** @var Application $application */
                        $application = $statement->fetchObject(Application::class);
                        
                        // build redirect location
index e6faff74ec4464263d418604ea4d92efef0944c3..bc7e1aa4e532749042ae33c160f19fe7650d0032 100644 (file)
@@ -34,7 +34,7 @@ abstract class AbstractBulkProcessingForm extends AbstractForm {
        
        /**
         * object condition object type types
-        * @var ObjectType[]
+        * @var ObjectType[][]
         */
        public $conditions = [];
        
index 587d468e35bac6bef4ad87efa514380585cff9a5..bcb43fa12fce76865b3ee49f62405549149db2df 100644 (file)
@@ -50,7 +50,7 @@ class AdAddForm extends AbstractForm {
        
        /**
         * grouped ad condition object types
-        * @var array
+        * @var ObjectType[][]
         */
        public $groupedConditionObjectTypes = [];
        
index 0c0fce7e918dc00c1ea5bd152359f9c545491435..050548302f258fdd010910f474dc3f3668d2b692 100644 (file)
@@ -54,7 +54,7 @@ class NoticeAddForm extends AbstractForm {
        
        /**
         * grouped notice condition object types
-        * @var array
+        * @var ObjectType[][]
         */
        public $groupedConditionObjectTypes = [];
        
index 3abdbaacaaa87bfa7f5693063fbd8f724534f35c..1cdbeee42970b0a6bb07b8c3beed18ad4b383ebf 100644 (file)
@@ -301,6 +301,7 @@ class UserAddForm extends UserOptionListForm {
                $this->signature = $this->disableSignatureReason = $this->disableSignatureExpires = '';
                $this->groupIDs = [];
                $this->languageID = $this->getDefaultFormLanguageID();
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->optionHandler->resetOptionValues();
        }
        
index ad011ba9e7eaec85d80414c4d448b6b6c0d2f06c..5e6bdcf3dc9a82be2620735eea4cbe8fb6cae9aa 100755 (executable)
@@ -116,9 +116,10 @@ class UserEditForm extends UserAddForm {
        }
        
        /**
-        * wcf\acp\form\AbstractOptionListForm::initOptionHandler()
+        * @inheritDoc
         */
        protected function initOptionHandler() {
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->optionHandler->setUser($this->user->getDecoratedObject());
        }
        
index 2b625012b6713d18b30655dc885b1c480f3cb637..abec460d61bcdb8c3ad18de0435fd97af0102bad 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\acp\form;
+use wcf\data\object\type\ObjectType;
 use wcf\data\user\group\assignment\UserGroupAssignmentAction;
 use wcf\data\user\group\UserGroup;
 use wcf\form\AbstractForm;
@@ -27,7 +28,7 @@ class UserGroupAssignmentAddForm extends AbstractForm {
        
        /**
         * list of grouped user group assignment condition object types
-        * @var array
+        * @var ObjectType[][]
         */
        public $conditions = [];
        
@@ -111,6 +112,7 @@ class UserGroupAssignmentAddForm extends AbstractForm {
                if (isset($_POST['title'])) $this->title = StringUtil::trim($_POST['title']);
                
                foreach ($this->conditions as $conditions) {
+                       /** @var ObjectType $condition */
                        foreach ($conditions as $condition) {
                                $condition->getProcessor()->readFormParameters();
                        }
index 35041cad6278d93d6412c8f0545099e4c7780280..f07f92890a2afc1a010889500240fb44c55da606 100644 (file)
@@ -54,6 +54,7 @@ class UserGroupAssignmentEditForm extends UserGroupAssignmentAddForm {
                        
                        $conditions = $this->assignment->getConditions();
                        foreach ($conditions as $condition) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $this->conditions[$condition->getObjectType()->conditiongroup][$condition->objectTypeID]->getProcessor()->setData($condition);
                        }
                }
index 85bd9d2a28de77ca6eed1a3e1c92e7c490884288..46b40e7efba16e64d934e84c5982efcdc9fedffc 100755 (executable)
@@ -60,7 +60,9 @@ class UserGroupEditForm extends UserGroupAddForm {
                
                $this->group = new UserGroupEditor($group);
                
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->optionHandler->setUserGroup($group);
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->optionHandler->init();
        }
        
index 159a446e1a9e76fe771b0a2a30549b4d96a5d61d..59f55d2790450d560744c495a860c28923dc3089 100755 (executable)
@@ -8,6 +8,7 @@ use wcf\data\user\group\UserGroup;
 use wcf\data\user\UserList;
 use wcf\form\AbstractForm;
 use wcf\system\condition\IUserCondition;
+use wcf\system\condition\UserGroupCondition;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\UserInputException;
 use wcf\system\request\LinkHandler;
@@ -37,7 +38,7 @@ class UserSearchForm extends UserOptionListForm {
        
        /**
         * list of grouped user group assignment condition object types
-        * @var array
+        * @var ObjectType[][]
         */
        public $conditions = [];
        
@@ -223,6 +224,8 @@ class UserSearchForm extends UserOptionListForm {
                                
                                // manually inject user group data for listing of group members
                                if ($this->groupID && $objectType->objectType == 'com.woltlab.wcf.userGroup') {
+                                       /** @var UserGroupCondition $processor */
+                                       
                                        $userGroups = UserGroup::getAccessibleGroups([], [UserGroup::EVERYONE, UserGroup::GUESTS]);
                                        
                                        uasort($userGroups, function(UserGroup $groupA, UserGroup $groupB) {
index e5270ae7b39ad9efb5d70a1025fa56351d6593b8..7f85b5f6278083f1bed9525fdfde71fc60402ebf 100755 (executable)
@@ -85,6 +85,7 @@ class CacheListPage extends AbstractPage {
                        
                        case 'wcf\system\cache\source\RedisCacheSource':
                                // set version
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $this->cacheData['version'] = 'Redis '.CacheHandler::getInstance()->getCacheSource()->getRedisVersion();
                        break;
                }
index 17b6df436f26ed73eaed919b1b39a1aedb2759ba..96859cf22045fdbcaf3f4019b1643461ab9eed6a 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\acp\page;
+use wcf\data\package\Package;
 use wcf\data\package\PackageCache;
 use wcf\data\template\group\TemplateGroup;
 use wcf\data\template\TemplateList;
@@ -126,7 +127,7 @@ class TemplateListPage extends SortablePage {
                        $package->getName();
                }
                
-               uasort($this->availableApplications, function ($a, $b) {
+               uasort($this->availableApplications, function (Package $a, Package $b) {
                        return $a->getName() > $b->getName();
                });
        }
index d38b3b4f3cb21d469aa8e2bdffd5955f4a1e6d49..e41166ec88597a16b106bfcff063a32f8454970f 100755 (executable)
@@ -10,6 +10,7 @@ use wcf\system\clipboard\ClipboardHandler;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\IllegalLinkException;
+use wcf\system\option\user\IUserOptionOutput;
 use wcf\system\option\IOptionHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
@@ -104,7 +105,7 @@ class UserListPage extends SortablePage {
        
        /**
         * list of users
-        * @var User[]
+        * @var UserProfile[]
         */
        public $users = [];
        
@@ -312,6 +313,8 @@ class UserListPage extends SortablePage {
                                                        if (isset($this->options[$column])) {
                                                                if ($this->options[$column]->outputClass) {
                                                                        $this->options[$column]->setOptionValue($user->getDecoratedObject());
+                                                                       
+                                                                       /** @var IUserOptionOutput $outputObj */
                                                                        $outputObj = $this->options[$column]->getOutputObject();
                                                                        $this->columnValues[$user->userID][$column] = $outputObj->getOutput($user->getDecoratedObject(), $this->options[$column]->getDecoratedObject(), $user->{$column});
                                                                }
index d6e18976f08603ac1741b7e236e2b24c569b8904..ba6ae4eaa51aedc6cba5143d58c787adfa1784e5 100644 (file)
@@ -82,6 +82,7 @@ class AJAXProxyAction extends AJAXInvokeAction {
        protected function sendResponse() {
                // add benchmark and debug data
                if (ENABLE_BENCHMARK) {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $this->response['benchmark'] = [
                                'executionTime' => WCF::getBenchmark()->getExecutionTime().'s',
                                'memoryUsage' => WCF::getBenchmark()->getMemoryUsage(),
@@ -91,6 +92,7 @@ class AJAXProxyAction extends AJAXInvokeAction {
                        ];
                        
                        if (ENABLE_DEBUG_MODE) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $this->response['benchmark']['items'] = WCF::getBenchmark()->getItems();
                        }
                }
index 1e50d472d01300dfb8402ff8e3746ae38dc4300d..8cde29746b1ae77f3d09f018d6c1ab8ca92b1203 100644 (file)
@@ -7,6 +7,7 @@ use wcf\data\user\User;
 use wcf\data\user\UserProfile;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
+use wcf\system\user\notification\event\IUserNotificationEvent;
 use wcf\system\user\notification\UserNotificationHandler;
 use wcf\system\WCF;
 use wcf\util\HeaderUtil;
@@ -80,6 +81,8 @@ class NotificationConfirmAction extends AbstractAction {
                }
                
                $className = $event->className;
+               
+               /** @var IUserNotificationEvent $notificationEvent */
                $notificationEvent = new $className($event);
                $notificationEvent->setObject(
                        $this->notification,
index 7a6620146cfa884d14ea0819dd2022bf68cc897a..d4f65bce6393c79da1d19f2e7d90c1206ca05c37 100644 (file)
@@ -52,8 +52,9 @@ namespace wcf\functions\exception {
        function logThrowable($e, &$logFile = null) {
                if ($logFile === null) $logFile = WCF_DIR . 'log/' . gmdate('Y-m-d', TIME_NOW) . '.txt';
                touch($logFile);
-
+               
                // don't forget to update ExceptionLogViewPage, when changing the log file format
+               /** @noinspection PhpUndefinedMethodInspection */
                $message = gmdate('r', TIME_NOW)."\n".
                        'Message: '.str_replace("\n", ' ', $e->getMessage())."\n".
                        'PHP version: '.phpversion()."\n".
@@ -62,7 +63,9 @@ namespace wcf\functions\exception {
                        'Referrer: '.(isset($_SERVER['HTTP_REFERER']) ? str_replace("\n", ' ', $_SERVER['HTTP_REFERER']) : '')."\n".
                        'User Agent: '.(isset($_SERVER['HTTP_USER_AGENT']) ? str_replace("\n", ' ', $_SERVER['HTTP_USER_AGENT']) : '')."\n".
                        'Peak Memory Usage: '.memory_get_peak_usage().'/'.FileUtil::getMemoryLimit()."\n";
+               /** @noinspection PhpUndefinedMethodInspection */
                do {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $message .= "======\n".
                        'Error Class: '.get_class($e)."\n".
                        'Error Message: '.str_replace("\n", ' ', $e->getMessage())."\n".
@@ -82,16 +85,16 @@ namespace wcf\functions\exception {
                                                        return $item;
                                        }
                                }, $item['args']);
-
+                               
                                return $item;
                        }, sanitizeStacktrace($e, true))))."\n";
                }
                while ($e = $e->getPrevious());
-
+               
                // calculate Exception-ID
                $exceptionID = sha1($message);
                $entry = "<<<<<<<<".$exceptionID."<<<<\n".$message."<<<<\n\n";
-
+               
                file_put_contents($logFile, $entry, FILE_APPEND);
                return $exceptionID;
        }
index 87d2d8ba4e1910e0fb7b726b45bd8dff32b9f961..8d78635b8915feaeb7517e88c1dbd943814f3681 100644 (file)
@@ -24,6 +24,7 @@ trait TLegacyUserPropertyAccess {
         */
        public function __get($name) {
                /** @noinspection PhpUndefinedClassInspection */
+               /** @noinspection PhpUndefinedMethodInspection */
                $value = parent::__get($name);
                if ($value !== null) {
                        return $value;
index 39d27d5f8e1b042321f0d93ead13845782eb5928..d72018ec3352eb71a2b1774e1739c0633f5a0e75 100644 (file)
@@ -68,6 +68,7 @@ trait TMultiCategoryObject {
                        
                        if (!empty($this->categoryIDs)) {
                                foreach ($this->categoryIDs as $categoryID) {
+                                       /** @noinspection PhpUndefinedMethodInspection */
                                        $this->categories[$categoryID] = $className::getCategory($categoryID);
                                }
                        }
@@ -83,6 +84,7 @@ trait TMultiCategoryObject {
                                $statement = WCF::getDB()->prepareStatement($sql);
                                $statement->execute([$this->getObjectID()]);
                                while ($categoryID = $statement->fetchColumn()) {
+                                       /** @noinspection PhpUndefinedMethodInspection */
                                        $this->categories[$categoryID] = $className::getCategory($categoryID);
                                }
                        }
index 67aaa9afc917a11af260aa93d6081ded2c2b6d56..6dfefbeff488cd6cf87cd48db8d37f3879f5c60f 100644 (file)
@@ -112,6 +112,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                
                // check max count of uploads
                $handler = new AttachmentHandler($this->parameters['objectType'], intval($this->parameters['objectID']), $this->parameters['tmpHash']);
+               /** @noinspection PhpUndefinedMethodInspection */
                if ($handler->count() + count($this->parameters['__files']->getFiles()) > $processor->getMaxCount()) {
                        throw new UserInputException('files', 'exceededQuota', [
                                'current' => $handler->count(),
@@ -120,6 +121,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                }
                
                // check max filesize, allowed file extensions etc.
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->parameters['__files']->validateFiles(new DefaultUploadFileValidationStrategy($processor->getMaxSize(), $processor->getAllowedExtensions()));
        }
        
@@ -140,6 +142,7 @@ class AttachmentAction extends AbstractDatabaseObjectAction implements ISortable
                        'tmpHash' => (!$this->parameters['objectID'] ? $this->parameters['tmpHash'] : '')
                ]);
                
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->parameters['__files']->saveFiles($saveStrategy);
                $attachments = $saveStrategy->getObjects();
                
index fdce42714bd9cdd6ac553de58bb6c610b1279ec7..7c234e3cad51a6b7a61797e9822af5ac195040ec 100644 (file)
@@ -66,7 +66,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
         * @inheritDoc
         */
        public function toggleContainer() {
-               $collapsibleObjectTypeName = $this->objects[0]->getProcessor()->getObjectTypeName('com.woltlab.wcf.collapsibleContent');
+               $collapsibleObjectTypeName = $this->getObjects()[0]->getProcessor()->getObjectTypeName('com.woltlab.wcf.collapsibleContent');
                if ($collapsibleObjectTypeName === null) {
                        throw new SystemException("Categories of this type don't support collapsing");
                }
@@ -89,8 +89,9 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
        public function update() {
                // check if showOrder needs to be recalculated
                if (count($this->objects) == 1 && isset($this->parameters['data']['parentCategoryID']) && isset($this->parameters['data']['showOrder'])) {
-                       if ($this->objects[0]->parentCategoryID != $this->parameters['data']['parentCategoryID'] || $this->objects[0]->showOrder != $this->parameters['data']['showOrder']) {
-                               $this->parameters['data']['showOrder'] = $this->objects[0]->updateShowOrder($this->parameters['data']['parentCategoryID'], $this->parameters['data']['showOrder']);
+                       $categoryEditor = $this->getObjects()[0];
+                       if ($categoryEditor->parentCategoryID != $this->parameters['data']['parentCategoryID'] || $categoryEditor->showOrder != $this->parameters['data']['showOrder']) {
+                               $this->parameters['data']['showOrder'] = $categoryEditor->updateShowOrder($this->parameters['data']['parentCategoryID'], $this->parameters['data']['showOrder']);
                        }
                }
                
index b707ee7be37ff271d96b4c26bf4f9e6ce5a1277d..d2516ee6457bdc87207421fa8793aff0328c3c0f 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\data\clipboard\item;
 use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\clipboard\ClipboardEditorItem;
 use wcf\system\clipboard\ClipboardHandler;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\UserInputException;
@@ -154,6 +155,7 @@ class ClipboardItemAction extends AbstractDatabaseObjectAction {
                                'items' => []
                        ];
                        
+                       /** @var ClipboardEditorItem $item */
                        foreach ($itemData['items'] as $showOrder => $item) {
                                $items['items'][$showOrder] = [
                                        'actionName' => $item->getName(),
index 1a881351edafa1bdf6f6c54431849bfbd5cb9cbe..4c54e29e2a60d3b92670553aec4d86be41c86985 100644 (file)
@@ -74,6 +74,7 @@ class LikeableCommentProvider extends AbstractObjectTypeProvider implements ILik
                foreach ($likeData as $objectTypeID => $likes) {
                        $objectType = CommentHandler::getInstance()->getObjectType($objectTypeID);
                        if (CommentHandler::getInstance()->getCommentManager($objectType->objectType) instanceof IViewableLikeProvider) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                CommentHandler::getInstance()->getCommentManager($objectType->objectType)->prepare($likes);
                        }
                }
index 93b687bcd528c16b2cb11b3dae2e2720deacb85f..fd8e9b49c0edf5b5f9c70f14ef2403dd2a4b6b56 100644 (file)
@@ -90,6 +90,7 @@ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider impleme
                foreach ($likeData as $objectTypeID => $likes) {
                        $objectType = CommentHandler::getInstance()->getObjectType($objectTypeID);
                        if (CommentHandler::getInstance()->getCommentManager($objectType->objectType) instanceof IViewableLikeProvider) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                CommentHandler::getInstance()->getCommentManager($objectType->objectType)->prepare($likes);
                        }
                }
index 4c0b274fdeaa20ed6afefc9eee72ea707be3f66c..267d667dc0930b99142546ca996870fdfc336a57 100644 (file)
@@ -5,6 +5,7 @@ use wcf\data\user\User;
 use wcf\data\AbstractDatabaseObjectAction;
 use wcf\data\IToggleAction;
 use wcf\system\cronjob\CronjobScheduler;
+use wcf\system\cronjob\ICronjob;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\WCF;
 use wcf\util\DateUtil;
@@ -126,6 +127,8 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
                        // it now time for executing
                        $cronjob->update(['state' => Cronjob::EXECUTING]);
                        $className = $cronjob->className;
+                       
+                       /** @var ICronjob $executable */
                        $executable = new $className();
                        
                        // execute cronjob
index 4dac5e79fb7386fd403f229e7615ff833f780c1c..44f490bb5dd068c36b1ef9b5ed00c1a37f110509 100644 (file)
@@ -74,8 +74,9 @@ class LabelAction extends AbstractDatabaseObjectAction implements ISortableActio
                
                // update showOrder if required
                if (count($this->objects) === 1 && isset($this->parameters['data']['groupID']) && isset($this->parameters['data']['showOrder'])) {
-                       if ($this->objects[0]->groupID != $this->parameters['data']['groupID'] || $this->objects[0]->showOrder != $this->parameters['data']['showOrder']) {
-                               $this->objects[0]->setShowOrder($this->parameters['data']['groupID'], $this->parameters['data']['showOrder']);
+                       $labelEditor = $this->getObjects()[0];
+                       if ($labelEditor->groupID != $this->parameters['data']['groupID'] || $labelEditor->showOrder != $this->parameters['data']['showOrder']) {
+                               $labelEditor->setShowOrder($this->parameters['data']['groupID'], $this->parameters['data']['showOrder']);
                        }
                }
        }
index d81a1c1af2890fb10c32e0d1b0231fc3a713dee7..cbe6d5e317e7e54baeb85e79fda8d4908a2a7a8e 100644 (file)
@@ -12,6 +12,7 @@ use wcf\system\language\LanguageFactory;
 use wcf\system\request\LinkHandler;
 use wcf\system\upload\DefaultUploadFileSaveStrategy;
 use wcf\system\upload\MediaUploadFileValidationStrategy;
+use wcf\system\upload\UploadFile;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
 
@@ -41,6 +42,7 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction,
                        throw new UserInputException('fileTypeFilters');
                }
                
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->parameters['__files']->validateFiles(new MediaUploadFileValidationStrategy(isset($this->parameters['fileTypeFilters']) ? $this->parameters['fileTypeFilters'] : []));
        }
        
@@ -56,6 +58,7 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction,
                        'username' => WCF::getUser()->username
                ]);
                
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->parameters['__files']->saveFiles($saveStrategy);
                $mediaFiles = $saveStrategy->getObjects();
                
@@ -81,6 +84,8 @@ class MediaAction extends AbstractDatabaseObjectAction implements ISearchAction,
                        }
                }
                
+               /** @var UploadFile[] $files */
+               /** @noinspection PhpUndefinedMethodInspection */
                $files = $this->parameters['__files']->getFiles();
                foreach ($files as $file) {
                        if ($file->getValidationErrorType()) {
index a77034124ac942ede25bbc5796a275be4cb2206d..55c57a6aaf4e3bb609b08cda394756b08ca9f3b1 100644 (file)
@@ -226,6 +226,7 @@ class PageAction extends AbstractDatabaseObjectAction implements ISearchAction,
         * @inheritDoc
         */
        public function getSearchResultList() {
+               /** @noinspection PhpUndefinedMethodInspection */
                return $this->pageEditor->getHandler()->lookup($this->parameters['data']['searchString']);
        }
        
index 0667c1376a6047d78288eb906724bfaa09862130..264b23915d0faa10e49919f82cd1e1b53317bc23 100644 (file)
@@ -51,6 +51,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                        }
                        else {
                                $d = DateUtil::getDateTimeByTimestamp($this->parameters['data']['startDate']);
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $d->add($this->parameters['subscription']->getDateInterval());
                                $this->parameters['data']['endDate'] = $d->getTimestamp();
                        }
index 12190a44995ea132e61e282e6dfd9ea7f7d9fa95..415389703c1bc8408972029b2518ff7e9c735a4f 100644 (file)
@@ -55,6 +55,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT
        
        /**
         * @inheritDoc
+        * @return      Smiley
         */
        public function current() {
                $objectID = $this->indexToObject[$this->index];
@@ -116,6 +117,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT
        
        /**
         * @inheritDoc
+        * @return      Smiley|null
         */
        public function search($objectID) {
                try {
index 9098c9906ef064b5f9e7340b740e5b651e933708..3708c1a580576a693f89a82bc78c7441b97da116 100644 (file)
@@ -46,8 +46,8 @@ class ActiveStyle extends DatabaseObjectDecorator {
         * @return      string
         */
        public function getPageLogo() {
-               if ($this->object->getVariable('pageLogo')) {
-                       return $this->getImage($this->object->getVariable('pageLogo'));
+               if ($this->getDecoratedObject()->getVariable('pageLogo')) {
+                       return $this->getImage($this->getDecoratedObject()->getVariable('pageLogo'));
                }
                
                return '';
index 1e26f142e52b4ff2586c7281462c2bb7ccdbebfa..73be5c9d8c75c534ac0ca06d0318d7e909e4a8e7 100644 (file)
@@ -12,6 +12,8 @@ use wcf\system\image\ImageHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\style\StyleHandler;
 use wcf\system\upload\DefaultUploadFileValidationStrategy;
+use wcf\system\upload\UploadFile;
+use wcf\system\upload\UploadHandler;
 use wcf\system\Regex;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
@@ -266,12 +268,15 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
                        $this->style = $styles[$this->parameters['styleID']];
                }
                
-               if (count($this->parameters['__files']->getFiles()) != 1) {
+               /** @var UploadHandler $uploadHandler */
+               $uploadHandler = $this->parameters['__files'];
+               
+               if (count($uploadHandler->getFiles()) != 1) {
                        throw new IllegalLinkException();
                }
                
                // check max filesize, allowed file extensions etc.
-               $this->parameters['__files']->validateFiles(new DefaultUploadFileValidationStrategy(PHP_INT_MAX, ['jpg', 'jpeg', 'png', 'gif']));
+               $uploadHandler->validateFiles(new DefaultUploadFileValidationStrategy(PHP_INT_MAX, ['jpg', 'jpeg', 'png', 'gif']));
        }
        
        /**
@@ -279,6 +284,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
         */
        public function upload() {
                // save files
+               /** @var UploadFile[] $files */
                $files = $this->parameters['__files']->getFiles();
                $file = $files[0];
                
@@ -359,6 +365,7 @@ class StyleAction extends AbstractDatabaseObjectAction implements IToggleAction,
         */
        public function uploadLogo() {
                // save files
+               /** @var UploadFile[] $files */
                $files = $this->parameters['__files']->getFiles();
                $file = $files[0];
                
index 71a678fb794da613d8761935425f60a96c193d15..5a24783ae5e84147bd276ba6be6095dfe2c3aac9 100644 (file)
@@ -169,6 +169,8 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                
                                case 'files':
                                        $elements = $xpath->query('child::*', $category);
+                                       
+                                       /** @var \DOMElement $element */
                                        foreach ($elements as $element) {
                                                $data[$element->tagName] = $element->nodeValue;
                                                if ($element->hasAttribute('path')) {
index 00497eae9657edcd1f3a7a6980413ffa8bdedb7f..3fac100a28a1634b65e17061a528ce0dcdbac804 100644 (file)
@@ -55,8 +55,12 @@ class UserActivityEventAction extends AbstractDatabaseObjectAction {
                if ($this->parameters['userID']) {
                        $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", [$this->parameters['userID']]);
                }
-               else if ($this->parameters['filteredByFollowedUsers'] && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
-                       $eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
+               else {
+                       /** @noinspection PhpUndefinedMethodInspection */
+                       if ($this->parameters['filteredByFollowedUsers'] && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
+                               /** @noinspection PhpUndefinedMethodInspection */
+                               $eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
+                       }
                }
                
                $eventList->readObjects();
index a170115bcf3e50281a7634d15ac48dbe2e8ccbca..b2825f3dcbc59bd5e6c2a65c37d82354e2bdf07a 100644 (file)
@@ -59,11 +59,13 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                        throw new PermissionDeniedException();
                }
                
+               /** @noinspection PhpUndefinedMethodInspection */
                if (count($this->parameters['__files']->getFiles()) != 1) {
                        throw new UserInputException('files');
                }
                
                // check max filesize, allowed file extensions etc.
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->parameters['__files']->validateFiles(new AvatarUploadFileValidationStrategy(PHP_INT_MAX, explode("\n", WCF::getSession()->getPermission('user.profile.avatar.allowedFileExtensions'))));
        }
        
@@ -72,6 +74,7 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
         */
        public function upload() {
                /** @var UploadFile[] $files */
+               /** @noinspection PhpUndefinedMethodInspection */
                $files = $this->parameters['__files']->getFiles();
                $userID = (!empty($this->parameters['userID']) ? intval($this->parameters['userID']) : WCF::getUser()->userID);
                $user = ($userID != WCF::getUser()->userID ? new User($userID) : WCF::getUser());
@@ -258,14 +261,17 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                
                // update user
                if ($avatarID) {
-                       $this->parameters['userEditor']->update([
+                       /** @var UserEditor $userEditor */
+                       $userEditor = $this->parameters['userEditor'];
+                       
+                       $userEditor->update([
                                'avatarID' => $avatarID,
                                'enableGravatar' => 0
                        ]);
                        
                        // delete old avatar
-                       if ($this->parameters['userEditor']->avatarID) {
-                               $action = new UserAvatarAction([$this->parameters['userEditor']->avatarID], 'delete');
+                       if ($userEditor->avatarID) {
+                               $action = new UserAvatarAction([$userEditor->avatarID], 'delete');
                                $action->executeAction();
                        }
                }
index 798bbb181c6f5c5e9755aa53425ecab9ecea785e..c4f30cb0f8f06744cf3325be1e7190eb35c035ea 100644 (file)
@@ -70,6 +70,7 @@ class UserOnline extends UserProfile {
                                if ($page !== null) {
                                        if ($page->getHandler() !== null && $page->getHandler() instanceof IOnlineLocationPageHandler) {
                                                // refer to page handler
+                                               /** @noinspection PhpUndefinedMethodInspection */
                                                $this->location = $page->getHandler()->getOnlineLocation($page, $this);
                                                return true;
                                        }
index 7b19290090bec86a08896e40919862daa69be12c..0b05eacdfe9c691e6c87ca505fc9a2ec7833b9e1 100644 (file)
@@ -166,6 +166,7 @@ class UsersOnlineList extends SessionList {
                                if (WCF::getUser()->userID) return true;
                                break;
                        case 2: // following
+                               /** @noinspection PhpUndefinedMethodInspection */
                                if (WCF::getUserProfileHandler()->isFollower($userID)) return true;
                                break;
                }
index 34a808f32f29284154384f5d4bd6df450357a53c..35c007fc1020a719b7961cc20d14c4961efe1c1c 100644 (file)
@@ -25,7 +25,7 @@ class NotificationSettingsForm extends AbstractForm {
        
        /**
         * list of notification events
-        * @var IUserNotificationEvent[]
+        * @var IUserNotificationEvent[][]
         */
        public $events = null;
        
index 8b2da8ef5ce74463a0b85d91b5078f295c6cdcf1..62dc53d2600a716b3148caa0c9eb99e1e1a36934 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\acp\form\UserAddForm;
+use wcf\data\object\type\ObjectType;
 use wcf\data\user\avatar\Gravatar;
 use wcf\data\user\avatar\UserAvatarAction;
 use wcf\data\user\group\UserGroup;
@@ -53,17 +54,20 @@ class RegisterForm extends UserAddForm {
        public $message = '';
        
        /**
-        * @inheritDoc
+        * captcha object type object
+        * @var ObjectType
         */
-       public $captchaObjectType = null;
+       public $captchaObjectType;
        
        /**
-        * @inheritDoc
+        * name of the captcha object type; if empty, captcha is disabled
+        * @var string
         */
        public $captchaObjectTypeName = CAPTCHA_TYPE;
        
        /**
-        * @inheritDoc
+        * true if captcha is used
+        * @var boolean
         */
        public $useCaptcha = REGISTER_USE_CAPTCHA;
        
@@ -135,9 +139,10 @@ class RegisterForm extends UserAddForm {
        }
        
        /**
-        * wcf\acp\form\AbstractOptionListForm::initOptionHandler()
+        * @inheritDoc
         */
        protected function initOptionHandler() {
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->optionHandler->setInRegistration();
                parent::initOptionHandler();
        }
index 69903202460fde0a19548d38a5ab20bedb8bb201..15d1f9fb2efb181705d5ffac8beef7a09a7386f7 100644 (file)
@@ -75,6 +75,7 @@ class UserSearchForm extends UserOptionListForm {
         * @inheritDoc
         */
        protected function initOptionHandler() {
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->optionHandler->enableSearchMode();
                $this->optionHandler->init();
        }
@@ -195,6 +196,7 @@ class UserSearchForm extends UserOptionListForm {
                        $option = $option['object'];
                        
                        $value = isset($this->optionHandler->optionValues[$option->optionName]) ? $this->optionHandler->optionValues[$option->optionName] : null;
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $this->optionHandler->getTypeObject($option->optionType)->getCondition($this->conditions, $option, $value);
                }
        }
index d1088c0142f4b86cbb02820462ac0009f74e499b..ed25a7aadeea3aba85a3638528f04a8ae91e8a6a 100644 (file)
@@ -6,6 +6,7 @@ use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\data\DatabaseObjectList;
 use wcf\system\edit\IHistorySavingObject;
+use wcf\system\edit\IHistorySavingObjectTypeProvider;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
@@ -120,7 +121,11 @@ class EditHistoryPage extends AbstractPage {
                }
                
                if (!$this->objectType) throw new IllegalLinkException();
+               
+               /** @var IHistorySavingObjectTypeProvider $processor */
                $processor = $this->objectType->getProcessor();
+               
+               /** @var IHistorySavingObject object */
                $this->object = $processor->getObjectByID($this->objectID);
                if (!$this->object->getObjectID()) throw new IllegalLinkException();
                $processor->checkPermissions($this->object);
index 826c92e535fccef05529ac24950665b2d5c4fafe..acf15d7034a77ef458aa2c4df77b5f13e5a755b7 100644 (file)
@@ -110,6 +110,7 @@ class UsersOnlineListPage extends SortablePage {
                        if ($userOnline->controller) {
                                $page = PageCache::getInstance()->getPage($userOnline->pageID);
                                if ($page !== null && $page->getHandler() !== null && $page->getHandler() instanceof IOnlineLocationPageHandler) {
+                                       /** @noinspection PhpUndefinedMethodInspection */
                                        $page->getHandler()->prepareOnlineLocation($page, $userOnline);
                                }
                        }
index 4302e5720ee067e74a35625ef505102340bc98e9..9ae560dcd18a0bb2775487122d0940d3aa153979 100644 (file)
@@ -101,6 +101,7 @@ class WCFSetup extends WCF {
                $this->getInstallationDirectories();
                $this->initLanguage();
                $this->initTPL();
+               /** @noinspection PhpUndefinedMethodInspection */
                self::getLanguage()->loadLanguage();
                $this->getPackageName();
                
index be54ef86e2c804ecbab1bd93d2e1daea392b479b..38a9bf9758bb8ae49a9d4b9d812ba941846625ef 100644 (file)
@@ -142,9 +142,11 @@ class CodeBBCode extends AbstractBBCode {
                }
                
                if ($parser->getOutputType() == 'text/html') {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $highlightedContent = self::fixMarkup(explode("\n", $className::getInstance()->highlight($content)));
                        
                        // show template
+                       /** @noinspection PhpUndefinedMethodInspection */
                        WCF::getTPL()->assign([
                                'lineNumbers' => self::makeLineNumbers($content, $this->startLineNumber),
                                'startLineNumber' => $this->startLineNumber,
index 00678737f4c03855d1bb0bf3b0f5d4707a73c642..de9dd81750218d84483c6fe5cc599af3ed15022c 100644 (file)
@@ -48,6 +48,7 @@ class MessageParser extends BBCodeParser {
                        foreach ($smilies as $categoryID => $categorySmilies) {
                                if ($categories[$categoryID ?: null]->isDisabled) continue;
                                
+                               /** @var Smiley $smiley */
                                foreach ($categorySmilies as $smiley) {
                                        foreach ($smiley->smileyCodes as $smileyCode) {
                                                $this->smilies[$smileyCode] = '<img src="'.$smiley->getURL().'" alt="'.StringUtil::encodeHTML($smiley->smileyCode).'" />';
index 2430a3e7931d3e8178652b618f2e82182662c3e9..53c6875e95e6ebeb00714519efd227b983a63654 100644 (file)
@@ -60,6 +60,7 @@ class SimpleMessageParser extends SingletonFactory {
                        foreach ($smilies as $categoryID => $categorySmilies) {
                                if ($categories[$categoryID ?: null]->isDisabled) continue;
                                
+                               /** @var Smiley $smiley */
                                foreach ($categorySmilies as $smiley) {
                                        foreach ($smiley->smileyCodes as $smileyCode) {
                                                $this->smilies[$smileyCode] = '<img src="'.$smiley->getURL().'" alt="'.StringUtil::encodeHTML($smiley->smileyCode).'" />';
index 07b6311850c0ecb9238b3b5657fbc8c363e2af4e..a1fa78a301c9737af6d701083634877465753959 100644 (file)
@@ -47,6 +47,7 @@ class HtmlHighlighter extends XmlHighlighter {
                        
                        $class = '\wcf\system\bbcode\highlighter\\'.ucfirst($type).'Highlighter';
                        
+                       /** @noinspection PhpUndefinedMethodInspection */
                        return $openingTag.StringStack::pushToStringStack('<span class="'.$type.'Highlighter">'.$class::getInstance()->highlight($content).'</span>', 'htmlHighlighter'.ucfirst($type)).$closingTag;
                }));
        }
index f936d6e92861024024213a9f698833a2f7c19fb9..b46523bdaf49c65d99b9d16f7bbde70bd2267cd9 100644 (file)
@@ -30,6 +30,7 @@ class FollowingsOnlineBoxController extends AbstractDatabaseObjectListBoxControl
         */
        protected function getObjectList() {
                $objectList = new UsersOnlineList();
+               /** @noinspection PhpUndefinedMethodInspection */
                $objectList->getConditionBuilder()->add('session.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
                
                return $objectList;
@@ -46,6 +47,7 @@ class FollowingsOnlineBoxController extends AbstractDatabaseObjectListBoxControl
         * @inheritDoc
         */
        public function hasContent() {
+               /** @noinspection PhpUndefinedMethodInspection */
                if (!MODULE_USERS_ONLINE || !WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList') || empty(WCF::getUserProfileHandler()->getFollowingUsers())) {
                        return false;
                }
index 5f54fa8b66c9120fdda93598b52f9931dc921e43..fcf8f47fe1bfa616a8c023c00b51ca09411c3932 100644 (file)
@@ -34,6 +34,7 @@ class PageCommentListBoxController extends AbstractDatabaseObjectListBoxControll
         * @inheritDoc
         */
        protected function getTemplate() {
+               /** @noinspection PhpUndefinedMethodInspection */
                return WCF::getTPL()->fetch('boxPageComments', 'wcf', [
                        'commentCanAdd' => WCF::getSession()->getPermission('user.pageComment.canAddComment'),
                        'commentList' => $this->objectList,
index 520947ba5d78539fba86bbe8cb82db993bd56081..86f992c0dfc2621fda0d0f6d61e48f2589a4ccb2 100644 (file)
@@ -55,6 +55,7 @@ class RecentActivityListBoxController extends AbstractDatabaseObjectListBoxContr
         * @inheritDoc
         */
        public function __construct() {
+               /** @noinspection PhpUndefinedMethodInspection */
                if (WCF::getUser()->userID && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
                        $this->canFilterByFollowedUsers = true;
                }
@@ -85,6 +86,7 @@ class RecentActivityListBoxController extends AbstractDatabaseObjectListBoxContr
         */
        public function getTemplate() {
                if ($this->getBox()->position == 'contentTop' || $this->getBox()->position == 'contentBottom') {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        return WCF::getTPL()->fetch('boxRecentActivity', 'wcf', [
                                'canFilterByFollowedUsers' => $this->canFilterByFollowedUsers,
                                'eventList' => $this->objectList,
@@ -112,6 +114,7 @@ class RecentActivityListBoxController extends AbstractDatabaseObjectListBoxContr
        protected function readObjects() {
                // apply filter
                if (($this->getBox()->position == 'contentTop' || $this->getBox()->position == 'contentBottom') && $this->filteredByFollowedUsers) {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $this->objectList->getConditionBuilder()->add('user_activity_event.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
                }
                
index 49a62645e759aa301cd9dcc5e3dc12b41acecf52..fa70fd20f800e012c7230b495453dea0f078fb77 100644 (file)
@@ -23,6 +23,7 @@ class TodaysFollowingBirthdaysBoxController extends TodaysBirthdaysBoxController
         * @inheritDoc
         */
        protected function filterUserIDs(&$userIDs) {
+               /** @noinspection PhpUndefinedMethodInspection */
                $userIDs = array_intersect($userIDs, WCF::getUserProfileHandler()->getFollowingUsers());
        }
 }
index dea03e54f7916e99cc471b7e10f2996525f9bb9c..f13fae9b2e0932bf2bb93a081f53b87fecf0f5ad 100644 (file)
@@ -27,6 +27,7 @@ class CategoryACLOptionCacheBuilder extends AbstractCacheBuilder {
                        }
                        
                        $aclOptions = ACLHandler::getInstance()->getPermissions(ACLHandler::getInstance()->getObjectTypeID($aclObjectType), array_keys($categories));
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $options = $aclOptions['options']->getObjects();
                        
                        foreach (['group', 'user'] as $type) {
index 493a9fb958e813fcd799f4ec1321744338243537..db423a4e25c176bf9a8a271d769e61cd600ec50e 100644 (file)
@@ -38,6 +38,7 @@ class LabelCacheBuilder extends AbstractCacheBuilder {
                );
                
                // store options
+               /** @noinspection PhpUndefinedMethodInspection */
                $data['options'] = $permissions['options']->getObjects();
                
                // assign permissions for each label group
@@ -59,6 +60,7 @@ class LabelCacheBuilder extends AbstractCacheBuilder {
                        $labelList = new LabelList();
                        $labelList->readObjects();
                        foreach ($labelList as $label) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $data['groups'][$label->groupID]->addLabel($label);
                        }
                }
index 88319d707e83682a116f57b05c49892d9b57910a..56657e8d79d4f6a78a186b1693924514075daa14 100644 (file)
@@ -106,6 +106,7 @@ class WorkerCLICommand implements IArgumentedCLICommand {
                        }
                }
                
+               /** @var IWorker $worker */
                $worker = new $class($parameters);
                $worker->validate();
                $worker->getProgress(); // make sure objects are counted
index 76e087519aa73be0c62c19465a9a945c679afe17..66e5e0a0fa40bf4e62aa898e7a6a68a2c51dc292 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\system\clipboard;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\data\DatabaseObject;
+use wcf\data\DatabaseObjectList;
 use wcf\system\cache\builder\ClipboardActionCacheBuilder;
 use wcf\system\cache\builder\ClipboardPageCacheBuilder;
 use wcf\system\clipboard\action\IClipboardAction;
@@ -238,6 +239,7 @@ class ClipboardHandler extends SingletonFactory {
                
                // read objects
                foreach ($data as $objectType => $objectData) {
+                       /** @var DatabaseObjectList $objectList */
                        $objectList = new $objectData['className']();
                        $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias() . "." . $objectList->getDatabaseTableIndexName() . " IN (?)", [$objectData['objectIDs']]);
                        $objectList->readObjects();
@@ -342,19 +344,22 @@ class ClipboardHandler extends SingletonFactory {
                // execute actions
                $editorData = [];
                foreach ($actions as $actionData) {
+                       /** @var IClipboardAction $clipboardAction */
+                       $clipboardAction = $actionData['object'];
+                       
                        // get accepted objects
-                       $typeName = $actionData['object']->getTypeName();
+                       $typeName = $clipboardAction->getTypeName();
                        if (!isset($this->markedItems[$typeName]) || empty($this->markedItems[$typeName])) continue;
                        
                        if (!isset($editorData[$typeName])) {
                                $editorData[$typeName] = [
-                                       'label' => $actionData['object']->getEditorLabel($this->markedItems[$typeName]),
+                                       'label' => $clipboardAction->getEditorLabel($this->markedItems[$typeName]),
                                        'items' => []
                                ];
                        }
                        
                        foreach ($actionData['actions'] as $actionObject) {
-                               $data = $actionData['object']->execute($this->markedItems[$typeName], $actionObject);
+                               $data = $clipboardAction->execute($this->markedItems[$typeName], $actionObject);
                                if ($data === null) {
                                        continue;
                                }
index 0b2d42c111b68f4cb480184695b44e48ddf128c0..9fe3ad9697651277f5a8ee46b865086556d39267 100644 (file)
@@ -32,6 +32,7 @@ abstract class AbstractMultiCategoryCondition extends AbstractMultiSelectConditi
         * @inheritDoc
         */
        protected function getFieldElement() {
+               /** @noinspection PhpUndefinedMethodInspection */
                $categoryTree = (new $this->nodeTreeClassname($this->objectType))->getIterator();
                $categoryCount = iterator_count($categoryTree);
                
index baee7c8134f559870fb789373c9fce0551185090..53341fea2bd7ec08c5cee72b7e7f5c9fbdd80d4f 100644 (file)
@@ -52,6 +52,7 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
                        $option = $option['object'];
                        
                        if (isset($optionValues[$option->optionName])) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $this->optionHandler->getTypeObject($option->optionType)->addCondition($objectList, $option, $optionValues[$option->optionName]);
                        }
                }
@@ -68,6 +69,7 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
                        $option = $option['object'];
                        
                        if (isset($optionValues[$option->optionName])) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                if (!$this->optionHandler->getTypeObject($option->optionType)->checkUser($user, $option, $optionValues[$option->optionName])) {
                                        $checkSuccess = false;
                                        break;
@@ -89,6 +91,7 @@ class UserOptionsCondition extends AbstractMultipleFieldsCondition implements IC
                        $option = $option['object'];
                        
                        if (isset($optionValues[$option->optionName])) {
+                               /** @noinspection PhpUndefinedMethodInspection */
                                $conditionData = $this->optionHandler->getTypeObject($option->optionType)->getConditionData($option, $optionValues[$option->optionName]);
                                if ($conditionData !== null) {
                                        $data[$option->optionName] = $conditionData;
index edf8eb1329fd934b9be1a6c78c09e98d7d5855aa..9fba116efc51e216ce63370155eeae5dc5b79dc4 100644 (file)
@@ -10,6 +10,7 @@ use wcf\data\user\UserProfile;
 use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\mail\Mail;
+use wcf\system\user\notification\event\IUserNotificationEvent;
 use wcf\system\user\notification\UserNotificationHandler;
 use wcf\system\WCF;
 use wcf\util\StringUtil;
@@ -129,6 +130,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                
                // load objects associated with each object type
                foreach ($objectTypes as $objectType => $objectData) {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $objectTypes[$objectType]['objects'] = $objectData['objectType']->getObjectsByIDs($objectData['objectIDs']);
                }
                
@@ -155,6 +157,8 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                                $notification = $notificationObjects[$notificationID];
                                
                                $className = $eventObjects[$notification->eventID]->className;
+                               
+                               /** @var IUserNotificationEvent $class */
                                $class = new $className($eventObjects[$notification->eventID]);
                                $class->setObject(
                                        $notification,
index f31d36845fbc6e6194d12549c2fa7069cbf7061b..d6f1372a20457595a5dad066caa8aad98a95a7fc 100644 (file)
@@ -300,6 +300,8 @@ class ImageAdapter implements IImageAdapter {
                }
                
                $adapterClassName = get_class($this->adapter);
+               
+               /** @var IImageAdapter $overlayImage */
                $overlayImage = new $adapterClassName();
                $overlayImage->loadFile($file);
                $overlayHeight = $overlayImage->getHeight();
index 5266e4925e27ecf4ccd69e864de0078f447ef6a9..2c78d14f6e2dd6a116e0ed9aeb06b2dc347bd6ac 100644 (file)
@@ -25,10 +25,12 @@ use wcf\system\exception\SystemException;
  * 
  * @method     boolean         close()
  * @method     boolean         eof()
+ * @method     integer         filesize()
  * @method     string          gets($length = null)
  * @method     resource        open($mode, $use_include_path = false, $context = null)
- * @method     integer         seek($offset, $whence = SEEK_SET)
  * @method     string          read($length)
+ * @method     integer         seek($offset, $whence = SEEK_SET)
+ * @method     array           stat()
  * @method     integer         tell()
  * @method     boolean         touch($time = 0, $atime = 0)            note: default value of `$time` actually is `time()`
  * @method     integer         write($string, $length = null)
index 12a7d87f2820b3440d327696222eb00a6d1130a3..2b981ccfabbc35c372a05fdf4514338d8e080704 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace wcf\system\label\object\type;
-use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
 
 /**
@@ -22,7 +21,7 @@ class LabelObjectTypeContainer implements \Countable, \Iterator {
        
        /**
         * list of object types
-        * @var ObjectType[]
+        * @var LabelObjectType[]
         */
        public $objectTypes = [];
        
@@ -104,6 +103,7 @@ class LabelObjectTypeContainer implements \Countable, \Iterator {
        
        /**
         * @inheritDoc
+        * @return      LabelObjectType
         */
        public function current() {
                return $this->objectTypes[$this->position];
index 0232c9cc9639fb2d792bf48b824b4c89627487fb..f3f3f2104f98fba5422285742f6b9e7d24dc48de 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\system\message;
 use wcf\data\DatabaseObjectDecorator;
 use wcf\data\IAttachmentMessageQuickReplyAction;
+use wcf\data\IDatabaseObjectAction;
 use wcf\data\IMessage;
 use wcf\data\IMessageQuickReplyAction;
 use wcf\data\IVisitableObjectAction;
@@ -215,7 +216,7 @@ class QuickReplyManager extends SingletonFactory {
                if ($pageNo == $parameters['pageNo']) {
                        // check for additional messages
                        $messageList = $object->getMessageList($this->container, $parameters['lastPostTime']);
-                               
+                       
                        // calculate start index
                        $startIndex = $count - (count($messageList) - 1);
                        
@@ -234,6 +235,7 @@ class QuickReplyManager extends SingletonFactory {
                        
                        // update visit time (messages shouldn't occur as new upon next visit)
                        if (is_subclass_of($containerActionClassName, IVisitableObjectAction::class)) {
+                               /** @var IDatabaseObjectAction $containerAction */
                                $containerAction = new $containerActionClassName([($this->container instanceof DatabaseObjectDecorator ? $this->container->getDecoratedObject() : $this->container)], 'markAsRead');
                                $containerAction->executeAction();
                        }
index 1dda3e9c168a9aa137c8a80e27d8f2fa2803d7b9..1eec6596b889ad8247aaa92069388bfca8b32a65 100644 (file)
@@ -11,6 +11,17 @@ use wcf\data\IMessage;
  * @package    com.woltlab.wcf
  * @subpackage system.message.quote
  * @category   Community Framework
+ * 
+ * Note: We cannot use mixin here as that causes errors about methods not being implemented.
+ * @method     string          getExcerpt($maxLength = 255)
+ * @method     string          getFormattedMessage()
+ * @method     string          getLink()
+ * @method     string          getMessage()
+ * @method     integer         getTime()
+ * @method     string          getTitle()
+ * @method     integer         getUserID()
+ * @method     string          getUsername()
+ * @method     boolean         isVisible()
  */
 class QuotedMessage implements \Countable, \Iterator {
        /**
index f45d2a81b92a970a89424dae696e2c01cf7c41cd..cac8a40791f343fbf137c2c760f4d8d2cc0e8796 100644 (file)
@@ -227,6 +227,8 @@ class UserOptionHandler extends OptionHandler {
         * @inheritDoc
         */
        protected function checkVisibility(Option $option) {
+               /** @var UserOption $option */
+               
                if ($option->isDisabled) {
                        return false;
                }
index fc960405eb07f083bf511bb448df5fbe67137692..a2f63818c12175c9b7bd88dc6831df2ee4498fc0 100644 (file)
@@ -11,6 +11,7 @@ use wcf\system\event\EventHandler;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\SystemException;
 use wcf\system\language\LanguageFactory;
+use wcf\system\package\plugin\IPackageInstallationPlugin;
 use wcf\system\setup\Uninstaller;
 use wcf\system\style\StyleHandler;
 use wcf\system\user\storage\UserStorageHandler;
@@ -115,6 +116,7 @@ class PackageUninstallationDispatcher extends PackageInstallationDispatcher {
         * @inheritDoc
         */
        protected function executePIP(array $nodeData) {
+               /** @var IPackageInstallationPlugin $pip */
                $pip = new $nodeData['className']($this);
                
                $pip->uninstall();
index 6c3a47880763a41e94a45a355c34f69165a10bf8..91d1f8e138be5f418ff3be2a8cca1b2028f6cab4 100644 (file)
@@ -297,6 +297,8 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                        
                                        case 'requiredpackages':
                                                $requiredPackages = $xpath->query('child::*', $child);
+                                               
+                                               /** @var \DOMElement $requiredPackage */
                                                foreach ($requiredPackages as $requiredPackage) {
                                                        $minVersion = $requiredPackage->getAttribute('minversion');
                                                        $required = $requiredPackage->nodeValue;
index b4b8aadda3424e0bd138912c8543b39f7b94fb0f..5b5761848bcff8bb92bae6d3977a19d1b7b07260 100644 (file)
@@ -89,7 +89,7 @@ class ACPSearchResultList implements \Countable, \Iterator {
         * Sorts results by title.
         */
        public function sort() {
-               usort($this->results, function($a, $b) {
+               usort($this->results, function(ACPSearchResult $a, ACPSearchResult $b) {
                        return strcmp($a->getTitle(), $b->getTitle());
                });
        }
index bec4cad3b9ed376d4e0c6a3558427b345466e6da..945044f6060660d59fa31a1946ed67848ae0344e 100644 (file)
@@ -95,6 +95,7 @@ abstract class AbstractCategorizedACPSearchResultProvider extends AbstractACPSea
                }
                
                // read categories
+               /** @var DatabaseObjectList $categoryList */
                $categoryList = new $this->listClassName();
                $categoryList->readObjects();
                
index 8e26b833b79d819a7a2d9442c35889c8bd498fe3..75e700ccf0db0a6ccf00fb11a9a20ab8171899e2 100644 (file)
@@ -63,6 +63,8 @@ class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider im
                $statement->execute($conditions->getParameters());
                
                $menuItems = ACPMenu::getInstance()->menuItemList;
+               
+               /** @var ACPMenuItem $menuItem */
                while ($menuItem = $statement->fetchObject(ACPMenuItem::class)) {
                        // only valid menu items exist in TreeMenu::$menuItemList,
                        // so no need to call AbstractACPSearchResultProvider::validate()
index 641565393a60fa24e3e4dd66383d8308f0ea4954..0d2071aa22e65d063ed9394671b5f77d5c86b4cc 100644 (file)
@@ -59,6 +59,7 @@ class PackageACPSearchResultProvider implements IACPSearchResultProvider {
                        '%'.$query.'%'
                ], $conditions->getParameters()));
                
+               /** @var Package $package */
                while ($package = $statement->fetchObject(Package::class)) {
                        $results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', [
                                'id' => $package->packageID,
index 5a53e9644d887c26ae48a5b0feb9be69416d04cc..5dfbd445fc3c8af96071ec6b33600a4172beecd3 100644 (file)
@@ -83,6 +83,7 @@ class TagCloud {
         */
        public function getTags($slice = 50) {
                // slice list
+               /** @var TagCloudTag[] $tags */
                $tags = array_slice($this->tags, 0, min($slice, count($this->tags)));
                
                // get min / max counter
index 1bb1f79468de22bab066087d8fe3a33d71cf0926..b1ba5fce892cefdcca9cfc0aafba31a2abc9910a 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\upload;
 use wcf\data\AbstractDatabaseObjectAction;
+use wcf\data\IDatabaseObjectAction;
 use wcf\data\IFile;
 use wcf\data\IThumbnailFile;
 use wcf\system\exception\ImplementationException;
@@ -74,6 +75,7 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy {
                        throw new ParentClassException($this->actionClassName, AbstractDatabaseObjectAction::class);
                }
                
+               /** @noinspection PhpUndefinedMethodInspection */
                $this->editorClassName = (new $this->actionClassName([], ''))->getClassName();
                $baseClass = call_user_func([$this->editorClassName, 'getBaseClass']);
                if (!is_subclass_of($baseClass, IFile::class)) {
@@ -117,9 +119,12 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy {
                        }
                }
                
+               /** @var IDatabaseObjectAction $action */
                $action = new $this->actionClassName([], 'create', [
                        'data' => $data
                ]);
+               
+               /** @var IThumbnailFile $object */
                $object = $action->executeAction()['returnValues'];
                
                $dir = dirname($object->getLocation());
@@ -245,6 +250,7 @@ class DefaultUploadFileSaveStrategy implements IUploadFileSaveStrategy {
                }
                
                if (!empty($updateData)) {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        (new $this->editorClassName($file))->update($updateData);
                }
        }
index bbdaa57d24084bda2400b7a3576facc90c201eb6..ce1d15147319b7cc6260b634e5650410916a4306 100644 (file)
@@ -81,7 +81,7 @@ class UserGroupAssignmentHandler extends SingletonFactory {
        /**
         * Returns the list of grouped user group assignment condition object types.
         * 
-        * @return      array
+        * @return      ObjectType[][]
         */
        public function getGroupedObjectTypes() {
                return $this->groupedObjectTypes;
index c0c8cee6a4a496a02200e23de18e35fe27c972c5..2281c350211aa11eb98be07bb202f35c3e553281 100644 (file)
@@ -36,13 +36,13 @@ use wcf\util\StringUtil;
 class UserNotificationHandler extends SingletonFactory {
        /**
         * list of available object types
-        * @var IUserNotificationEvent[][]
+        * @var IUserNotificationObjectType[]
         */
        protected $availableObjectTypes = [];
        
        /**
         * list of available events
-        * @var array
+        * @var IUserNotificationEvent[][]
         */
        protected $availableEvents = [];
        
@@ -440,6 +440,7 @@ class UserNotificationHandler extends SingletonFactory {
                
                // load objects associated with each object type
                foreach ($objectTypes as $objectType => $objectData) {
+                       /** @noinspection PhpUndefinedMethodInspection */
                        $objectTypes[$objectType]['objects'] = $objectData['objectType']->getObjectsByIDs($objectData['objectIDs']);
                }
                
@@ -499,9 +500,11 @@ class UserNotificationHandler extends SingletonFactory {
                
                // check access
                foreach ($notifications as $index => $notificationData) {
-                       if (!$notificationData['event']->checkAccess()) {
-                               if ($notificationData['event']->deleteNoAccessNotification()) {
-                                       $deleteNotifications[] = $notificationData['event']->getNotification();
+                       /** @var IUserNotificationEvent $event */
+                       $event = $notificationData['event'];
+                       if (!$event->checkAccess()) {
+                               if ($event->deleteNoAccessNotification()) {
+                                       $deleteNotifications[] = $event->getNotification();
                                }
                                
                                unset($notifications[$index]);