From c9c5a6908389c67db97b0f6c5892c53349f525c1 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 22 Mar 2026 15:47:08 +0100 Subject: [PATCH 1/3] Add missing typings to some interface methods --- .../files/lib/data/DatabaseObject.class.php | 4 +-- .../install/files/lib/data/IMessage.class.php | 3 +- .../files/lib/data/IStorableObject.class.php | 6 ++-- .../files/lib/data/IUserContent.class.php | 2 +- .../like/object/AbstractLikeObject.class.php | 2 +- .../data/like/object/ILikeObject.class.php | 5 ++-- .../data/search/ISearchResultObject.class.php | 3 +- .../AbstractAttachmentObjectType.class.php | 4 +-- .../IAttachmentObjectType.class.php | 15 ++++------ .../files/lib/system/bbcode/IBBCode.class.php | 3 +- .../manager/AbstractCommentManager.class.php | 14 ++++----- .../comment/manager/ICommentManager.class.php | 30 +++++-------------- .../AbstractModerationQueueHandler.class.php | 2 +- .../queue/IModerationQueueHandler.class.php | 12 +++----- .../IModerationQueueReportHandler.class.php | 6 ++-- .../handler/AbstractMenuPageHandler.class.php | 8 ++--- .../page/handler/ILookupPageHandler.class.php | 9 ++---- .../page/handler/IMenuPageHandler.class.php | 6 ++-- ...actFileDiskUsageStatDailyHandler.class.php | 2 +- .../system/stat/IStatDailyHandler.class.php | 6 ++-- .../AbstractUserNotificationEvent.class.php | 2 +- .../event/IUserNotificationEvent.class.php | 12 ++++++-- ...esponseLikeUserNotificationEvent.class.php | 2 +- ...sponseOwnerUserNotificationEvent.class.php | 2 +- ...entResponseUserNotificationEvent.class.php | 2 +- ...fileCommentUserNotificationEvent.class.php | 2 +- ...tionSuccessUserNotificationEvent.class.php | 2 +- ...ommentUserNotificationObjectType.class.php | 2 +- ...ommentUserNotificationObjectType.class.php | 3 +- ...ommentUserNotificationObjectType.class.php | 2 +- .../ArticleCategoryUserObjectWatch.class.php | 2 +- .../object/watch/IUserObjectWatch.class.php | 3 +- 32 files changed, 70 insertions(+), 108 deletions(-) diff --git a/wcfsetup/install/files/lib/data/DatabaseObject.class.php b/wcfsetup/install/files/lib/data/DatabaseObject.class.php index e8615ea41e4..587b25f39fd 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObject.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObject.class.php @@ -96,7 +96,7 @@ protected function handleData($data) /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { return $this->data[$name] ?? null; } @@ -114,7 +114,7 @@ public function getObjectID() /** * @inheritDoc */ - public function __isset($name) + public function __isset(string $name) { return isset($this->data[$name]); } diff --git a/wcfsetup/install/files/lib/data/IMessage.class.php b/wcfsetup/install/files/lib/data/IMessage.class.php index 6943e7ca3f1..fca6ced16f4 100644 --- a/wcfsetup/install/files/lib/data/IMessage.class.php +++ b/wcfsetup/install/files/lib/data/IMessage.class.php @@ -14,10 +14,9 @@ interface IMessage extends IUserContent /** * Returns a simplified message (only inline codes), truncated to 255 characters by default. * - * @param int $maxLength * @return string */ - public function getExcerpt($maxLength = 255); + public function getExcerpt(int $maxLength = 255); /** * Returns formatted message text. diff --git a/wcfsetup/install/files/lib/data/IStorableObject.class.php b/wcfsetup/install/files/lib/data/IStorableObject.class.php index a7fbb1f5e4f..1617f2648c6 100644 --- a/wcfsetup/install/files/lib/data/IStorableObject.class.php +++ b/wcfsetup/install/files/lib/data/IStorableObject.class.php @@ -15,19 +15,17 @@ interface IStorableObject * Returns the value of a object data variable with the given name or `null` if no * such data variable exists. * - * @param string $name * @return mixed */ - public function __get($name); + public function __get(string $name); /** * Determines if the object data variable with the given name is set and * is not NULL. * - * @param string $name * @return bool */ - public function __isset($name); + public function __isset(string $name); /** * Returns the value of all object data variables. diff --git a/wcfsetup/install/files/lib/data/IUserContent.class.php b/wcfsetup/install/files/lib/data/IUserContent.class.php index 6eb387b9838..10c48f2e15f 100644 --- a/wcfsetup/install/files/lib/data/IUserContent.class.php +++ b/wcfsetup/install/files/lib/data/IUserContent.class.php @@ -21,7 +21,7 @@ public function getTime(); /** * Returns author's user id. * - * @return int + * @return ?int */ public function getUserID(); diff --git a/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php b/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php index ccc140e7830..9041a70f392 100644 --- a/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php +++ b/wcfsetup/install/files/lib/data/like/object/AbstractLikeObject.class.php @@ -34,7 +34,7 @@ abstract class AbstractLikeObject extends DatabaseObjectDecorator implements ILi /** * @inheritDoc */ - public function updateLikeCounter($cumulativeLikes) + public function updateLikeCounter(int $cumulativeLikes) { // individual implementations can override this method to update like counter } diff --git a/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php b/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php index 09014a5f575..9bf4a458ea4 100644 --- a/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php +++ b/wcfsetup/install/files/lib/data/like/object/ILikeObject.class.php @@ -27,7 +27,7 @@ public function getURL(); /** * Returns the user id of the owner of this object. * - * @return int + * @return ?int */ public function getUserID(); @@ -41,10 +41,9 @@ public function getObjectType(); /** * Updates the cumulative likes for this object. * - * @param int $cumulativeLikes * @return void */ - public function updateLikeCounter($cumulativeLikes); + public function updateLikeCounter(int $cumulativeLikes); /** * Sets the likable object type. diff --git a/wcfsetup/install/files/lib/data/search/ISearchResultObject.class.php b/wcfsetup/install/files/lib/data/search/ISearchResultObject.class.php index 299dee1a240..eea1eeaff35 100644 --- a/wcfsetup/install/files/lib/data/search/ISearchResultObject.class.php +++ b/wcfsetup/install/files/lib/data/search/ISearchResultObject.class.php @@ -37,10 +37,9 @@ public function getTime(); /** * Returns the link to this object. * - * @param string $query search query * @return string */ - public function getLink($query = ''); + public function getLink(string $query = ''); /** * Returns the object type name. diff --git a/wcfsetup/install/files/lib/system/attachment/AbstractAttachmentObjectType.class.php b/wcfsetup/install/files/lib/system/attachment/AbstractAttachmentObjectType.class.php index 8bcbb1203c1..d43e0f8fd1b 100644 --- a/wcfsetup/install/files/lib/system/attachment/AbstractAttachmentObjectType.class.php +++ b/wcfsetup/install/files/lib/system/attachment/AbstractAttachmentObjectType.class.php @@ -49,7 +49,7 @@ public function getMaxCount() /** * @inheritDoc */ - public function canViewPreview($objectID) + public function canViewPreview(int $objectID) { return $this->canDownload($objectID); } @@ -57,7 +57,7 @@ public function canViewPreview($objectID) /** * @inheritDoc */ - public function getObject($objectID) + public function getObject(int $objectID) { return $this->cachedObjects[$objectID] ?? null; } diff --git a/wcfsetup/install/files/lib/system/attachment/IAttachmentObjectType.class.php b/wcfsetup/install/files/lib/system/attachment/IAttachmentObjectType.class.php index 01d88ec1647..30033fd3280 100644 --- a/wcfsetup/install/files/lib/system/attachment/IAttachmentObjectType.class.php +++ b/wcfsetup/install/files/lib/system/attachment/IAttachmentObjectType.class.php @@ -17,36 +17,31 @@ interface IAttachmentObjectType /** * Returns true if the active user has the permission to download attachments. * - * @param int $objectID * @return bool */ - public function canDownload($objectID); + public function canDownload(int $objectID); /** * Returns true if the active user has the permission to view attachment * previews (thumbnails). * - * @param int $objectID * @return bool */ - public function canViewPreview($objectID); + public function canViewPreview(int $objectID); /** * Returns true if the active user has the permission to upload attachments. * - * @param int $objectID - * @param int $parentObjectID * @return bool */ - public function canUpload($objectID, $parentObjectID = 0); + public function canUpload(int $objectID, int $parentObjectID = 0); /** * Returns true if the active user has the permission to delete attachments. * - * @param int $objectID * @return bool */ - public function canDelete($objectID); + public function canDelete(int $objectID); /** * Returns the maximum filesize for an attachment. @@ -75,7 +70,7 @@ public function getMaxCount(); * @param int $objectID * @return ?T */ - public function getObject($objectID); + public function getObject(int $objectID); /** * Caches the data of the given container objects. diff --git a/wcfsetup/install/files/lib/system/bbcode/IBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/IBBCode.class.php index 46654f774bf..ae99bc56a65 100644 --- a/wcfsetup/install/files/lib/system/bbcode/IBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/IBBCode.class.php @@ -17,8 +17,7 @@ interface IBBCode extends IDatabaseObjectProcessor * Returns the parsed bbcode tag. * * @param array{attributes: list, name: string} $openingTag - * @param string $content * @param array{name: string, __parents: list<\DOMElement>} $closingTag */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string; + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string; } diff --git a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php index d92040b9fbb..8745efce21f 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -74,7 +74,7 @@ abstract class AbstractCommentManager implements ICommentManager /** * @inheritDoc */ - public function canAdd($objectID) + public function canAdd(int $objectID) { if (VISITOR_USE_TINY_BUILD && !WCF::getUser()->userID) { return false; @@ -90,7 +90,7 @@ public function canAdd($objectID) /** * @inheritDoc */ - public function canAddWithoutApproval($objectID) + public function canAddWithoutApproval(int $objectID) { if (VISITOR_USE_TINY_BUILD && !WCF::getUser()->userID) { return false; @@ -154,7 +154,7 @@ public function canDeleteResponse(CommentResponse $response) /** * @inheritDoc */ - public function canModerate($objectTypeID, $objectID) + public function canModerate(int $objectTypeID, int $objectID) { return WCF::getSession()->getPermission($this->permissionCanModerate) ? true : false; } @@ -162,10 +162,9 @@ public function canModerate($objectTypeID, $objectID) /** * Returns true if the current user may edit a comment/response. * - * @param bool $isOwner * @return bool */ - protected function canEdit($isOwner) + protected function canEdit(bool $isOwner) { // disallow guests if (!WCF::getUser()->userID) { @@ -188,10 +187,9 @@ protected function canEdit($isOwner) /** * Returns true if the current user may delete a comment/response. * - * @param bool $isOwner * @return bool */ - protected function canDelete($isOwner) + protected function canDelete(bool $isOwner) { // disallow guests if (!WCF::getUser()->userID) { @@ -255,7 +253,7 @@ public function getResponseLink(CommentResponse $response) /** * @inheritDoc */ - public function isContentAuthor($commentOrResponse) + public function isContentAuthor(Comment|CommentResponse $commentOrResponse) { return false; } diff --git a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php index e9541dbf0b1..bfff1bc9d6c 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php @@ -17,18 +17,16 @@ interface ICommentManager /** * Returns true if the current user may add comments or responses. * - * @param int $objectID * @return bool */ - public function canAdd($objectID); + public function canAdd(int $objectID); /** * Returns true if a comment requires approval. * - * @param int $objectID * @return bool */ - public function canAddWithoutApproval($objectID); + public function canAddWithoutApproval(int $objectID); /** * Returns true if the current user may edit given comment. @@ -62,12 +60,10 @@ public function canDeleteResponse(CommentResponse $response); * Returns true if the current user may moderated content identified by * object type id and object id. * - * @param int $objectTypeID - * @param int $objectID * @return bool * @deprecated 6.1 use `ICommentPermissionManager::canModerateObject()` instead */ - public function canModerate($objectTypeID, $objectID); + public function canModerate(int $objectTypeID, int $objectID); /** * Returns the amount of comments per page. @@ -79,11 +75,9 @@ public function getCommentsPerPage(); /** * Returns a link to the commented object with the given object type id and object id. * - * @param int $objectTypeID - * @param int $objectID * @return string */ - public function getLink($objectTypeID, $objectID); + public function getLink(int $objectTypeID, int $objectID); /** * Returns the link to the given comment. @@ -102,31 +96,24 @@ public function getResponseLink(CommentResponse $response); /** * Returns the title for a comment or response. * - * @param int $objectTypeID - * @param int $objectID - * @param bool $isResponse * @return string */ - public function getTitle($objectTypeID, $objectID, $isResponse = false); + public function getTitle(int $objectTypeID, int $objectID, bool $isResponse = false); /** * Returns true if comments and responses for given object id are accessible * by current user. * - * @param int $objectID - * @param bool $validateWritePermission * @return bool */ - public function isAccessible($objectID, $validateWritePermission = false); + public function isAccessible(int $objectID, bool $validateWritePermission = false); /** * Updates total count of comments (includes responses). * - * @param int $objectID - * @param int $value * @return void */ - public function updateCounter($objectID, $value); + public function updateCounter(int $objectID, int $value); /** * Returns true if this comment type supports likes. @@ -153,8 +140,7 @@ public function setDisallowedBBCodes(); * Returns whether the given Comment or CommentResponse was created by * the content's author. * - * @param Comment|CommentResponse $commentOrResponse * @return bool */ - public function isContentAuthor($commentOrResponse); + public function isContentAuthor(Comment|CommentResponse $commentOrResponse); } diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php index 1e5fc914e94..80355919e75 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php @@ -116,7 +116,7 @@ public function canRemoveContent(ModerationQueue $queue) /** * @inheritDoc */ - public function isAffectedUser(ModerationQueue $queue, $userID) + public function isAffectedUser(ModerationQueue $queue, int $userID) { $userProfile = UserProfileRuntimeCache::getInstance()->getObject($userID); diff --git a/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueHandler.class.php index d1295b07a27..73920f63cda 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueHandler.class.php @@ -25,10 +25,9 @@ public function assignQueues(array $queues); /** * Returns the container id for current object id, may return 0. * - * @param int $objectID * @return int */ - public function getContainerID($objectID); + public function getContainerID(int $objectID); /** * Validates object ids and returns orphaned queue ids. @@ -41,10 +40,9 @@ public function identifyOrphans(array $queues); /** * Returns true if given object id is valid. * - * @param int $objectID * @return bool */ - public function isValid($objectID); + public function isValid(int $objectID); /** * Populates object properties for viewing. @@ -59,10 +57,9 @@ public function populate(array $queues); * soft-delete the content or remove it permanently. * * @param ModerationQueue $queue - * @param string $message * @return void */ - public function removeContent(ModerationQueue $queue, $message); + public function removeContent(ModerationQueue $queue, string $message); /** * Returns true if the affected content may be removed. @@ -85,10 +82,9 @@ public function removeQueues(array $objectIDs); * Returns true, if given user is affected by given queue entry. * * @param ModerationQueue $queue - * @param int $userID * @return bool */ - public function isAffectedUser(ModerationQueue $queue, $userID); + public function isAffectedUser(ModerationQueue $queue, int $userID); /** * Returns the prefix of language items for notifications for comments diff --git a/wcfsetup/install/files/lib/system/moderation/queue/report/IModerationQueueReportHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/report/IModerationQueueReportHandler.class.php index a35a99106a9..ffb8650075d 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/report/IModerationQueueReportHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/report/IModerationQueueReportHandler.class.php @@ -18,10 +18,9 @@ interface IModerationQueueReportHandler extends IModerationQueueHandler /** * Returns true if current user can report given content. * - * @param int $objectID * @return bool */ - public function canReport($objectID); + public function canReport(int $objectID); /** * Returns rendered template for reported content. @@ -34,8 +33,7 @@ public function getReportedContent(ViewableModerationQueue $queue); /** * Returns reported object. * - * @param int $objectID * @return ?IUserContent */ - public function getReportedObject($objectID); + public function getReportedObject(int $objectID); } diff --git a/wcfsetup/install/files/lib/system/page/handler/AbstractMenuPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/AbstractMenuPageHandler.class.php index c3dc9611d04..9413d0e7143 100644 --- a/wcfsetup/install/files/lib/system/page/handler/AbstractMenuPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/AbstractMenuPageHandler.class.php @@ -25,7 +25,7 @@ abstract class AbstractMenuPageHandler implements IMenuPageHandler /** * @inheritDoc */ - public function getOutstandingItemCount($objectID = null) + public function getOutstandingItemCount(?int $objectID = null) { return 0; } @@ -33,7 +33,7 @@ public function getOutstandingItemCount($objectID = null) /** * @inheritDoc */ - public function isVisible($objectID = null) + public function isVisible(?int $objectID = null) { return true; } @@ -41,9 +41,7 @@ public function isVisible($objectID = null) /** * @inheritDoc */ - public function cacheObject(int $objectID): void - { - } + public function cacheObject(int $objectID): void {} /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/system/page/handler/ILookupPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/ILookupPageHandler.class.php index a0cad5052a8..d8d6fe6818b 100644 --- a/wcfsetup/install/files/lib/system/page/handler/ILookupPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/ILookupPageHandler.class.php @@ -16,25 +16,22 @@ interface ILookupPageHandler extends IMenuPageHandler /** * Returns the link for a page with an object id. * - * @param int $objectID page object id * @return string page url */ - public function getLink($objectID); + public function getLink(int $objectID); /** * Returns true if provided object id exists and is valid. * - * @param int $objectID page object id * @return bool true if object id is valid */ - public function isValid($objectID); + public function isValid(int $objectID); /** * Performs a search for pages using a query string, returning an array containing * an `objectID => title` relation. * - * @param string $searchString search string * @return list> */ - public function lookup($searchString); + public function lookup(string $searchString); } diff --git a/wcfsetup/install/files/lib/system/page/handler/IMenuPageHandler.class.php b/wcfsetup/install/files/lib/system/page/handler/IMenuPageHandler.class.php index 7aeb30bb1f9..150cd407435 100644 --- a/wcfsetup/install/files/lib/system/page/handler/IMenuPageHandler.class.php +++ b/wcfsetup/install/files/lib/system/page/handler/IMenuPageHandler.class.php @@ -18,19 +18,17 @@ interface IMenuPageHandler * Returns the number of outstanding items for this page for display as a badge, optionally * specifying a corresponding object id to limit the scope. * - * @param int|null $objectID optional page object id * @return int number of outstanding items */ - public function getOutstandingItemCount($objectID = null); + public function getOutstandingItemCount(?int $objectID = null); /** * Returns false if this page should be hidden from menus, but does not control the accessibility * of the page itself. The visibility can optionally be scoped to the given object id. * - * @param int|null $objectID optional page object id * @return bool false if the page should be hidden from menus */ - public function isVisible($objectID = null); + public function isVisible(?int $objectID = null); /** * Caches the given object id to save SQL queries if multiple objects of the same type are queried in the menu. diff --git a/wcfsetup/install/files/lib/system/stat/AbstractFileDiskUsageStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/AbstractFileDiskUsageStatDailyHandler.class.php index 4eea3859154..7493e746742 100644 --- a/wcfsetup/install/files/lib/system/stat/AbstractFileDiskUsageStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/AbstractFileDiskUsageStatDailyHandler.class.php @@ -74,7 +74,7 @@ protected function getTotal( } #[\Override] - public function getFormattedCounter($counter) + public function getFormattedCounter(int $counter) { return \round($counter / 1000, 2); // return mb } diff --git a/wcfsetup/install/files/lib/system/stat/IStatDailyHandler.class.php b/wcfsetup/install/files/lib/system/stat/IStatDailyHandler.class.php index ae9d35cd166..870b4112e88 100644 --- a/wcfsetup/install/files/lib/system/stat/IStatDailyHandler.class.php +++ b/wcfsetup/install/files/lib/system/stat/IStatDailyHandler.class.php @@ -14,16 +14,14 @@ interface IStatDailyHandler /** * Returns the stats. * - * @param int $date * @return array{counter: int, total: int} */ - public function getData($date); + public function getData(int $date); /** * Returns a formatted counter value. * - * @param int $counter * @return mixed */ - public function getFormattedCounter($counter); + public function getFormattedCounter(int $counter); } diff --git a/wcfsetup/install/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php index 4e8b68e3545..3e04f8619e9 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php @@ -161,7 +161,7 @@ public function getEmailTitle() /** * @inheritDoc */ - public function getEmailMessage($notificationType = 'instant') + public function getEmailMessage(string $notificationType = 'instant') { return $this->getMessage(); } diff --git a/wcfsetup/install/files/lib/system/user/notification/event/IUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/IUserNotificationEvent.class.php index 47ce80c7dfd..2996e76c7d8 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/IUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/IUserNotificationEvent.class.php @@ -67,11 +67,17 @@ public function getEmailTitle(); * - Return an ['template' => ..., 'application' => ..., 'variables' => ...] array * to be included into the summary email. * - * @param string $notificationType - * @return mixed + * @return string|array{ + * template: string, + * application: string, + * variables?: mixed[], + * message-id?: string, + * in-reply-to?: string[], + * references?: string[] + * } * @see \wcf\system\email\Email */ - public function getEmailMessage($notificationType = 'instant'); + public function getEmailMessage(string $notificationType = 'instant'); /** * Returns the author id for this notification event. diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php index 876b2e816e3..198ab17186d 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php @@ -113,7 +113,7 @@ public function getMessage() /** * @inheritDoc */ - public function getEmailMessage($notificationType = 'instant') + public function getEmailMessage(string $notificationType = 'instant') { throw new \LogicException('Unreachable'); } diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php index 124f312e8ca..6f7daad7ae3 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php @@ -78,7 +78,7 @@ public function getMessage() /** * @inheritDoc */ - public function getEmailMessage($notificationType = 'instant') + public function getEmailMessage(string $notificationType = 'instant') { $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID); $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']); diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php index ff710e65874..9c7fd48ec81 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php @@ -67,7 +67,7 @@ public function getMessage() /** * @inheritDoc */ - public function getEmailMessage($notificationType = 'instant') + public function getEmailMessage(string $notificationType = 'instant') { $comment = CommentRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->commentID); $owner = UserProfileRuntimeCache::getInstance()->getObject($this->additionalData['objectID']); diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentUserNotificationEvent.class.php index ac60f447318..f6966e77ed4 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentUserNotificationEvent.class.php @@ -60,7 +60,7 @@ public function getMessage() /** * @inheritDoc */ - public function getEmailMessage($notificationType = 'instant') + public function getEmailMessage(string $notificationType = 'instant') { return [ 'message-id' => 'com.woltlab.wcf.user.profileComment.notification/' . $this->getUserNotificationObject()->commentID, diff --git a/wcfsetup/install/files/lib/system/user/notification/event/UserRegistrationSuccessUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/UserRegistrationSuccessUserNotificationEvent.class.php index 18b7ce4b97d..a818d8786a9 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/UserRegistrationSuccessUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/UserRegistrationSuccessUserNotificationEvent.class.php @@ -49,7 +49,7 @@ public function getMessage() } #[\Override] - public function getEmailMessage($notificationType = 'instant') + public function getEmailMessage(string $notificationType = 'instant') { return [ 'template' => 'email_notification_userRegistrationSuccess', diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php index 063106b8577..1b5f54d1dca 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/ArticleCommentUserNotificationObjectType.class.php @@ -39,7 +39,7 @@ class ArticleCommentUserNotificationObjectType extends AbstractUserNotificationO /** * @inheritDoc */ - public function getOwnerID($objectID) + public function getOwnerID(int $objectID) { $sql = "SELECT article.userID FROM wcf1_comment comment diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/ICommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/ICommentUserNotificationObjectType.class.php index 8f94a66de7c..4bdec468545 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/ICommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/ICommentUserNotificationObjectType.class.php @@ -14,8 +14,7 @@ interface ICommentUserNotificationObjectType /** * Returns owner id of comment context. * - * @param int $objectID * @return int */ - public function getOwnerID($objectID); + public function getOwnerID(int $objectID); } diff --git a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php b/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php index 51b0fc4d275..5426c754af7 100644 --- a/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php @@ -35,7 +35,7 @@ class UserProfileCommentUserNotificationObjectType extends AbstractUserNotificat /** * @inheritDoc */ - public function getOwnerID($objectID) + public function getOwnerID(int $objectID) { $sql = "SELECT objectID FROM wcf1_comment diff --git a/wcfsetup/install/files/lib/system/user/object/watch/ArticleCategoryUserObjectWatch.class.php b/wcfsetup/install/files/lib/system/user/object/watch/ArticleCategoryUserObjectWatch.class.php index 4c96dc8d232..e58d16f4c92 100644 --- a/wcfsetup/install/files/lib/system/user/object/watch/ArticleCategoryUserObjectWatch.class.php +++ b/wcfsetup/install/files/lib/system/user/object/watch/ArticleCategoryUserObjectWatch.class.php @@ -20,7 +20,7 @@ class ArticleCategoryUserObjectWatch extends AbstractObjectTypeProcessor impleme /** * @inheritDoc */ - public function validateObjectID($objectID) + public function validateObjectID(int $objectID) { $category = ArticleCategory::getCategory($objectID); if ($category === null) { diff --git a/wcfsetup/install/files/lib/system/user/object/watch/IUserObjectWatch.class.php b/wcfsetup/install/files/lib/system/user/object/watch/IUserObjectWatch.class.php index 8330378237c..5c2afbf0a16 100644 --- a/wcfsetup/install/files/lib/system/user/object/watch/IUserObjectWatch.class.php +++ b/wcfsetup/install/files/lib/system/user/object/watch/IUserObjectWatch.class.php @@ -14,11 +14,10 @@ interface IUserObjectWatch /** * Validates the given object id. Throws an exception on error. * - * @param int $objectID * @return void * @throws \wcf\system\exception\UserException */ - public function validateObjectID($objectID); + public function validateObjectID(int $objectID); /** * Resets the user storage for given users. From 225acf1cb09c74a04e3af0823dfa13e60f7ef332 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 22 Mar 2026 16:59:28 +0100 Subject: [PATCH 2/3] Add missing typings to interface methods --- .../data/IDatabaseObjectProcessor.class.php | 9 +- .../lib/data/IPermissionObject.class.php | 3 +- .../files/lib/data/IThumbnailFile.class.php | 6 +- .../lib/data/ITraversableObject.class.php | 6 +- .../object/type/IObjectTypeProvider.class.php | 3 +- .../data/user/avatar/IUserAvatar.class.php | 6 +- .../system/ad/location/IAdLocation.class.php | 3 +- .../provider/IBBCodeMediaProvider.class.php | 3 +- .../cache/builder/ICacheBuilder.class.php | 3 +- .../cache/runtime/IRuntimeCache.class.php | 9 +- .../cache/source/ICacheSource.class.php | 13 +-- .../system/category/ICategoryType.class.php | 7 +- .../pip/IDevtoolsPipEntryList.class.php | 10 +- .../IGuiPackageInstallationPlugin.class.php | 13 +-- .../lib/system/event/IEventListener.class.php | 5 +- .../IParameterizedEventListener.class.php | 2 +- .../lib/system/form/IFormElement.class.php | 12 +-- .../form/IFormElementContainer.class.php | 16 +--- .../form/builder/IFormDocument.class.php | 44 ++++----- .../system/form/builder/IFormNode.class.php | 21 ++--- .../builder/IObjectTypeFormNode.class.php | 3 +- .../form/builder/button/IFormButton.class.php | 6 +- .../container/IFormContainer.class.php | 3 +- .../field/IAutoFocusFormField.class.php | 3 +- .../IFilterableSelectionFormField.class.php | 2 +- .../form/builder/field/IFormField.class.php | 15 ++- .../builder/field/II18nFormField.class.php | 7 +- .../field/IImmutableFormField.class.php | 3 +- .../field/IMaximumLengthFormField.class.php | 7 +- .../field/IMinimumLengthFormField.class.php | 7 +- .../field/IMultipleFormField.class.php | 9 +- .../field/INullableFormField.class.php | 2 +- .../field/IPlaceholderFormField.class.php | 2 +- .../field/ISelectionFormField.class.php | 2 +- .../field/ISuffixedFormField.class.php | 2 +- .../dependency/IFormFieldDependency.class.php | 3 +- .../IFormFieldValidationError.class.php | 2 +- .../validation/IFormFieldValidator.class.php | 6 +- .../input/filter/IHtmlInputFilter.class.php | 3 +- .../html/node/IHtmlNodeProcessor.class.php | 3 +- .../output/node/IHtmlOutputNode.class.php | 3 +- .../image/adapter/IImageAdapter.class.php | 91 ++++--------------- .../IMemoryAwareImageAdapter.class.php | 5 +- .../lib/system/importer/IImporter.class.php | 3 +- .../files/lib/system/io/IArchive.class.php | 10 +- .../object/ILabelObjectHandler.class.php | 15 +-- .../type/ILabelObjectTypeHandler.class.php | 3 +- .../content/IUserProfileMenuContent.class.php | 6 +- ...mpleMessageEmbeddedObjectHandler.class.php | 9 +- .../queue/IModerationQueueManager.class.php | 25 ++--- .../system/option/IOptionHandler.class.php | 21 +---- .../lib/system/option/IOptionType.class.php | 17 +--- .../ISearchableConditionUserOption.class.php | 14 +-- .../option/ISearchableUserOption.class.php | 9 +- .../option/user/IUserOptionOutput.class.php | 5 +- .../user/group/IUserGroupOptionType.class.php | 4 +- .../payment/method/IPaymentMethod.class.php | 28 ++---- .../payment/type/IPaymentType.class.php | 20 ++-- .../request/route/IRequestRoute.class.php | 3 +- .../lib/system/search/ISearchEngine.class.php | 32 ++----- .../search/ISearchIndexManager.class.php | 33 +++---- .../search/ISearchableObjectType.class.php | 11 +-- .../acp/IACPSearchResultProvider.class.php | 3 +- ...AttributesFunctionTemplatePlugin.class.php | 2 +- .../AnchorFunctionTemplatePlugin.class.php | 2 +- .../ConcatModifierTemplatePlugin.class.php | 2 +- .../CounterFunctionTemplatePlugin.class.php | 2 +- .../CsrfTokenFunctionTemplatePlugin.class.php | 2 +- .../CurrencyModifierTemplatePlugin.class.php | 2 +- .../CycleFunctionTemplatePlugin.class.php | 2 +- .../DateDiffModifierTemplatePlugin.class.php | 2 +- ...teIntervalFunctionTemplatePlugin.class.php | 2 +- .../DateModifierTemplatePlugin.class.php | 2 +- ...mbeddedObjectBlockTemplatePlugin.class.php | 4 +- .../EncodeJSModifierTemplatePlugin.class.php | 2 +- ...scapeCDATAModifierTemplatePlugin.class.php | 2 +- ...sizeBinaryModifierTemplatePlugin.class.php | 2 +- .../FilesizeModifierTemplatePlugin.class.php | 2 +- ...CheckboxesFunctionTemplatePlugin.class.php | 2 +- ...tmlOptionsFunctionTemplatePlugin.class.php | 2 +- .../plugin/IBlockTemplatePlugin.class.php | 5 +- .../plugin/ICompilerTemplatePlugin.class.php | 2 +- .../plugin/IFunctionTemplatePlugin.class.php | 2 +- .../plugin/IModifierTemplatePlugin.class.php | 2 +- .../plugin/IPrefilterTemplatePlugin.class.php | 5 +- .../IconFunctionTemplatePlugin.class.php | 2 +- .../IpSearchModifierTemplatePlugin.class.php | 2 +- .../plugin/JsFunctionTemplatePlugin.class.php | 2 +- .../JsonModifierTemplatePlugin.class.php | 2 +- .../JsphraseFunctionTemplatePlugin.class.php | 2 +- .../LanguageModifierTemplatePlugin.class.php | 2 +- .../plugin/LinkBlockTemplatePlugin.class.php | 2 +- ...ineToBreakModifierTemplatePlugin.class.php | 2 +- ...jectActionFunctionTemplatePlugin.class.php | 2 +- .../plugin/PageBlockTemplatePlugin.class.php | 2 +- .../PagesFunctionTemplatePlugin.class.php | 2 +- .../PhraseModifierTemplatePlugin.class.php | 2 +- .../PlainTimeModifierTemplatePlugin.class.php | 2 +- .../PluralFunctionTemplatePlugin.class.php | 2 +- .../ShortUnitModifierTemplatePlugin.class.php | 2 +- ...leWordwrapModifierTemplatePlugin.class.php | 2 +- .../TimeFunctionTemplatePlugin.class.php | 2 +- .../TimeModifierTemplatePlugin.class.php | 2 +- .../TruncateModifierTemplatePlugin.class.php | 2 +- .../UserFunctionTemplatePlugin.class.php | 2 +- .../IUserAuthentication.class.php | 8 +- .../multifactor/IMultifactorMethod.class.php | 4 +- .../ITestableUserNotificationEvent.class.php | 6 +- .../location/IUserOnlineLocation.class.php | 5 +- .../version/IVersionTrackerProvider.class.php | 3 +- .../files/lib/system/worker/IWorker.class.php | 3 +- 111 files changed, 248 insertions(+), 527 deletions(-) diff --git a/wcfsetup/install/files/lib/data/IDatabaseObjectProcessor.class.php b/wcfsetup/install/files/lib/data/IDatabaseObjectProcessor.class.php index 496b81e6060..f096fdc7076 100644 --- a/wcfsetup/install/files/lib/data/IDatabaseObjectProcessor.class.php +++ b/wcfsetup/install/files/lib/data/IDatabaseObjectProcessor.class.php @@ -16,26 +16,23 @@ public function __construct(DatabaseObject $object); /** * Delegates accesses to inaccessible object properties the processed object. * - * @param string $name * @return mixed */ - public function __get($name); + public function __get(string $name); /** * Delegates isset calls for inaccessible object properties to the processed * object. * - * @param string $name * @return bool */ - public function __isset($name); + public function __isset(string $name); /** * Delegates inaccessible method calls to the processed database object. * - * @param string $name * @param mixed[] $arguments * @return mixed */ - public function __call($name, $arguments); + public function __call(string $name, array $arguments); } diff --git a/wcfsetup/install/files/lib/data/IPermissionObject.class.php b/wcfsetup/install/files/lib/data/IPermissionObject.class.php index d714e4013c2..a24104d5175 100644 --- a/wcfsetup/install/files/lib/data/IPermissionObject.class.php +++ b/wcfsetup/install/files/lib/data/IPermissionObject.class.php @@ -26,8 +26,7 @@ public function checkPermissions(array $permissions); * Returns the permission value of the given permission for this object * and the active user. * - * @param string $permission * @return mixed */ - public function getPermission($permission); + public function getPermission(string $permission); } diff --git a/wcfsetup/install/files/lib/data/IThumbnailFile.class.php b/wcfsetup/install/files/lib/data/IThumbnailFile.class.php index e8b6e327756..e98c4d1cf66 100644 --- a/wcfsetup/install/files/lib/data/IThumbnailFile.class.php +++ b/wcfsetup/install/files/lib/data/IThumbnailFile.class.php @@ -16,18 +16,16 @@ interface IThumbnailFile extends IFile /** * Returns the link to the thumbnail file with the given size. * - * @param string $size * @return string */ - public function getThumbnailLink($size); + public function getThumbnailLink(string $size); /** * Returns the physical location of the thumbnail file with the given size. * - * @param string $size * @return string */ - public function getThumbnailLocation($size); + public function getThumbnailLocation(string $size); /** * Returns the available thumbnail sizes. diff --git a/wcfsetup/install/files/lib/data/ITraversableObject.class.php b/wcfsetup/install/files/lib/data/ITraversableObject.class.php index 649ece197b1..a7d77a4fd63 100644 --- a/wcfsetup/install/files/lib/data/ITraversableObject.class.php +++ b/wcfsetup/install/files/lib/data/ITraversableObject.class.php @@ -17,17 +17,15 @@ interface ITraversableObject extends \SeekableIterator /** * Sets internal iterator pointer based upon related object id. * - * @param int $objectID * @return void */ - public function seekTo($objectID); + public function seekTo(int $objectID); /** * Searches a specific object by object id and setting internal iterator * pointer to found item. Returns `null` if object id is not found. * - * @param int $objectID * @return ?TDatabaseObject */ - public function search($objectID); + public function search(int $objectID); } diff --git a/wcfsetup/install/files/lib/data/object/type/IObjectTypeProvider.class.php b/wcfsetup/install/files/lib/data/object/type/IObjectTypeProvider.class.php index 0c724e92b39..29fe280020e 100644 --- a/wcfsetup/install/files/lib/data/object/type/IObjectTypeProvider.class.php +++ b/wcfsetup/install/files/lib/data/object/type/IObjectTypeProvider.class.php @@ -19,10 +19,9 @@ interface IObjectTypeProvider /** * Returns an object by its ID. * - * @param int $objectID * @return TDatabaseObject */ - public function getObjectByID($objectID); + public function getObjectByID(int $objectID); /** * Returns objects by their IDs. diff --git a/wcfsetup/install/files/lib/data/user/avatar/IUserAvatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/IUserAvatar.class.php index 82618a6370d..f2a5a6d446f 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/IUserAvatar.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/IUserAvatar.class.php @@ -14,18 +14,16 @@ interface IUserAvatar /** * Returns the url to this avatar. * - * @param int $size * @return string */ - public function getURL($size = null); + public function getURL(?int $size = null); /** * Returns the html code to display this avatar. * - * @param int $size * @return string */ - public function getImageTag($size = null); + public function getImageTag(?int $size = null); /** * Returns the width of this avatar. diff --git a/wcfsetup/install/files/lib/system/ad/location/IAdLocation.class.php b/wcfsetup/install/files/lib/system/ad/location/IAdLocation.class.php index 3ace8ed386e..d1046c004f5 100644 --- a/wcfsetup/install/files/lib/system/ad/location/IAdLocation.class.php +++ b/wcfsetup/install/files/lib/system/ad/location/IAdLocation.class.php @@ -27,8 +27,7 @@ public function getVariablesDescription(); /** * Replaces all relevant variables in the given ad and returns the processed ad. * - * @param string $ad * @return string */ - public function replaceVariables($ad); + public function replaceVariables(string $ad); } diff --git a/wcfsetup/install/files/lib/system/bbcode/media/provider/IBBCodeMediaProvider.class.php b/wcfsetup/install/files/lib/system/bbcode/media/provider/IBBCodeMediaProvider.class.php index 0ee38eb05da..fd111f13961 100644 --- a/wcfsetup/install/files/lib/system/bbcode/media/provider/IBBCodeMediaProvider.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/media/provider/IBBCodeMediaProvider.class.php @@ -15,9 +15,8 @@ interface IBBCodeMediaProvider /** * Parses given media url and returns output html. * - * @param string $url media url * @param string[] $matches * @return string output html */ - public function parse($url, array $matches = []); + public function parse(string $url, array $matches = []); } diff --git a/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php index 6fafff4c414..bc4ec3c1404 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php @@ -15,10 +15,9 @@ interface ICacheBuilder * Returns the data that ought to be cached. * * @param mixed[] $parameters - * @param string $arrayIndex * @return mixed */ - public function getData(array $parameters = [], $arrayIndex = ''); + public function getData(array $parameters = [], string $arrayIndex = ''); /** * Returns maximum lifetime for cache resource. diff --git a/wcfsetup/install/files/lib/system/cache/runtime/IRuntimeCache.class.php b/wcfsetup/install/files/lib/system/cache/runtime/IRuntimeCache.class.php index 9f5a64f38fe..439dd23d253 100644 --- a/wcfsetup/install/files/lib/system/cache/runtime/IRuntimeCache.class.php +++ b/wcfsetup/install/files/lib/system/cache/runtime/IRuntimeCache.class.php @@ -20,10 +20,9 @@ interface IRuntimeCache * Caches the given object id so that during the next object fetch, the object with * this id will also be fetched. * - * @param int $objectID * @return void */ - public function cacheObjectID($objectID); + public function cacheObjectID(int $objectID); /** * Caches the given object ids so that during the next object fetch, the objects with @@ -46,10 +45,9 @@ public function getCachedObjects(); * If the given object id should not have been cached before, it will be cached * during this method call and the object, if existing, will be returned. * - * @param int $objectID * @return ?TDatabaseObject */ - public function getObject($objectID); + public function getObject(int $objectID); /** * Returns the objects with the given ids. If an object does not exist, the array element @@ -65,10 +63,9 @@ public function getObjects(array $objectIDs); /** * Removes the object with the given id from the runtime cache if it has already been loaded. * - * @param int $objectID * @return void */ - public function removeObject($objectID); + public function removeObject(int $objectID); /** * Removes the objects with the given ids from the runtime cache if they have already been loaded. diff --git a/wcfsetup/install/files/lib/system/cache/source/ICacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/ICacheSource.class.php index 9261c4d34f3..355bf92de68 100644 --- a/wcfsetup/install/files/lib/system/cache/source/ICacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/ICacheSource.class.php @@ -14,11 +14,9 @@ interface ICacheSource /** * Flushes a specific cache, optionally removing caches which share the same name. * - * @param string $cacheName - * @param bool $useWildcard * @return void */ - public function flush($cacheName, $useWildcard); + public function flush(string $cacheName, bool $useWildcard); /** * Clears the cache completely. @@ -30,21 +28,16 @@ public function flushAll(); /** * Returns a cached variable. * - * @param string $cacheName - * @param int $maxLifetime * @return mixed */ - public function get($cacheName, $maxLifetime); + public function get(string $cacheName, int $maxLifetime); /** * Stores a variable in the cache. * - * @param string $cacheName - * @param mixed $value - * @param int $maxLifetime * @return void */ - public function set($cacheName, $value, $maxLifetime); + public function set(string $cacheName, mixed $value, int $maxLifetime); /** * Returns the timestamp when the cache was created. diff --git a/wcfsetup/install/files/lib/system/category/ICategoryType.class.php b/wcfsetup/install/files/lib/system/category/ICategoryType.class.php index c0bbe9c9a7a..067a7ac5403 100644 --- a/wcfsetup/install/files/lib/system/category/ICategoryType.class.php +++ b/wcfsetup/install/files/lib/system/category/ICategoryType.class.php @@ -78,10 +78,9 @@ public function getApplication(); * Returns the name of the object type of the definition with the given * name for categories of this type or `null` if no such object type exists. * - * @param string $definitionName * @return ?string */ - public function getObjectTypeName($definitionName); + public function getObjectTypeName(string $definitionName); /** * Returns the language variable category for the description language @@ -107,11 +106,9 @@ public function getI18nLangVarPrefix(); * a fallback to the default variables (in this example "wcf.category.list") * is used. * - * @param string $name - * @param bool $optional * @return string */ - public function getLanguageVariable($name, $optional = false); + public function getLanguageVariable(string $name, bool $optional = false); /** * Returns the maximum category nesting level for this type. "-1" means diff --git a/wcfsetup/install/files/lib/system/devtools/pip/IDevtoolsPipEntryList.class.php b/wcfsetup/install/files/lib/system/devtools/pip/IDevtoolsPipEntryList.class.php index 178aa45148b..67e2b7ae7de 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/IDevtoolsPipEntryList.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/IDevtoolsPipEntryList.class.php @@ -22,7 +22,7 @@ interface IDevtoolsPipEntryList * @return void * @throws \BadMethodCallException if no keys have been set */ - public function addEntry($id, array $entry); + public function addEntry(string $id, array $entry); /** * Internally filters the entries using the given filter. @@ -36,16 +36,14 @@ public function addEntry($id, array $entry); * @param string|array $filter either a string that is used to search all entry elements or filter map `key => searchString` * @return void */ - public function filterEntries($filter); + public function filterEntries(string|array $filter); /** * Returns all entries in the list. * - * @param ?int $startIndex - * @param ?int $entryCount * @return array */ - public function getEntries($startIndex = null, $entryCount = null); + public function getEntries(?int $startIndex = null, ?int $entryCount = null); /** * Returns the expected keys of the entries that can be used to display the @@ -65,7 +63,7 @@ public function getKeys(); * @param string $id unique entry identifier * @return bool */ - public function hasEntry($id); + public function hasEntry(string $id); /** * Sets the keys of the entries that can be used to display the entry list diff --git a/wcfsetup/install/files/lib/system/devtools/pip/IGuiPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/devtools/pip/IGuiPackageInstallationPlugin.class.php index 9c8cc6d60c6..30324b72474 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/IGuiPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/IGuiPackageInstallationPlugin.class.php @@ -32,17 +32,16 @@ public function addEntry(IFormDocument $form); * * @throws \InvalidArgumentException if no such entry exists or delete instruction should be added but is not supported */ - public function deleteEntry($identifier, $addDeleteInstruction); + public function deleteEntry(string $identifier, bool $addDeleteInstruction); /** * Edits the entry of this pip with the given identifier based on the data * provided by the given form and returns the new identifier of the entry * (or the old identifier if it has not changed). * - * @param string $identifier * @return string new identifier */ - public function editEntry(IFormDocument $form, $identifier); + public function editEntry(IFormDocument $form, string $identifier); /** * Returns additional template code for the form to add and edit entries. @@ -62,22 +61,20 @@ public function getEntryList(); * Informs the pip of the identifier of the edited entry if the form to * edit that entry has been submitted. * - * @param string $identifier * @return void * * @throws \InvalidArgumentException if no such entry exists */ - public function setEditedEntryIdentifier($identifier); + public function setEditedEntryIdentifier(string $identifier); /** * Adds the data of the pip entry with the given identifier into the * given form and returns `true`. If no entry with the given identifier * exists, `false` is returned. * - * @param string $identifier * @return bool */ - public function setEntryData($identifier, IFormDocument $document); + public function setEntryData(string $identifier, IFormDocument $document); /** * Returns the list of available entry types. If only one entry type is @@ -106,7 +103,7 @@ public function populateForm(IFormDocument $form); * * @throws \InvalidArgumentException if the given entry type is invalid (see `getEntryTypes()` method) */ - public function setEntryType($entryType); + public function setEntryType(string $entryType); /** * Returns `true` if this package installation plugin supports delete diff --git a/wcfsetup/install/files/lib/system/event/IEventListener.class.php b/wcfsetup/install/files/lib/system/event/IEventListener.class.php index b776ada0969..6c0688f3e4a 100644 --- a/wcfsetup/install/files/lib/system/event/IEventListener.class.php +++ b/wcfsetup/install/files/lib/system/event/IEventListener.class.php @@ -16,10 +16,7 @@ interface IEventListener /** * Executes this action. * - * @param mixed $eventObj - * @param string $className - * @param string $eventName * @return void */ - public function execute($eventObj, $className, $eventName); + public function execute(mixed $eventObj, string $className, string $eventName); } diff --git a/wcfsetup/install/files/lib/system/event/listener/IParameterizedEventListener.class.php b/wcfsetup/install/files/lib/system/event/listener/IParameterizedEventListener.class.php index f23c4350fd3..f4dbc76cafc 100644 --- a/wcfsetup/install/files/lib/system/event/listener/IParameterizedEventListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/IParameterizedEventListener.class.php @@ -23,5 +23,5 @@ interface IParameterizedEventListener * @param mixed[] &$parameters given parameters * @return void */ - public function execute($eventObj, $className, $eventName, array &$parameters); + public function execute(mixed $eventObj, string $className, string $eventName, array &$parameters); } diff --git a/wcfsetup/install/files/lib/system/form/IFormElement.class.php b/wcfsetup/install/files/lib/system/form/IFormElement.class.php index f534683b699..0f0a932272a 100644 --- a/wcfsetup/install/files/lib/system/form/IFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/IFormElement.class.php @@ -23,10 +23,9 @@ public function getDescription(); /** * Sets form element description. * - * @param string $description * @return void */ - public function setDescription($description); + public function setDescription(string $description); /** * Returns label. @@ -38,10 +37,9 @@ public function getLabel(); /** * Sets label. * - * @param string $label * @return void */ - public function setLabel($label); + public function setLabel(string $label); /** * Returns element's parent container element. @@ -53,18 +51,16 @@ public function getParent(); /** * Returns HTML-representation of current form element. * - * @param string $formName * @return string */ - public function getHTML($formName); + public function getHTML(string $formName); /** * Sets localized error message. * - * @param string $error * @return void */ - public function setError($error); + public function setError(string $error); /** * Returns localized error message, empty if no error occurred. diff --git a/wcfsetup/install/files/lib/system/form/IFormElementContainer.class.php b/wcfsetup/install/files/lib/system/form/IFormElementContainer.class.php index c7ad214b807..00620436d2b 100644 --- a/wcfsetup/install/files/lib/system/form/IFormElementContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/IFormElementContainer.class.php @@ -21,10 +21,9 @@ public function getDescription(); /** * Sets form element container description. * - * @param string $description * @return void */ - public function setDescription($description); + public function setDescription(string $description); /** * Returns label. @@ -36,18 +35,16 @@ public function getLabel(); /** * Sets label. * - * @param string $label * @return void */ - public function setLabel($label); + public function setLabel(string $label); /** * Returns the value of child element with given name. * - * @param string $key * @return mixed */ - public function getValue($key); + public function getValue(string $key); /** * Returns a list of child elements. @@ -83,17 +80,14 @@ public function handleRequest(array $variables); /** * Returns HTML-representation of current form element container. * - * @param string $formName * @return string */ - public function getHTML($formName); + public function getHTML(string $formName); /** * Sets localized error message for named element. * - * @param string $name - * @param string $error * @return void */ - public function setError($name, $error); + public function setError(string $name, string $error); } diff --git a/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php b/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php index 367647e0b87..bb33ddbe309 100644 --- a/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/IFormDocument.class.php @@ -32,18 +32,16 @@ interface IFormDocument extends IFormParentNode /** * Sets the `action` property of the HTML `form` element and returns this document. * - * @param string $action form action * @return static this document * * @throws \InvalidArgumentException if the given action is invalid */ - public function action($action); + public function action(string $action); /** * Adds the given button to the `formSubmit` element at the end of the form and returns this * document. * - * @param IFormButton $button added button * @return static this document */ public function addButton(IFormButton $button); @@ -51,20 +49,18 @@ public function addButton(IFormButton $button); /** * Sets whether the default button is added to the form during in the `build()` method. * - * @param bool $addDefaultButton * @return static this document * @throws \BadMethodCallException if the form has already been built */ - public function addDefaultButton($addDefaultButton = true); + public function addDefaultButton(bool $addDefaultButton = true); /** * Sets whether this form is requested via an AJAX request or processes data via an AJAX * request and returns his document. * - * @param bool $ajax * @return static this document */ - public function ajax($ajax = true); + public function ajax(bool $ajax = true); /** * Is called once after all nodes have been added to this document. @@ -99,18 +95,17 @@ public function didReadValues(); * * @throws \InvalidArgumentException if the given form mode is invalid */ - public function errorMessage($languageItem = null, array $variables = []); + public function errorMessage(?string $languageItem = null, array $variables = []); /** * Sets the form mode (see `self::FORM_MODE_*` constants). * - * @param string $formMode form mode * @return static this document * * @throws \BadMethodCallException if the form mode has already been set * @throws \InvalidArgumentException if the given form mode is invalid */ - public function formMode($formMode); + public function formMode(string $formMode); /** * Returns the `action` property of the HTML `form` element. @@ -124,12 +119,11 @@ public function getAction(); /** * Returns the button with the given id. * - * @param string $buttonId id of requested button * @return IFormButton * * @throws \InvalidArgumentException if no such button exists */ - public function getButton($buttonId); + public function getButton(string $buttonId); /** * Returns the buttons registered for this form document. @@ -220,7 +214,7 @@ public function getPrefix(); * * @throws \InvalidArgumentException if invalid index is given */ - public function getRequestData($index = null); + public function getRequestData(?string $index = null); /** * Returns the success message for the whole form. @@ -235,10 +229,9 @@ public function getSuccessMessage(); /** * Returns `true` if a button with the given id exists and `false` otherwise. * - * @param string $buttonId id of checked button * @return bool */ - public function hasButton($buttonId); + public function hasButton(string $buttonId); /** * Returns `true` if the default button is added to the form during in the `build()` method @@ -260,7 +253,7 @@ public function hasDefaultButton(); * @param ?string $index array index of the returned data * @return bool */ - public function hasRequestData($index = null); + public function hasRequestData(?string $index = null); /** * Returns `true` if this form is requested via an AJAX request or processes data via an @@ -285,10 +278,9 @@ public function isInvalid(); /** * Sets if the form document is in invalid due to external factors. * - * @param bool $invalid * @return static this document */ - public function invalid($invalid = true); + public function invalid(bool $invalid = true); /** * Returns `true` if the information about required fields has to be shown below the form. @@ -309,7 +301,7 @@ public function needsRequiredFieldsInfo(); * @param bool $loadValues indicates if the object's values are loaded * @return static this document */ - public function updatedObject(IStorableObject $object, $loadValues = true); + public function updatedObject(IStorableObject $object, bool $loadValues = true); /** * Sets whether required fields are marked in the output and returns this document. @@ -331,12 +323,11 @@ public function marksRequiredFields(): bool; /** * Sets the `method` property of the HTML `form` element and returns this document. * - * @param string $method form method * @return static this document * * @throws \InvalidArgumentException if the given method is invalid */ - public function method($method); + public function method(string $method); /** * Sets the global form prefix that is prepended to form elements' names and ids to @@ -345,12 +336,11 @@ public function method($method); * Note: The prefix is not relevant when using the `IFormParentNode::getNodeById()`. * It is only relevant when printing the form and reading the form values. * - * @param string $prefix global form prefix * @return static this document * * @throws \InvalidArgumentException if the given prefix is invalid */ - public function prefix($prefix); + public function prefix(string $prefix); /** * Sets the request data of the form's fields. @@ -365,18 +355,16 @@ public function requestData(array $requestData); /** * Sets if the global form error message should be shown if the form has validation errors. * - * @param bool $showErrorMessage * @return static this document */ - public function showErrorMessage($showErrorMessage = true); + public function showErrorMessage(bool $showErrorMessage = true); /** * Sets if the global form success message should be shown. * - * @param bool $showSuccessMessage * @return static this document */ - public function showSuccessMessage($showSuccessMessage = true); + public function showSuccessMessage(bool $showSuccessMessage = true); /** * Returns `true` if the global form error message should be shown if the form has validation @@ -410,7 +398,7 @@ public function showsSuccessMessage(); * * @throws \InvalidArgumentException if the given form mode is invalid */ - public function successMessage($languageItem = null, array $variables = []); + public function successMessage(?string $languageItem = null, array $variables = []); /** * Returns the form field with the given id or `null` if no such field exists. diff --git a/wcfsetup/install/files/lib/system/form/builder/IFormNode.class.php b/wcfsetup/install/files/lib/system/form/builder/IFormNode.class.php index bc7a830c9df..8f89e8905f6 100644 --- a/wcfsetup/install/files/lib/system/form/builder/IFormNode.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/IFormNode.class.php @@ -170,44 +170,40 @@ public function getPrefixedId(); * Returns `true` if an additional attribute with the given name exists and returns * `false` otherwise. * - * @param string $name attribute name * @return bool * * @throws \InvalidArgumentException if the given attribute name is invalid */ - public function hasAttribute($name); + public function hasAttribute(string $name); /** * Returns `true` if a CSS class with the given name exists and returns `false` otherwise. * - * @param string $class checked CSS class * @return bool * * @throws \InvalidArgumentException if the given class is invalid */ - public function hasClass($class); + public function hasClass(string $class); /** * Returns `true` if this node has a dependency with the given id and * returns `false` otherwise. * - * @param string $dependencyId id of the checked dependency * @return bool * * @throws \InvalidArgumentException if the given id is invalid */ - public function hasDependency($dependencyId); + public function hasDependency(string $dependencyId); /** * Sets the id of the node. * - * @param string $id new id of node * @return static this node * * @throws \BadMethodCallException if id has already been set * @throws \InvalidArgumentException if the given id is invalid */ - public function id($id); + public function id(string $id); /** * Returns `true` if this node is available and returns `false` otherwise. @@ -238,12 +234,11 @@ public function populate(); * If this node does not have the given attribute, this method silently * ignores that fact. * - * @param string $name removed attribute * @return static this node * * @throws \InvalidArgumentException if the given attribute is invalid */ - public function removeAttribute($name); + public function removeAttribute(string $name); /** * Removes the given CSS class and returns this node. @@ -251,22 +246,20 @@ public function removeAttribute($name); * If this node does not have the given CSS class, this method silently * ignores that fact. * - * @param string $class removed CSS class * @return static this node * * @throws \InvalidArgumentException if the given class is invalid */ - public function removeClass($class); + public function removeClass(string $class); /** * Removes the dependency with the given id and returns this node. * - * @param string $dependencyId id of the removed dependency * @return static this node * * @throws \InvalidArgumentException if the given id is invalid or no such dependency exists */ - public function removeDependency($dependencyId); + public function removeDependency(string $dependencyId); /** * Validates the node. diff --git a/wcfsetup/install/files/lib/system/form/builder/IObjectTypeFormNode.class.php b/wcfsetup/install/files/lib/system/form/builder/IObjectTypeFormNode.class.php index 4ec4aa293ae..c2b30e5ac90 100644 --- a/wcfsetup/install/files/lib/system/form/builder/IObjectTypeFormNode.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/IObjectTypeFormNode.class.php @@ -27,14 +27,13 @@ public function getObjectType(); /** * Sets the name of the object type and returns this field. * - * @param string $objectType object type name * @return static this field * * @throws \BadMethodCallException if object type has already been set * @throws \UnexpectedValueException if object type definition returned by `getObjectTypeDefinition()` is unknown * @throws InvalidObjectTypeException if given object type name is invalid */ - public function objectType($objectType); + public function objectType(string $objectType); /** * Returns the name of the object type definition the set object type must be of. diff --git a/wcfsetup/install/files/lib/system/form/builder/button/IFormButton.class.php b/wcfsetup/install/files/lib/system/form/builder/button/IFormButton.class.php index eebfce480e7..f4bcbd9edc5 100644 --- a/wcfsetup/install/files/lib/system/form/builder/button/IFormButton.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/button/IFormButton.class.php @@ -19,11 +19,10 @@ interface IFormButton extends IFormChildNode, IFormElement * Sets the access key for this form button and returns this form button. If `null` is passed, * the previously set access key is unset. * - * @param ?string $accessKey button access key * @return static this form button * @throws \InvalidArgumentException if the given access key is invalid */ - public function accessKey($accessKey = null); + public function accessKey(?string $accessKey = null); /** * Returns the access key for this form button or `null` if no access key has been set. @@ -45,8 +44,7 @@ public function isSubmit(); /** * Sets whether this button is an `input[type=submit]` element or a `button` element. * - * @param bool $submit * @return static this form button */ - public function submit($submit = true); + public function submit(bool $submit = true); } diff --git a/wcfsetup/install/files/lib/system/form/builder/container/IFormContainer.class.php b/wcfsetup/install/files/lib/system/form/builder/container/IFormContainer.class.php index 205d01d22ad..4c35fb4a8c0 100644 --- a/wcfsetup/install/files/lib/system/form/builder/container/IFormContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/container/IFormContainer.class.php @@ -34,9 +34,8 @@ public function markAsRequired(); * * @param mixed[] $data data from which the values are extracted * @param IStorableObject $object object the data belongs to - * @param bool $loadValues * * @return static this container */ - public function updatedObject(array $data, IStorableObject $object, $loadValues = true); + public function updatedObject(array $data, IStorableObject $object, bool $loadValues = true); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IAutoFocusFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IAutoFocusFormField.class.php index 774973892f9..154c61d516e 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IAutoFocusFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IAutoFocusFormField.class.php @@ -15,10 +15,9 @@ interface IAutoFocusFormField extends IFormField /** * Sets whether this field is auto-focused and returns this field. * - * @param bool $autoFocus determines if field is auto-focused * @return static this field */ - public function autoFocus($autoFocus = true); + public function autoFocus(bool $autoFocus = true); /** * Returns `true` if this field is auto-focused and returns `false` otherwise. diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IFilterableSelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IFilterableSelectionFormField.class.php index 0ae482bda42..9d27e818510 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IFilterableSelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IFilterableSelectionFormField.class.php @@ -21,7 +21,7 @@ interface IFilterableSelectionFormField extends ISelectionFormField * @param bool $filterable determines if field's options are filterable by user * @return static this node */ - public function filterable($filterable = true); + public function filterable(bool $filterable = true); /** * Returns `true` if the selection options can be filtered by the user so diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IFormField.class.php index 4d87edc0a6e..89330390b22 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IFormField.class.php @@ -98,12 +98,11 @@ public function getValue(); * Returns `true` if this field has a validator with the given id and * returns `false` otherwise. * - * @param string $validatorId id of the checked validator * @return bool * * @throws \InvalidArgumentException if the given id is invalid */ - public function hasValidator($validatorId); + public function hasValidator(string $validatorId); /** * Returns `true` if this field provides a value that can simply be stored @@ -138,7 +137,7 @@ public function isRequired(); * @param bool $loadValues indicates if object data is loaded * @return static this field */ - public function updatedObject(array $data, IStorableObject $object, $loadValues = true); + public function updatedObject(array $data, IStorableObject $object, bool $loadValues = true); /** * Sets the name of the object property this field represents. If an empty @@ -155,7 +154,7 @@ public function updatedObject(array $data, IStorableObject $object, $loadValues * * @throws \InvalidArgumentException if the passed object property is no valid id */ - public function objectProperty($objectProperty); + public function objectProperty(string $objectProperty); /** * Reads the value of this field from request data and return this field. @@ -167,12 +166,11 @@ public function readValue(); /** * Removes the field value validator with the given id and returns this field. * - * @param string $validatorId id of the removed validator * @return static this field * * @throws \InvalidArgumentException if the given id is invalid or no such validator exists */ - public function removeValidator($validatorId); + public function removeValidator(string $validatorId); /** * Sets whether it is required to fill out this field and returns this field. @@ -180,15 +178,14 @@ public function removeValidator($validatorId); * @param bool $required determines if field has to be filled out * @return static this field */ - public function required($required = true); + public function required(bool $required = true); /** * Sets the value of this field and returns this field. * - * @param mixed $value new field value * @return static this field * * @throws \InvalidArgumentException if the given value is of an invalid type or otherwise is invalid */ - public function value($value); + public function value(mixed $value); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/II18nFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/II18nFormField.class.php index ccadc2a774b..858b4dd5e0e 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/II18nFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/II18nFormField.class.php @@ -43,7 +43,7 @@ public function hasPlainValue(); * @param bool $i18n determines if field is supports i18n input * @return static this field */ - public function i18n($i18n = true); + public function i18n(bool $i18n = true); /** * Sets whether this field's value must be i18n input and returns this field. @@ -54,7 +54,7 @@ public function i18n($i18n = true); * @param bool $i18nRequired determines if field value must be i18n input * @return static this field */ - public function i18nRequired($i18nRequired = true); + public function i18nRequired(bool $i18nRequired = true); /** * Returns `true` if this field supports i18n input and returns `false` otherwise. @@ -76,11 +76,10 @@ public function isI18nRequired(); * Sets the pattern for the language item used to save the i18n values * and returns this field. * - * @param string $pattern language item pattern * @return static this field * * @throws \BadMethodCallException if i18n is disabled for this field * @throws \InvalidArgumentException if the given pattern is invalid */ - public function languageItemPattern($pattern); + public function languageItemPattern(string $pattern); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IImmutableFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IImmutableFormField.class.php index 8df1a2f2c56..38edd63460e 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IImmutableFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IImmutableFormField.class.php @@ -15,10 +15,9 @@ interface IImmutableFormField extends IFormField /** * Sets whether the value of this field is immutable and returns this field. * - * @param bool $immutable determines if field value is immutable * @return static this field */ - public function immutable($immutable = true); + public function immutable(bool $immutable = true); /** * Returns `true` if the value of this field is immutable and returns `false` diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IMaximumLengthFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IMaximumLengthFormField.class.php index 6d7a635d3df..f55be03c8f0 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IMaximumLengthFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IMaximumLengthFormField.class.php @@ -26,19 +26,16 @@ public function getMaximumLength(); * Sets the maximum length of the values of this field. If `null` is passed, the * maximum length is removed. * - * @param ?int $maximumLength maximum field value length * @return static this field * * @throws \InvalidArgumentException if the given maximum length is no integer or otherwise invalid */ - public function maximumLength($maximumLength = null); + public function maximumLength(?int $maximumLength = null); /** * Validates the maximum length of the given text. * - * @param string $text validated text - * @param ?Language $language language of the validated text * @return void */ - public function validateMaximumLength($text, ?Language $language = null); + public function validateMaximumLength(string $text, ?Language $language = null); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IMinimumLengthFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IMinimumLengthFormField.class.php index 543e9869648..0c7b4f861ab 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IMinimumLengthFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IMinimumLengthFormField.class.php @@ -26,19 +26,16 @@ public function getMinimumLength(); * Sets the minimum length of the values of this field. If `null` is passed, the * minimum length is removed. * - * @param ?int $minimumLength minimum field value length * @return static this field * * @throws \InvalidArgumentException if the given minimum length is no int or otherwise invalid */ - public function minimumLength($minimumLength = null); + public function minimumLength(?int $minimumLength = null); /** * Validates the minimum length of the given text. * - * @param string $text validated text - * @param ?Language $language language of the validated text * @return void */ - public function validateMinimumLength($text, ?Language $language = null); + public function validateMinimumLength(string $text, ?Language $language = null); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IMultipleFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IMultipleFormField.class.php index 0cdb8e8d8f1..2e2b7c3323c 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IMultipleFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IMultipleFormField.class.php @@ -50,29 +50,26 @@ public function getMinimumMultiples(); * Sets the maximum number of values that can be selected or set and returns * this field. To unset the maximum number, pass `IMultipleFormField::NO_MAXIMUM_MULTIPLES`. * - * @param int $maximum maximum number of values * @return static this field * * @throws \InvalidArgumentException if the given maximum number of values is invalid */ - public function maximumMultiples($maximum); + public function maximumMultiples(int $maximum); /** * Sets the minimum number of values that can be selected or set and returns * this field. * - * @param int $minimum maximum number of values * @return static this field * * @throws \InvalidArgumentException if the given minimum number of values is invalid */ - public function minimumMultiples($minimum); + public function minimumMultiples(int $minimum); /** * Sets whether multiple values can be selected or set and returns this field. * - * @param bool $multiple determines if multiple values can be selected/set * @return static this field */ - public function multiple($multiple = true); + public function multiple(bool $multiple = true); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/INullableFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/INullableFormField.class.php index b4fcade0437..ae60762ee24 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/INullableFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/INullableFormField.class.php @@ -28,5 +28,5 @@ public function isNullable(); * @param bool $nullable determines if field supports `null` as its value * @return static this node */ - public function nullable($nullable = true); + public function nullable(bool $nullable = true); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IPlaceholderFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IPlaceholderFormField.class.php index ce3a3f085cc..19cfcae3774 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IPlaceholderFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IPlaceholderFormField.class.php @@ -31,5 +31,5 @@ public function getPlaceholder(); * * @throws \InvalidArgumentException if the given value is invalid */ - public function placeholder($languageItem = null, array $variables = []); + public function placeholder(?string $languageItem = null, array $variables = []); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ISelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ISelectionFormField.class.php index 99167ee0b46..ae73fc45a0d 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ISelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ISelectionFormField.class.php @@ -58,7 +58,7 @@ public function getOptions(); * @throws \InvalidArgumentException if given options are no array or callable or otherwise invalid * @throws \UnexpectedValueException if callable does not return an array */ - public function options($options, $nestedOptions = false, $labelLanguageItems = true); + public function options(array|callable|DatabaseObjectList $options, bool $nestedOptions = false, bool $labelLanguageItems = true); /** * Returns `true` if the field class supports nested options and `false` otherwise. diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ISuffixedFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ISuffixedFormField.class.php index 38b4bdbb06a..c7d5ad21f48 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ISuffixedFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ISuffixedFormField.class.php @@ -29,5 +29,5 @@ public function getSuffix(); * * @throws \InvalidArgumentException if the given language item is invalid */ - public function suffix($languageItem = null, array $variables = []); + public function suffix(?string $languageItem = null, array $variables = []); } diff --git a/wcfsetup/install/files/lib/system/form/builder/field/dependency/IFormFieldDependency.class.php b/wcfsetup/install/files/lib/system/form/builder/field/dependency/IFormFieldDependency.class.php index ce3fb87618f..7811c813392 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/dependency/IFormFieldDependency.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/dependency/IFormFieldDependency.class.php @@ -49,12 +49,11 @@ public function field(IFormField $field); * This method should only be used before building the form as afterwards, * the actual field is no automatically set. * - * @param string $fieldId field id * @return static this dependency * * @throws \BadMethodCallException if the field has already been set */ - public function fieldId($fieldId); + public function fieldId(string $fieldId); /** * Returns the node whose availability depends on the value of a field. diff --git a/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidationError.class.php b/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidationError.class.php index 32f3b11a2d4..8580b32dd19 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidationError.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidationError.class.php @@ -23,7 +23,7 @@ interface IFormFieldValidationError * * @throws \InvalidArgumentException if the given error type is invalid */ - public function __construct($type, $languageItem = null, array $information = []); + public function __construct(string $type, ?string $languageItem = null, array $information = []); /** * Returns the HTML element representing the error. diff --git a/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidator.class.php b/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidator.class.php index aab3c76d011..52507941fa3 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidator.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/validation/IFormFieldValidator.class.php @@ -17,17 +17,13 @@ interface IFormFieldValidator /** * Initializes a new validator. * - * @param string $id id of the validator - * @param callable $validator validation function - * * @throws \InvalidArgumentException if the given id is invalid */ - public function __construct($id, callable $validator); + public function __construct(string $id, callable $validator); /** * Validates the value of the given field. * - * @param IFormField $field validated field * @return void */ public function __invoke(IFormField $field); diff --git a/wcfsetup/install/files/lib/system/html/input/filter/IHtmlInputFilter.class.php b/wcfsetup/install/files/lib/system/html/input/filter/IHtmlInputFilter.class.php index 91e9e0cda79..f3300bec246 100644 --- a/wcfsetup/install/files/lib/system/html/input/filter/IHtmlInputFilter.class.php +++ b/wcfsetup/install/files/lib/system/html/input/filter/IHtmlInputFilter.class.php @@ -15,8 +15,7 @@ interface IHtmlInputFilter /** * Applies filters on unsafe html. * - * @param string $html unsafe html * @return string filtered html */ - public function apply($html); + public function apply(string $html); } diff --git a/wcfsetup/install/files/lib/system/html/node/IHtmlNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/node/IHtmlNodeProcessor.class.php index e789f474975..2c095fd6cf1 100644 --- a/wcfsetup/install/files/lib/system/html/node/IHtmlNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/node/IHtmlNodeProcessor.class.php @@ -39,10 +39,9 @@ public function getHtmlProcessor(); * Loads a HTML string for processing. * * @param IHtmlProcessor $htmlProcessor html processor - * @param string $html HTML string * @return void */ - public function load(IHtmlProcessor $htmlProcessor, $html); + public function load(IHtmlProcessor $htmlProcessor, string $html); /** * Processes the HTML and transforms it depending on the output type. diff --git a/wcfsetup/install/files/lib/system/html/output/node/IHtmlOutputNode.class.php b/wcfsetup/install/files/lib/system/html/output/node/IHtmlOutputNode.class.php index 2b11e2bd2a1..303a510c4f2 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/IHtmlOutputNode.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/IHtmlOutputNode.class.php @@ -17,8 +17,7 @@ interface IHtmlOutputNode extends IHtmlNode /** * Sets the desired output type. * - * @param string $outputType desired output type * @return void */ - public function setOutputType($outputType); + public function setOutputType(string $outputType); } diff --git a/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php index e0154d86e86..b3c4c1ebc6b 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/IImageAdapter.class.php @@ -16,140 +16,98 @@ interface IImageAdapter * Loads an image resource. * * @param T $image - * @param int $type * @return void */ - public function load($image, $type = 0); + public function load(object $image, int $type = 0); /** * Loads an image from file. * - * @param string $file * @return void */ - public function loadFile($file); + public function loadFile(string $file); /** * Creates a new empty image. * - * @param int $width - * @param int $height * @return void */ - public function createEmptyImage($width, $height); + public function createEmptyImage(int $width, int $height); /** * Creates a thumbnail from previously loaded image. * - * @param int $maxWidth - * @param int $maxHeight - * @param bool $preserveAspectRatio * @return mixed */ - public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true); + public function createThumbnail(int $maxWidth, int $maxHeight, bool $preserveAspectRatio = true); /** * Clips a part of currently loaded image, overwrites image resource within instance. * - * @param int $originX - * @param int $originY - * @param int $width - * @param int $height * @return void * @see \wcf\system\image\adapter\IImageAdapter::getImage() */ - public function clip($originX, $originY, $width, $height); + public function clip(int $originX, int $originY, int $width, int $height); /** * Resizes an image with optional scaling, overwrites image resource within instance. * - * @param int $originX - * @param int $originY - * @param int $originWidth - * @param int $originHeight - * @param int $targetWidth - * @param int $targetHeight * @return void * @see \wcf\system\image\adapter\IImageAdapter::getImage() */ - public function resize($originX, $originY, $originWidth, $originHeight, $targetWidth, $targetHeight); + public function resize(int $originX, int $originY, int $originWidth, int $originHeight, int $targetWidth, int $targetHeight); /** * Draws a rectangle, overwrites image resource within instance. * - * @param int $startX - * @param int $startY - * @param int $endX - * @param int $endY * @return void * @see \wcf\system\image\adapter\IImageAdapter::getImage() * @see \wcf\system\image\adapter\IImageAdapter::setColor() */ - public function drawRectangle($startX, $startY, $endX, $endY); + public function drawRectangle(int $startX, int $startY, int $endX, int $endY); /** * Draws a line of text, overwrites image resource within instance. * - * @param string $text - * @param int $x - * @param int $y * @param string $font path to TrueType font file - * @param int $size font size - * @param float $opacity * @return void * @see \wcf\system\image\adapter\IImageAdapter::getImage() * @see \wcf\system\image\adapter\IImageAdapter::setColor() */ - public function drawText($text, $x, $y, $font, $size, $opacity = 1.0); + public function drawText(string $text, int $x, int $y, string $font, int $size, float $opacity = 1.0); /** * Draws (multiple lines of) text on the image at the given relative position * with a certain margin to the image border. * - * @param string $text - * @param string $position - * @param int $margin in pixels - * @param int $offsetX - * @param int $offsetY * @param string $font path to TrueType font file - * @param int $size font size - * @param float $opacity * @return void */ - public function drawTextRelative($text, $position, $margin, $offsetX, $offsetY, $font, $size, $opacity = 1.0); + public function drawTextRelative(string $text, string $position, int $margin, int $offsetX, int $offsetY, string $font, int $size, float $opacity = 1.0); /** * Returns true if the given text fits the image. * - * @param string $text - * @param int $margin * @param string $font path to TrueType font file - * @param int $size font size * @return bool */ - public function textFitsImage($text, $margin, $font, $size); + public function textFitsImage(string $text, int $margin, string $font, int $size); /** * Adjusts the given font size so that the given text fits on the current * image. Returns 0 if no appropriate font size could be determined. * - * @param string $text - * @param int $margin * @param string $font path to TrueType font file - * @param int $size font size * @return int */ - public function adjustFontSize($text, $margin, $font, $size); + public function adjustFontSize(string $text, int $margin, string $font, int $size); /** * Sets active color. * - * @param int $red - * @param int $green - * @param int $blue * @return void */ - public function setColor($red, $green, $blue); + public function setColor(int $red, int $green, int $blue); /** * Returns true if a color has been set. @@ -161,21 +119,17 @@ public function hasColor(); /** * Sets a color to be transparent with alpha 0. * - * @param int $red - * @param int $green - * @param int $blue * @return void */ - public function setTransparentColor($red, $green, $blue); + public function setTransparentColor(int $red, int $green, int $blue); /** * Writes an image to disk. * * @param T|string $image - * @param ?string $filename * @return void */ - public function writeImage($image, $filename); + public function writeImage(object|string $image, ?string $filename); /** * Returns image resource. @@ -211,37 +165,28 @@ public function getType(); * @param float $degrees number of degrees to rotate the image clockwise * @return mixed */ - public function rotate($degrees); + public function rotate(float $degrees); /** * Overlays the given image at an absolute position. * - * @param string $file - * @param int $x - * @param int $y - * @param float $opacity * @return void */ - public function overlayImage($file, $x, $y, $opacity); + public function overlayImage(string $file, int $x, int $y, float $opacity); /** * Overlays the given image at a relative position. * - * @param string $file - * @param string $position - * @param int $margin - * @param float $opacity * @return void */ - public function overlayImageRelative($file, $position, $margin, $opacity); + public function overlayImageRelative(string $file, string $position, int $margin, float $opacity); /** * Saves an image using a different file type. * - * @param T $image * @since 5.4 */ - public function saveImageAs($image, string $filename, string $type, int $quality = 100): void; + public function saveImageAs(object $image, string $filename, string $type, int $quality = 100): void; /** * Determines if an image adapter is supported. diff --git a/wcfsetup/install/files/lib/system/image/adapter/IMemoryAwareImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/IMemoryAwareImageAdapter.class.php index 43270df5994..9fb4ea4b6b0 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/IMemoryAwareImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/IMemoryAwareImageAdapter.class.php @@ -19,10 +19,7 @@ interface IMemoryAwareImageAdapter extends IImageAdapter * Returns whether it is believed that sufficient memory * is available to process an image with the given properties. * - * @param int $width - * @param int $height - * @param string $mimeType * @return bool */ - public function checkMemoryLimit($width, $height, $mimeType); + public function checkMemoryLimit(int $width, int $height, string $mimeType); } diff --git a/wcfsetup/install/files/lib/system/importer/IImporter.class.php b/wcfsetup/install/files/lib/system/importer/IImporter.class.php index f1944042682..fbebd1cfbf8 100644 --- a/wcfsetup/install/files/lib/system/importer/IImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/IImporter.class.php @@ -14,12 +14,11 @@ interface IImporter /** * Imports a data set. * - * @param mixed $oldID * @param mixed[] $data * @param mixed[] $additionalData * @return mixed new id */ - public function import($oldID, array $data, array $additionalData = []); + public function import(mixed $oldID, array $data, array $additionalData = []); /** * Returns database object class name. diff --git a/wcfsetup/install/files/lib/system/io/IArchive.class.php b/wcfsetup/install/files/lib/system/io/IArchive.class.php index fd116b147d6..d2520d6c1f6 100644 --- a/wcfsetup/install/files/lib/system/io/IArchive.class.php +++ b/wcfsetup/install/files/lib/system/io/IArchive.class.php @@ -35,7 +35,7 @@ public function getContentList(); * @param mixed $index index or name of the requested file * @return FileInfo */ - public function getFileInfo($index); + public function getFileInfo(mixed $index); /** * Extracts a specific file and returns the content as string. Returns @@ -44,24 +44,22 @@ public function getFileInfo($index); * @param mixed $index index or name of the requested file * @return string|false content of the requested file */ - public function extractToString($index); + public function extractToString(mixed $index); /** * Extracts a specific file and writes its content to the file specified * with $destination. * * @param mixed $index index or name of the requested file - * @param string $destination * @return bool */ - public function extract($index, $destination); + public function extract(mixed $index, string $destination); /** * Searchs a file in the archive and returns the numeric file index. * Returns false if not found. * - * @param string $filename * @return int|false index of the requested file */ - public function getIndexByFilename($filename); + public function getIndexByFilename(string $filename); } diff --git a/wcfsetup/install/files/lib/system/label/object/ILabelObjectHandler.class.php b/wcfsetup/install/files/lib/system/label/object/ILabelObjectHandler.class.php index 06225ed2faf..99dae6ee0d1 100644 --- a/wcfsetup/install/files/lib/system/label/object/ILabelObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/label/object/ILabelObjectHandler.class.php @@ -34,39 +34,32 @@ public function getLabelGroups(array $parameters = []); * Returns true, if all given label ids are valid and accessible. * * @param int[] $labelIDs - * @param string $optionName - * @param bool $legacyReturnValue * @return mixed */ - public function validateLabelIDs(array $labelIDs, $optionName = '', $legacyReturnValue = true); + public function validateLabelIDs(array $labelIDs, string $optionName = '', bool $legacyReturnValue = true); /** * Assigns labels to an object. * * @param int[] $labelIDs - * @param int $objectID - * @param bool $validatePermissions * @return void * @see \wcf\system\label\LabelHandler::setLabels() */ - public function setLabels(array $labelIDs, $objectID, $validatePermissions = true); + public function setLabels(array $labelIDs, int $objectID, bool $validatePermissions = true); /** * Removes all assigned labels. * - * @param int $objectID - * @param bool $validatePermissions * @return void * @see \wcf\system\label\LabelHandler::removeLabels() */ - public function removeLabels($objectID, $validatePermissions = true); + public function removeLabels(int $objectID, bool $validatePermissions = true); /** * Returns a list of assigned labels. * * @param int[] $objectIDs - * @param bool $validatePermissions * @return Label[][] */ - public function getAssignedLabels(array $objectIDs, $validatePermissions = true); + public function getAssignedLabels(array $objectIDs, bool $validatePermissions = true); } diff --git a/wcfsetup/install/files/lib/system/label/object/type/ILabelObjectTypeHandler.class.php b/wcfsetup/install/files/lib/system/label/object/type/ILabelObjectTypeHandler.class.php index 133a06e15cf..51e5e9c69f7 100644 --- a/wcfsetup/install/files/lib/system/label/object/type/ILabelObjectTypeHandler.class.php +++ b/wcfsetup/install/files/lib/system/label/object/type/ILabelObjectTypeHandler.class.php @@ -26,11 +26,10 @@ public function getContainerForObjectType(ObjectType $objectType): LabelObjectTy /** * Sets object type id. * - * @param int $objectTypeID * @return void * @deprecated 6.2 Use `getContainerForObjectType()` instead. */ - public function setObjectTypeID($objectTypeID); + public function setObjectTypeID(int $objectTypeID); /** * Returns object type id. diff --git a/wcfsetup/install/files/lib/system/menu/user/profile/content/IUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/IUserProfileMenuContent.class.php index e83824c867e..043edf427af 100644 --- a/wcfsetup/install/files/lib/system/menu/user/profile/content/IUserProfileMenuContent.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/profile/content/IUserProfileMenuContent.class.php @@ -14,16 +14,14 @@ interface IUserProfileMenuContent /** * Returns content for this user profile menu item. * - * @param int $userID * @return string */ - public function getContent($userID); + public function getContent(int $userID); /** * Returns true if the associated menu item should be visible for the active user. * - * @param int $userID * @return bool */ - public function isVisible($userID); + public function isVisible(int $userID); } diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/ISimpleMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/ISimpleMessageEmbeddedObjectHandler.class.php index e61fbb2b864..43b66b8cac8 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/ISimpleMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/ISimpleMessageEmbeddedObjectHandler.class.php @@ -14,22 +14,17 @@ interface ISimpleMessageEmbeddedObjectHandler extends IMessageEmbeddedObjectHand /** * Validates the provided values for existence and returns the filtered list. * - * @param string $objectType object type identifier - * @param int $objectID object id * @param int[] $values list of value ids * @return int[] filtered list */ - public function validateValues($objectType, $objectID, array $values); + public function validateValues(string $objectType, int $objectID, array $values); /** * Returns replacement string for simple placeholders. Must return `null` * if no replacement should be performed due to invalid or missing arguments. * - * @param string $objectType object type identifier - * @param int $objectID object id - * @param string|int $value value id * @param array $attributes list of additional attributes * @return ?string replacement string or null if value id is unknown */ - public function replaceSimple($objectType, $objectID, $value, array $attributes); + public function replaceSimple(string $objectType, int $objectID, string|int $value, array $attributes); } diff --git a/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueManager.class.php index 052fd93b89f..64dc61a6e1e 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/IModerationQueueManager.class.php @@ -18,59 +18,50 @@ interface IModerationQueueManager /** * Creates queue assignments for matching object type ids. * - * @param int $objectTypeID * @param ModerationQueue[] $queues * @return void */ - public function assignQueues($objectTypeID, array $queues); + public function assignQueues(int $objectTypeID, array $queues); /** * Returns true if given object type is valid, optionally checking object id. * - * @param string $objectType - * @param int $objectID * @return bool */ - public function isValid($objectType, $objectID = null); + public function isValid(string $objectType, ?int $objectID = null); /** * Returns link for viewing/editing objects for this moderation type. * - * @param int $queueID * @return string */ - public function getLink($queueID); + public function getLink(int $queueID); /** * Returns object type id for given object type. * - * @param string $objectType * @return int */ - public function getObjectTypeID($objectType); + public function getObjectTypeID(string $objectType); /** * Returns object type processor by object type. * - * @param ?string $objectType - * @param ?int $objectTypeID * @return IModerationQueueHandler */ - public function getProcessor($objectType, $objectTypeID = null); + public function getProcessor(?string $objectType, ?int $objectTypeID = null); /** * Populates object properties for viewing. * - * @param int $objectTypeID * @param ViewableModerationQueue[] $objects * @return void */ - public function populate($objectTypeID, array $objects); + public function populate(int $objectTypeID, array $objects); /** * Returns whether the affected content may be removed. * - * @param ModerationQueue $queue * @return bool */ public function canRemoveContent(ModerationQueue $queue); @@ -79,11 +70,9 @@ public function canRemoveContent(ModerationQueue $queue); * Removes affected content. It is up to the processing object to use a * soft-delete or remove the content permanently. * - * @param ModerationQueue $queue - * @param string $message * @return void */ - public function removeContent(ModerationQueue $queue, $message = ''); + public function removeContent(ModerationQueue $queue, string $message = ''); /** * Returns the controller class that can be used to view/edit the moderation type diff --git a/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php index a28c5d97053..8ac65ba9b04 100644 --- a/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/IOptionHandler.class.php @@ -13,14 +13,7 @@ */ interface IOptionHandler { - /** - * Creates a new option handler instance. - * - * @param bool $supportI18n - * @param string $languageItemPattern - * @param string $categoryName - */ - public function __construct($supportI18n, $languageItemPattern = '', $categoryName = ''); + public function __construct(bool $supportI18n, string $languageItemPattern = '', string $categoryName = ''); /** * Reads user input from given source array. @@ -40,20 +33,16 @@ public function validate(); /** * Returns the tree of options. * - * @param string $parentCategoryName - * @param int $level * @return mixed[] */ - public function getOptionTree($parentCategoryName = '', $level = 0); + public function getOptionTree(string $parentCategoryName = '', int $level = 0); /** * Returns a list with the options of a specific option category. * - * @param string $categoryName - * @param bool $inherit * @return list