// 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'),
<?php
namespace wcf\data\object\type;
+use wcf\data\DatabaseObjectList;
/**
* Abstract implementation of an object type provider.
$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;
class SmileyCache extends SingletonFactory {
/**
* cached smilies
- * @var array
+ * @var Smiley[][]
*/
protected $cachedSmilies = [];
/**
* Returns all smilies.
*
- * @return array
+ * @return Smiley[][]
*/
public function getSmilies() {
return $this->cachedSmilies;
<?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;
$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;
}
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;
* 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());
<?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;
class AdHandler extends SingletonFactory {
/**
* list of ad objects grouped by ad location
- * @var array
+ * @var Ad[][]
*/
protected $ads = [];
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();
$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])) {
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;
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);
<?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;
* @inheritDoc
*/
protected function checkMenuItem(ITreeMenuItem $item) {
+ /** @var UserMenuItem $item */
+
if (!parent::checkMenuItem($item)) return false;
return $item->getProcessor()->isVisible();
* @inheritDoc
*/
public function getFormElement(Option $option, $value) {
+ /** @var CategoryNodeTree $categoryTree */
$categoryTree = new $this->nodeTreeClassname($this->objectType);
$categoryList = $categoryTree->getIterator();
$categoryList->setMaxDepth(0);
<?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;
class PaymentMethodHandler extends SingletonFactory {
/**
* payment methods
- * @var array
+ * @var IPaymentMethod[]
*/
protected $paymentMethods = [];
/**
* payment method object types
- * @var array
+ * @var ObjectType[]
*/
protected $objectTypes = [];
/**
* Returns the available payment methods.
*
- * @return array
+ * @return IPaymentMethod[]
*/
public function getPaymentMethods() {
return $this->paymentMethods;
/**
* list of available object types
- * @var array
+ * @var ISearchableObjectType[]
*/
protected $availableObjectTypes = [];
/**
* Returns a list of available object types.
*
- * @return array
+ * @return ISearchableObjectType[]
*/
public function getAvailableObjectTypes() {
return $this->availableObjectTypes;
* 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])) {
throw new ImplementationException($className, IACPSearchResultProvider::class);
}
+ /** @var IACPSearchResultProvider $provider */
$provider = new $className();
$results = $provider->search($query, $maxResultsPerProvider);
$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', [
<?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;
class UserGroupAssignmentHandler extends SingletonFactory {
/**
* list of grouped user group assignment condition object types
- * @var array
+ * @var ObjectType[][]
*/
protected $groupedObjectTypes = [];
$userList->setObjectIDs($userIDs);
$userList->readObjects();
+ /** @var UserGroupAssignment[] $assignments */
$assignments = UserGroupAssignmentCacheBuilder::getInstance()->getData();
foreach ($userList as $user) {
$groupIDs = $user->getGroupIDs();
class UserNotificationHandler extends SingletonFactory {
/**
* list of available object types
- * @var array
+ * @var IUserNotificationEvent[][]
*/
protected $availableObjectTypes = [];
}
$className = $eventObjects[$notification->eventID]->className;
+
+ /** @var IUserNotificationEvent $class */
$class = new $className($eventObjects[$notification->eventID]);
$class->setObject(
$notification,
/**
* Returns a list of available events.
*
- * @return IUserNotificationEvent[]
+ * @return IUserNotificationEvent[][]
*/
public function getAvailableEvents() {
return $this->availableEvents;
<?php
namespace wcf\system\user\notification\object\type;
+use wcf\data\DatabaseObjectList;
use wcf\data\object\type\AbstractObjectTypeProcessor;
/**
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();