Improve/Fix variable and property type documentation
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 21:01:04 +0000 (23:01 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 21:01:04 +0000 (23:01 +0200)
19 files changed:
wcfsetup/install/files/lib/data/language/SetupLanguage.class.php
wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php
wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php
wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php
wcfsetup/install/files/lib/system/ad/AdHandler.class.php
wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/LabelCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php
wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php
wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php
wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php
wcfsetup/install/files/lib/system/payment/method/PaymentMethodHandler.class.php
wcfsetup/install/files/lib/system/search/SearchEngine.class.php
wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php
wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php
wcfsetup/install/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php

index fe9a9df20bc17a92878a6cb9a8cfffacf53085fb..32eeb31f78aba818263152d7d07382a51d4b2eb1 100644 (file)
@@ -48,6 +48,8 @@ class SetupLanguage extends Language {
                        // get language items
                        $categoriesToCache = [];
                        $items = $xml->xpath()->query('/ns:language/ns:category/ns:item');
+                       
+                       /** @var \DOMElement $item */
                        foreach ($items as $item) {
                                $categoriesToCache[] = [
                                        'name' => $item->getAttribute('name'),
index 3dda4e2ed77e839beea845fb7947f7d8ed558c6d..e2af13c03fa3fff1ea79806b15660242983c9120 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\data\object\type;
+use wcf\data\DatabaseObjectList;
 
 /**
  * Abstract implementation of an object type provider.
@@ -49,6 +50,7 @@ abstract class AbstractObjectTypeProvider implements IObjectTypeProvider {
                $tableAlias = call_user_func([$this->className, 'getDatabaseTableAlias']);
                $tableIndex = call_user_func([$this->className, 'getDatabaseTableIndexName']);
                
+               /** @var DatabaseObjectList $objectList */
                $objectList = new $this->listClassName();
                if ($this->decoratorClassName) {
                        $objectList->decoratorClassName = $this->decoratorClassName;
index 590c4d1e78db6bba6f284b7d9a27280b5f4a1e1c..ab2ae1efed410a26a6982e0f432eacf02f1373dd 100644 (file)
@@ -19,7 +19,7 @@ use wcf\system\SingletonFactory;
 class SmileyCache extends SingletonFactory {
        /**
         * cached smilies
-        * @var array
+        * @var Smiley[][]
         */
        protected $cachedSmilies = [];
        
@@ -60,7 +60,7 @@ class SmileyCache extends SingletonFactory {
        /**
         * Returns all smilies.
         * 
-        * @return      array
+        * @return      Smiley[][]
         */
        public function getSmilies() {
                return $this->cachedSmilies;
index d7568f127e3ba59562f6fa8e65cd122733b8aba0..e2fe3effab55526633b9f41bc0d95cd070ed9183 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\data\user;
 use wcf\data\IGroupedUserListAction;
+use wcf\data\user\option\UserOption;
 use wcf\system\cache\builder\UserOptionCacheBuilder;
 use wcf\system\exception\UserInputException;
 use wcf\system\user\UserBirthdayCache;
@@ -47,16 +48,17 @@ class UserBirthdayAction extends UserProfileAction implements IGroupedUserListAc
                $users = [];
                $userOptions = UserOptionCacheBuilder::getInstance()->getData([], 'options');
                if (isset($userOptions['birthday'])) {
+                       /** @var UserOption $birthdayUserOption */
                        $birthdayUserOption = $userOptions['birthday'];
                        
                        $userIDs = UserBirthdayCache::getInstance()->getBirthdays($month, $day);
                        $userList = new UserProfileList();
                        $userList->setObjectIDs($userIDs);
                        $userList->readObjects();
-                               
+                       
                        foreach ($userList->getObjects() as $user) {
                                $birthdayUserOption->setUser($user->getDecoratedObject());
-                                       
+                               
                                if (!$user->isProtected() && $birthdayUserOption->isVisible() && $user->getAge($year) >= 0) {
                                        $users[] = $user;
                                }
index 7a15f79b828b3dd2521ba3aac2dc495cd32ee5f2..9ada63005d19dc6d4ebaf79ae2c67bdffd3ca123 100644 (file)
@@ -10,6 +10,7 @@ use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
 use wcf\system\image\ImageHandler;
 use wcf\system\upload\AvatarUploadFileValidationStrategy;
+use wcf\system\upload\UploadFile;
 use wcf\system\user\storage\UserStorageHandler;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
@@ -66,7 +67,7 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
         * Handles uploaded attachments.
         */
        public function upload() {
-               // save files
+               /** @var UploadFile[] $files */
                $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());
index b35ae832e7e9e7c2bcdd763bbd1e00fcc6263b03..b97668352403a5381884118225519bb189d68ac0 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\ad;
+use wcf\data\ad\Ad;
 use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\system\cache\builder\AdCacheBuilder;
@@ -20,7 +21,7 @@ use wcf\system\WCF;
 class AdHandler extends SingletonFactory {
        /**
         * list of ad objects grouped by ad location
-        * @var array
+        * @var Ad[][]
         */
        protected $ads = [];
        
index c7acb9adb7b8742907b3b41232e3e9d8163c28e5..d7bc3d6a79d321d683cc96fe0b905083ae3f82e0 100644 (file)
@@ -37,6 +37,8 @@ class EventListenerCacheBuilder extends AbstractCacheBuilder {
                        ORDER BY        niceValue ASC, listenerClassName ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
+               
+               /** @var EventListener $eventListener */
                while ($eventListener = $statement->fetchObject(EventListener::class)) {
                        $eventNames = $eventListener->getEventNames();
                        
index 8306e9fe181eb06cbed01dc66476db1d66682687..493a9fb958e813fcd799f4ec1321744338243537 100644 (file)
@@ -41,6 +41,7 @@ class LabelCacheBuilder extends AbstractCacheBuilder {
                $data['options'] = $permissions['options']->getObjects();
                
                // assign permissions for each label group
+               /** @var ViewableLabelGroup $group */
                foreach ($data['groups'] as $groupID => $group) {
                        // group permissions
                        if (isset($permissions['group'][$groupID])) {
index 56b1d33a8fbd1d1ab9b67475c72705105de34bc3..01af09e3cf121171f29b619fbb2841b54659948c 100644 (file)
@@ -26,6 +26,8 @@ class SmileyCacheBuilder extends AbstractCacheBuilder {
                        ORDER BY        showOrder";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
+               
+               /** @var Smiley $object */
                while ($object = $statement->fetchObject(Smiley::class)) {
                        $object->smileyCodes = $object->getAliases();
                        $object->smileyCodes[] = $object->smileyCode;
index 28a7328e3849bf197a721036a5603e212ace3514..2d685620240a8b1898400d89e9ce78c6ffd57e0d 100644 (file)
@@ -33,6 +33,8 @@ class RefreshSearchRobotsCronjob implements ICronjob {
                if (!empty($spiders)) {
                        $existingSpiders = SpiderCacheBuilder::getInstance()->getData();
                        $statementParameters = [];
+                       
+                       /** @var \DOMElement $spider */
                        foreach ($spiders as $spider) {
                                $identifier = mb_strtolower($spider->getAttribute('ident'));
                                $name = $xpath->query('ns:name', $spider)->item(0);
index 5384295f525ea361892f5d5abb1a1a8d31f94af4..f6df93c565abd709da54e3111f7ac37f8248229c 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\menu\user;
+use wcf\data\user\menu\item\UserMenuItem;
 use wcf\system\cache\builder\UserMenuCacheBuilder;
 use wcf\system\menu\ITreeMenuItem;
 use wcf\system\menu\TreeMenu;
@@ -28,6 +29,8 @@ class UserMenu extends TreeMenu {
         * @inheritDoc
         */
        protected function checkMenuItem(ITreeMenuItem $item) {
+               /** @var UserMenuItem $item */
+               
                if (!parent::checkMenuItem($item)) return false;
                
                return $item->getProcessor()->isVisible();
index 12358c0138eecfc6e7c639a24a672e56867cbc43..7d6ccf7a8f862000ec2e8cdd3c1c8ddbdc276584 100644 (file)
@@ -34,6 +34,7 @@ abstract class AbstractCategoryMultiSelectOptionType extends AbstractOptionType
         * @inheritDoc
         */
        public function getFormElement(Option $option, $value) {
+               /** @var CategoryNodeTree $categoryTree */
                $categoryTree = new $this->nodeTreeClassname($this->objectType);
                $categoryList = $categoryTree->getIterator();
                $categoryList->setMaxDepth(0);
index f76b0f25d319b9889f658cdc8457b0091327f913..06fce44830be184656dbda78b1ea6a21f50deff1 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\payment\method;
+use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\system\SingletonFactory;
 use wcf\system\WCF;
@@ -17,13 +18,13 @@ use wcf\system\WCF;
 class PaymentMethodHandler extends SingletonFactory {
        /**
         * payment methods
-        * @var array
+        * @var IPaymentMethod[]
         */
        protected $paymentMethods = [];
        
        /**
         * payment method object types
-        * @var array
+        * @var ObjectType[]
         */
        protected $objectTypes = [];
        
@@ -43,7 +44,7 @@ class PaymentMethodHandler extends SingletonFactory {
        /**
         * Returns the available payment methods.
         * 
-        * @return      array
+        * @return      IPaymentMethod[]
         */
        public function getPaymentMethods() {
                return $this->paymentMethods;
index e36fcfa215197f82f2a5faad691f77306f27fdc3..069e89a1fc55f7b39e3ac140be8e899c75802c5a 100644 (file)
@@ -25,7 +25,7 @@ class SearchEngine extends SingletonFactory implements ISearchEngine {
        
        /**
         * list of available object types
-        * @var array
+        * @var ISearchableObjectType[]
         */
        protected $availableObjectTypes = [];
        
@@ -51,7 +51,7 @@ class SearchEngine extends SingletonFactory implements ISearchEngine {
        /**
         * Returns a list of available object types.
         * 
-        * @return      array
+        * @return      ISearchableObjectType[]
         */
        public function getAvailableObjectTypes() {
                return $this->availableObjectTypes;
@@ -61,7 +61,7 @@ class SearchEngine extends SingletonFactory implements ISearchEngine {
         * Returns the object type with the given name.
         * 
         * @param       string          $objectTypeName
-        * @return      \wcf\data\object\type\ObjectType
+        * @return      ISearchableObjectType|null
         */
        public function getObjectType($objectTypeName) {
                if (isset($this->availableObjectTypes[$objectTypeName])) {
index de563ae44b363b2eaf7096f4bf93632b41b3723a..e46421a35961133f8001042905625ae92a7ad61b 100644 (file)
@@ -56,6 +56,7 @@ class ACPSearchHandler extends SingletonFactory {
                                throw new ImplementationException($className, IACPSearchResultProvider::class);
                        }
                        
+                       /** @var IACPSearchResultProvider $provider */
                        $provider = new $className();
                        $results = $provider->search($query, $maxResultsPerProvider);
                        
index 635da1469910ef4635ba422490a311d6d70008da..ad3a4bbc1b0a0d1cec486c85680d6b59b42b5a82 100644 (file)
@@ -32,6 +32,7 @@ class UserACPSearchResultProvider implements IACPSearchResultProvider {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute([$query.'%']);
                
+               /** @var User $user */
                while ($user = $statement->fetchObject(User::class)) {
                        if (UserGroup::isAccessibleGroup($user->getGroupIDs())) {
                                $results[] = new ACPSearchResult($user->username, LinkHandler::getInstance()->getLink('UserEdit', [
index b4b642416482c2d38a18c413f4aeddc0e44114e8..bbdaa57d24084bda2400b7a3576facc90c201eb6 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\user\group\assignment;
+use wcf\data\object\type\ObjectType;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\data\user\group\assignment\UserGroupAssignment;
 use wcf\data\user\User;
@@ -21,7 +22,7 @@ use wcf\system\SingletonFactory;
 class UserGroupAssignmentHandler extends SingletonFactory {
        /**
         * list of grouped user group assignment condition object types
-        * @var array
+        * @var ObjectType[][]
         */
        protected $groupedObjectTypes = [];
        
@@ -41,6 +42,7 @@ class UserGroupAssignmentHandler extends SingletonFactory {
                $userList->setObjectIDs($userIDs);
                $userList->readObjects();
                
+               /** @var UserGroupAssignment[] $assignments */
                $assignments = UserGroupAssignmentCacheBuilder::getInstance()->getData();
                foreach ($userList as $user) {
                        $groupIDs = $user->getGroupIDs();
index ae6358e778ec9e1e6dc5cf2d560a27ac883f3034..b4ca4c369f7120df2377b2523fda273c092e9af9 100644 (file)
@@ -36,7 +36,7 @@ use wcf\util\StringUtil;
 class UserNotificationHandler extends SingletonFactory {
        /**
         * list of available object types
-        * @var array
+        * @var IUserNotificationEvent[][]
         */
        protected $availableObjectTypes = [];
        
@@ -460,6 +460,8 @@ class UserNotificationHandler extends SingletonFactory {
                        }
                        
                        $className = $eventObjects[$notification->eventID]->className;
+                       
+                       /** @var IUserNotificationEvent $class */
                        $class = new $className($eventObjects[$notification->eventID]);
                        $class->setObject(
                                $notification,
@@ -589,7 +591,7 @@ class UserNotificationHandler extends SingletonFactory {
        /**
         * Returns a list of available events.
         * 
-        * @return      IUserNotificationEvent[]
+        * @return      IUserNotificationEvent[][]
         */
        public function getAvailableEvents() {
                return $this->availableEvents;
index 463f1bafa753de60364a4e0cbe9cfb90b4dfcb3a..599eb36d716ae2a0350e82fa34b67cf475146e3c 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 namespace wcf\system\user\notification\object\type;
+use wcf\data\DatabaseObjectList;
 use wcf\data\object\type\AbstractObjectTypeProcessor;
 
 /**
@@ -37,9 +38,10 @@ class AbstractUserNotificationObjectType extends AbstractObjectTypeProcessor imp
        public function getObjectsByIDs(array $objectIDs) {
                $indexName = call_user_func([static::$objectClassName, 'getDatabaseTableIndexName']);
                
+               /** @var DatabaseObjectList $objectList */
                $objectList = new static::$objectListClassName();
                $objectList->setObjectIDs($objectIDs);
-               $objectList->sqLimit = 0;
+               $objectList->sqlLimit = 0;
                $objectList->decoratorClassName = static::$decoratorClassName;
                $objectList->readObjects();
                $objects = $objectList->getObjects();