From: Matthias Schmidt Date: Sat, 21 May 2016 21:01:04 +0000 (+0200) Subject: Improve/Fix variable and property type documentation X-Git-Tag: 3.0.0_Beta_1~1681^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a110a253d2056b2dee06081575fdd0db2a0474f8;p=GitHub%2FWoltLab%2FWCF.git Improve/Fix variable and property type documentation --- diff --git a/wcfsetup/install/files/lib/data/language/SetupLanguage.class.php b/wcfsetup/install/files/lib/data/language/SetupLanguage.class.php index fe9a9df20b..32eeb31f78 100644 --- a/wcfsetup/install/files/lib/data/language/SetupLanguage.class.php +++ b/wcfsetup/install/files/lib/data/language/SetupLanguage.class.php @@ -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'), diff --git a/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php b/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php index 3dda4e2ed7..e2af13c03f 100644 --- a/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php +++ b/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php @@ -1,5 +1,6 @@ className, 'getDatabaseTableAlias']); $tableIndex = call_user_func([$this->className, 'getDatabaseTableIndexName']); + /** @var DatabaseObjectList $objectList */ $objectList = new $this->listClassName(); if ($this->decoratorClassName) { $objectList->decoratorClassName = $this->decoratorClassName; diff --git a/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php b/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php index 590c4d1e78..ab2ae1efed 100644 --- a/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php +++ b/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php b/wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php index d7568f127e..e2fe3effab 100644 --- a/wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php @@ -1,6 +1,7 @@ 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; } diff --git a/wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php b/wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php index 7a15f79b82..9ada63005d 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php @@ -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()); diff --git a/wcfsetup/install/files/lib/system/ad/AdHandler.class.php b/wcfsetup/install/files/lib/system/ad/AdHandler.class.php index b35ae832e7..b976683524 100644 --- a/wcfsetup/install/files/lib/system/ad/AdHandler.class.php +++ b/wcfsetup/install/files/lib/system/ad/AdHandler.class.php @@ -1,5 +1,6 @@ prepareStatement($sql); $statement->execute(); + + /** @var EventListener $eventListener */ while ($eventListener = $statement->fetchObject(EventListener::class)) { $eventNames = $eventListener->getEventNames(); diff --git a/wcfsetup/install/files/lib/system/cache/builder/LabelCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/LabelCacheBuilder.class.php index 8306e9fe18..493a9fb958 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/LabelCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/LabelCacheBuilder.class.php @@ -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])) { diff --git a/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php index 56b1d33a8f..01af09e3cf 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php index 28a7328e38..2d68562024 100644 --- a/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php @@ -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); diff --git a/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php b/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php index 5384295f52..f6df93c565 100644 --- a/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/UserMenu.class.php @@ -1,5 +1,6 @@ getProcessor()->isVisible(); diff --git a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php index 12358c0138..7d6ccf7a8f 100644 --- a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php @@ -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); diff --git a/wcfsetup/install/files/lib/system/payment/method/PaymentMethodHandler.class.php b/wcfsetup/install/files/lib/system/payment/method/PaymentMethodHandler.class.php index f76b0f25d3..06fce44830 100644 --- a/wcfsetup/install/files/lib/system/payment/method/PaymentMethodHandler.class.php +++ b/wcfsetup/install/files/lib/system/payment/method/PaymentMethodHandler.class.php @@ -1,5 +1,6 @@ paymentMethods; diff --git a/wcfsetup/install/files/lib/system/search/SearchEngine.class.php b/wcfsetup/install/files/lib/system/search/SearchEngine.class.php index e36fcfa215..069e89a1fc 100644 --- a/wcfsetup/install/files/lib/system/search/SearchEngine.class.php +++ b/wcfsetup/install/files/lib/system/search/SearchEngine.class.php @@ -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])) { diff --git a/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php b/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php index de563ae44b..e46421a359 100644 --- a/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php @@ -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); diff --git a/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php b/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php index 635da14699..ad3a4bbc1b 100644 --- a/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php @@ -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', [ diff --git a/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php b/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php index b4b6424164..bbdaa57d24 100644 --- a/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php @@ -1,5 +1,6 @@ setObjectIDs($userIDs); $userList->readObjects(); + /** @var UserGroupAssignment[] $assignments */ $assignments = UserGroupAssignmentCacheBuilder::getInstance()->getData(); foreach ($userList as $user) { $groupIDs = $user->getGroupIDs(); diff --git a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php index ae6358e778..b4ca4c369f 100644 --- a/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php index 463f1bafa7..599eb36d71 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php @@ -1,5 +1,6 @@ setObjectIDs($objectIDs); - $objectList->sqLimit = 0; + $objectList->sqlLimit = 0; $objectList->decoratorClassName = static::$decoratorClassName; $objectList->readObjects(); $objects = $objectList->getObjects();