diff --git a/com.woltlab.wcf/templates/commentList.tpl b/com.woltlab.wcf/templates/commentList.tpl index 5e7c56156a8..66fcb604472 100644 --- a/com.woltlab.wcf/templates/commentList.tpl +++ b/com.woltlab.wcf/templates/commentList.tpl @@ -37,7 +37,7 @@ {lang}wcf.message.status.disabled{/lang} {/if} - {if $commentManager->isContentAuthor($comment)} + {if $commentManager->isContentAuthor($comment->getDecoratedObject())} {lang}wcf.comment.objectAuthor{/lang} {/if} diff --git a/com.woltlab.wcf/templates/commentResponseList.tpl b/com.woltlab.wcf/templates/commentResponseList.tpl index 801f772fab3..1cf25477b7e 100644 --- a/com.woltlab.wcf/templates/commentResponseList.tpl +++ b/com.woltlab.wcf/templates/commentResponseList.tpl @@ -33,7 +33,7 @@ {lang}wcf.message.status.disabled{/lang} {/if} - {if $commentManager->isContentAuthor($response)} + {if $commentManager->isContentAuthor($response->getDecoratedObject())} {lang}wcf.comment.objectAuthor{/lang} {/if} 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/DatabaseObjectDecorator.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php index e7a4e4bd832..97d179cde9b 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php @@ -47,7 +47,7 @@ public function __construct(DatabaseObject $object) /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { return $this->object->__get($name); } @@ -55,7 +55,7 @@ public function __get($name) /** * @inheritDoc */ - public function __isset($name) + public function __isset(string $name) { return $this->object->__isset($name); } diff --git a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php index 94c1eebddec..79ca3c9a302 100644 --- a/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php +++ b/wcfsetup/install/files/lib/data/DatabaseObjectList.class.php @@ -403,7 +403,7 @@ public function seek($offset): void /** * @inheritDoc */ - public function seekTo($objectID) + public function seekTo(int $objectID) { $this->index = \array_search($objectID, $this->indexToObject); @@ -415,7 +415,7 @@ public function seekTo($objectID) /** * @inheritDoc */ - public function search($objectID) + public function search(int $objectID) { try { $this->seekTo($objectID); 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/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/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/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/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/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/application/Application.class.php b/wcfsetup/install/files/lib/data/application/Application.class.php index 61819936632..24a498564ac 100644 --- a/wcfsetup/install/files/lib/data/application/Application.class.php +++ b/wcfsetup/install/files/lib/data/application/Application.class.php @@ -72,7 +72,7 @@ protected function handleData($data) /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { if (ENABLE_ENTERPRISE_MODE && \defined('ENTERPRISE_MODE_DOMAIN_OVERRIDE') && \PHP_SAPI !== 'cli') { if (ENTERPRISE_MODE_DOMAIN_OVERRIDE === $_SERVER['HTTP_HOST']) { diff --git a/wcfsetup/install/files/lib/data/article/FeedArticle.class.php b/wcfsetup/install/files/lib/data/article/FeedArticle.class.php index a1ba081d5aa..bdccc0f407f 100644 --- a/wcfsetup/install/files/lib/data/article/FeedArticle.class.php +++ b/wcfsetup/install/files/lib/data/article/FeedArticle.class.php @@ -60,7 +60,7 @@ public function getMessage() /** * @inheritDoc */ - public function getExcerpt($maxLength = 255) + public function getExcerpt(int $maxLength = 255) { return StringUtil::truncateHTML($this->getDecoratedObject()->getFormattedTeaser(), $maxLength); } diff --git a/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php b/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php index 0044605aa30..09a13a44529 100644 --- a/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php +++ b/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php @@ -62,7 +62,7 @@ public function getObjectID() /** * @inheritDoc */ - public function updateLikeCounter($cumulativeLikes) + public function updateLikeCounter(int $cumulativeLikes) { // update cumulative likes $editor = new ArticleEditor($this->getDecoratedObject()); diff --git a/wcfsetup/install/files/lib/data/article/content/SearchResultArticleContent.class.php b/wcfsetup/install/files/lib/data/article/content/SearchResultArticleContent.class.php index cb848f60cfc..6cb3123097f 100644 --- a/wcfsetup/install/files/lib/data/article/content/SearchResultArticleContent.class.php +++ b/wcfsetup/install/files/lib/data/article/content/SearchResultArticleContent.class.php @@ -44,7 +44,7 @@ public function getTime() /** * @inheritDoc */ - public function getLink($query = ''): string + public function getLink(string $query = ''): string { $parameters = [ 'object' => $this->getDecoratedObject(), diff --git a/wcfsetup/install/files/lib/data/attachment/Attachment.class.php b/wcfsetup/install/files/lib/data/attachment/Attachment.class.php index 1a3fae0d446..e7fb77d54f1 100644 --- a/wcfsetup/install/files/lib/data/attachment/Attachment.class.php +++ b/wcfsetup/install/files/lib/data/attachment/Attachment.class.php @@ -187,7 +187,7 @@ public function getTinyThumbnailLocation() * @inheritDoc * @deprecated 6.1 This will no longer be required once the attachments have been migrated. */ - public function getThumbnailLocation($size = '') + public function getThumbnailLocation(string $size = '') { if ($size == 'tiny') { $location = self::getStorage() . \substr( @@ -255,7 +255,7 @@ final protected function getLocationHelper($location) /** * @inheritDoc */ - public function getThumbnailLink($size = '') + public function getThumbnailLink(string $size = '') { $file = $this->getFile(); if ($file === null) { @@ -394,7 +394,7 @@ public function setFile(File $file): void } #[\Override] - public function __get($name) + public function __get(string $name) { if ($name === 'downloads' || $name === 'lastDownloadTime') { // Static files are no longer served through PHP but the web server diff --git a/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php b/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php index 77d2b19c725..acc52d9bcf2 100644 --- a/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php +++ b/wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php @@ -39,7 +39,7 @@ public function __construct(string $objectType) 'com.woltlab.wcf.attachment.objectType', $objectType ); - if ($objectType === null) { + if ($objectTypeObj === null) { throw new \BadMethodCallException("unknown attachment object type '{$objectType}'"); } diff --git a/wcfsetup/install/files/lib/data/box/Box.class.php b/wcfsetup/install/files/lib/data/box/Box.class.php index 5fc1697cd22..ce7aa264a9d 100644 --- a/wcfsetup/install/files/lib/data/box/Box.class.php +++ b/wcfsetup/install/files/lib/data/box/Box.class.php @@ -153,7 +153,7 @@ class Box extends DatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = parent::__get($name); diff --git a/wcfsetup/install/files/lib/data/category/Category.class.php b/wcfsetup/install/files/lib/data/category/Category.class.php index 04e037e3c9f..9849049c5dd 100644 --- a/wcfsetup/install/files/lib/data/category/Category.class.php +++ b/wcfsetup/install/files/lib/data/category/Category.class.php @@ -78,7 +78,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { // forward 'className' property requests to object type if ($name == 'className') { @@ -100,7 +100,7 @@ public function __get($name) /** * @inheritDoc */ - public function __isset($name) + public function __isset(string $name) { return parent::__isset($name) || isset($this->data['additionalData'][$name]); } @@ -209,7 +209,7 @@ public function isParentCategory(self $category) /** * @inheritDoc */ - public function getPermission($permission, ?User $user = null) + public function getPermission(string $permission, ?User $user = null) { if ($user === null) { $user = WCF::getUser(); diff --git a/wcfsetup/install/files/lib/data/comment/Comment.class.php b/wcfsetup/install/files/lib/data/comment/Comment.class.php index f0195c2dd51..be42a3fa060 100644 --- a/wcfsetup/install/files/lib/data/comment/Comment.class.php +++ b/wcfsetup/install/files/lib/data/comment/Comment.class.php @@ -140,7 +140,7 @@ public function getMailText($mimeType = 'text/plain') /** * @inheritDoc */ - public function getExcerpt($maxLength = 255) + public function getExcerpt(int $maxLength = 255) { return StringUtil::truncateHTML($this->getSimplifiedFormattedMessage(), $maxLength); } diff --git a/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php b/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php index e646f93c787..9e6c88b939c 100644 --- a/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php +++ b/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php @@ -89,7 +89,7 @@ public function prepare(array $likes) } #[\Override] - public function getObjectByID($objectID) + public function getObjectByID(int $objectID) { return new LikeableComment(CommentRuntimeCache::getInstance()->getObject($objectID)); } diff --git a/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php b/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php index 9d6fd35f7bb..6823ab3f38c 100644 --- a/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php @@ -104,7 +104,7 @@ public function getMailText($mimeType = 'text/plain') /** * @inheritDoc */ - public function getExcerpt($maxLength = 255) + public function getExcerpt(int $maxLength = 255) { return StringUtil::truncateHTML($this->getSimplifiedFormattedMessage(), $maxLength); } diff --git a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php index fb4a9efcd6c..02e5f9c3706 100644 --- a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php @@ -104,7 +104,7 @@ public function prepare(array $likes) } #[\Override] - public function getObjectByID($objectID) + public function getObjectByID(int $objectID) { return new LikeableCommentResponse(CommentResponseRuntimeCache::getInstance()->getObject($objectID)); } diff --git a/wcfsetup/install/files/lib/data/condition/Condition.class.php b/wcfsetup/install/files/lib/data/condition/Condition.class.php index b7171427482..08636c781bf 100644 --- a/wcfsetup/install/files/lib/data/condition/Condition.class.php +++ b/wcfsetup/install/files/lib/data/condition/Condition.class.php @@ -22,7 +22,7 @@ class Condition extends DatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = parent::__get($name); diff --git a/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php b/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php index 0bf4695a521..7d9b2bce57c 100644 --- a/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php +++ b/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php @@ -44,7 +44,7 @@ abstract class CustomOption extends Option implements ITitledObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { // Some options support empty values, such as "select", but the code checks for the // property `allowEmptyValue`, which is the inverse value of `required`. diff --git a/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php b/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php index e318965c978..21ec00c6f8d 100644 --- a/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php +++ b/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php @@ -240,7 +240,7 @@ public function seek($offset): void /** * @inheritDoc */ - public function seekTo($objectID) + public function seekTo(int $objectID) { $this->index = \array_search($objectID, $this->indexToObject); @@ -252,7 +252,7 @@ public function seekTo($objectID) /** * @inheritDoc */ - public function search($objectID) + public function search(int $objectID) { try { $this->seekTo($objectID); 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/media/Media.class.php b/wcfsetup/install/files/lib/data/media/Media.class.php index 9cd410e2538..44ed566086a 100644 --- a/wcfsetup/install/files/lib/data/media/Media.class.php +++ b/wcfsetup/install/files/lib/data/media/Media.class.php @@ -116,7 +116,7 @@ public function getLocation() /** * @inheritDoc */ - public function getThumbnailLink($size) + public function getThumbnailLink(string $size) { if (!isset(self::$thumbnailSizes[$size])) { throw new \InvalidArgumentException("Unknown thumbnail size '" . $size . "'"); @@ -176,7 +176,7 @@ public function getThumbnailHeight($size) /** * @inheritDoc */ - public function getThumbnailLocation($size) + public function getThumbnailLocation(string $size) { if (!isset(self::$thumbnailSizes[$size])) { throw new \InvalidArgumentException("Unknown thumbnail size '" . $size . "'"); diff --git a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php index 324a6e19da6..9ce1d5a9b8f 100644 --- a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php +++ b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php @@ -92,7 +92,7 @@ protected function forceLanguageID($languageID) /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { if ($this->forceLanguageID !== null && isset($this->localizedContent[$this->forceLanguageID][$name])) { return $this->localizedContent[$this->forceLanguageID][$name]; diff --git a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php index d8ad638b5b5..a6fed0036a6 100644 --- a/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php +++ b/wcfsetup/install/files/lib/data/moderation/queue/ModerationQueue.class.php @@ -44,7 +44,7 @@ class ModerationQueue extends DatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = parent::__get($name); diff --git a/wcfsetup/install/files/lib/data/modification/log/ModificationLog.class.php b/wcfsetup/install/files/lib/data/modification/log/ModificationLog.class.php index 73ba0c57140..332a34c1ca6 100644 --- a/wcfsetup/install/files/lib/data/modification/log/ModificationLog.class.php +++ b/wcfsetup/install/files/lib/data/modification/log/ModificationLog.class.php @@ -27,7 +27,7 @@ class ModificationLog extends DatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = parent::__get($name); diff --git a/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php b/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php index 090ce33b089..5e4129f5a41 100644 --- a/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php +++ b/wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php @@ -39,7 +39,7 @@ abstract class AbstractObjectTypeProvider implements IObjectTypeProvider /** * @inheritDoc */ - public function getObjectByID($objectID) + public function getObjectByID(int $objectID) { $object = new $this->className($objectID); if ($this->decoratorClassName) { 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/object/type/ObjectType.class.php b/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php index 25a23061f51..1b6655fed74 100644 --- a/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php +++ b/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php @@ -40,7 +40,7 @@ class ObjectType extends ProcessibleDatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = parent::__get($name); diff --git a/wcfsetup/install/files/lib/data/option/Option.class.php b/wcfsetup/install/files/lib/data/option/Option.class.php index aa8c41f8df8..69e0c9e04fa 100644 --- a/wcfsetup/install/files/lib/data/option/Option.class.php +++ b/wcfsetup/install/files/lib/data/option/Option.class.php @@ -41,7 +41,7 @@ class Option extends DatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = $this->data[$name] ?? null; diff --git a/wcfsetup/install/files/lib/data/page/content/SearchResultPageContent.class.php b/wcfsetup/install/files/lib/data/page/content/SearchResultPageContent.class.php index 5e5c8f1f49d..f3251ca9a50 100644 --- a/wcfsetup/install/files/lib/data/page/content/SearchResultPageContent.class.php +++ b/wcfsetup/install/files/lib/data/page/content/SearchResultPageContent.class.php @@ -53,7 +53,7 @@ public function getTime() /** * @inheritDoc */ - public function getLink($query = '') + public function getLink(string $query = '') { return LinkHandler::getInstance()->getCmsLink( $this->getDecoratedObject()->pageID, 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/data/smiley/category/SmileyCategory.class.php b/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php index 5b26b635248..f9919cc6251 100644 --- a/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php +++ b/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php @@ -122,7 +122,7 @@ public function seek($offset): void /** * @inheritDoc */ - public function seekTo($objectID) + public function seekTo(int $objectID) { $this->index = \array_search($objectID, $this->indexToObject); @@ -135,7 +135,7 @@ public function seekTo($objectID) * @inheritDoc * @return Smiley|null */ - public function search($objectID) + public function search(int $objectID) { try { $this->seekTo($objectID); diff --git a/wcfsetup/install/files/lib/data/user/User.class.php b/wcfsetup/install/files/lib/data/user/User.class.php index 0ef3c379d2f..db975acbf39 100644 --- a/wcfsetup/install/files/lib/data/user/User.class.php +++ b/wcfsetup/install/files/lib/data/user/User.class.php @@ -334,7 +334,7 @@ public static function getUserOptionID($name) /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { return $this->data[$name] ?? $this->getUserOption($name); } @@ -592,7 +592,7 @@ public function hasOwnerAccess() /** * @inheritDoc */ - public function getUserID() + public function getUserID(): int { return $this->userID; } diff --git a/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEvent.class.php b/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEvent.class.php index 813600a618a..345cec786e0 100644 --- a/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEvent.class.php +++ b/wcfsetup/install/files/lib/data/user/activity/event/UserActivityEvent.class.php @@ -24,7 +24,7 @@ class UserActivityEvent extends DatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = parent::__get($name); diff --git a/wcfsetup/install/files/lib/data/user/avatar/AvatarDecorator.class.php b/wcfsetup/install/files/lib/data/user/avatar/AvatarDecorator.class.php index 914705b7e7d..456c349e908 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/AvatarDecorator.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/AvatarDecorator.class.php @@ -53,7 +53,7 @@ public function getSafeImageTag(?int $size = null): string /** * @inheritDoc */ - public function getURL($size = null) + public function getURL(?int $size = null) { if ($this->avatar instanceof File) { $thumbnail = $this->avatar->getThumbnail((string)UserAvatarFileProcessor::AVATAR_SIZE_2X) @@ -71,7 +71,7 @@ public function getURL($size = null) /** * @inheritDoc */ - public function getImageTag($size = null, bool $lazyLoading = true) + public function getImageTag(?int $size = null, bool $lazyLoading = true) { if ($this->avatar instanceof File) { return \sprintf( diff --git a/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php index 08f3cff8503..6a399098821 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/DefaultAvatar.class.php @@ -87,7 +87,7 @@ public function getSafeImageTag(?int $size = null): string /** * @inheritDoc */ - public function getURL($size = null) + public function getURL(?int $size = null) { return $this->src; } @@ -95,7 +95,7 @@ public function getURL($size = null) /** * @inheritDoc */ - public function getImageTag($size = null) + public function getImageTag(?int $size = null) { if ($size === null) { $size = $this->size; 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/data/user/avatar/StaticAvatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/StaticAvatar.class.php index 570bc0e305e..51cc592d95b 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/StaticAvatar.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/StaticAvatar.class.php @@ -24,7 +24,7 @@ public function __construct(string $pathname) } #[\Override] - public function getImageTag($size = null) + public function getImageTag(?int $size = null) { if ($size === null) { $size = UserAvatarFileProcessor::AVATAR_SIZE; @@ -46,7 +46,7 @@ public function getSafeImageTag(?int $size = null): string } #[\Override] - public function getURL($size = null) + public function getURL(?int $size = null) { return $this->src; } diff --git a/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php index 6b3fe7d911e..8417c297393 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php @@ -83,7 +83,7 @@ public function getFilename($size = null, ?bool $forceWebP = null) /** * @inheritDoc */ - public function getURL($size = null) + public function getURL(?int $size = null) { return WCF::getPath() . 'images/avatars/' . $this->getFilename(); } @@ -99,7 +99,7 @@ public function getSafeURL(?int $size = null): string /** * @inheritDoc */ - public function getImageTag($size = null, bool $lazyLoading = true) + public function getImageTag(?int $size = null, bool $lazyLoading = true) { return \sprintf( '', diff --git a/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php b/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php index 92ec2483e12..7c9edc6041c 100644 --- a/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php +++ b/wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php @@ -32,7 +32,7 @@ class UserNotification extends DatabaseObject /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { $value = parent::__get($name); diff --git a/wcfsetup/install/files/lib/data/user/profile/comment/ViewableUserProfileComment.class.php b/wcfsetup/install/files/lib/data/user/profile/comment/ViewableUserProfileComment.class.php index 12f77e113e4..bd9abd124d8 100644 --- a/wcfsetup/install/files/lib/data/user/profile/comment/ViewableUserProfileComment.class.php +++ b/wcfsetup/install/files/lib/data/user/profile/comment/ViewableUserProfileComment.class.php @@ -22,7 +22,7 @@ class ViewableUserProfileComment extends ViewableComment /** * @inheritDoc */ - public function __get($name) + public function __get(string $name) { if ($name === 'title') { return WCF::getLanguage()->getDynamicVariable( 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/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/ArticleAttachmentObjectType.class.php b/wcfsetup/install/files/lib/system/attachment/ArticleAttachmentObjectType.class.php index 48714bb2767..4b47541a1ea 100644 --- a/wcfsetup/install/files/lib/system/attachment/ArticleAttachmentObjectType.class.php +++ b/wcfsetup/install/files/lib/system/attachment/ArticleAttachmentObjectType.class.php @@ -21,7 +21,7 @@ class ArticleAttachmentObjectType extends AbstractAttachmentObjectType /** * @inheritDoc */ - public function canDownload($objectID) + public function canDownload(int $objectID) { if ($objectID) { return (new Article($objectID))->canRead(); @@ -33,7 +33,7 @@ public function canDownload($objectID) /** * @inheritDoc */ - public function canUpload($objectID, $parentObjectID = 0) + public function canUpload(int $objectID, int $parentObjectID = 0) { if ($objectID) { return (new Article($objectID))->canEdit(); @@ -46,7 +46,7 @@ public function canUpload($objectID, $parentObjectID = 0) /** * @inheritDoc */ - public function canDelete($objectID) + public function canDelete(int $objectID) { return $this->canUpload($objectID); } diff --git a/wcfsetup/install/files/lib/system/attachment/ContactAttachmentObjectType.class.php b/wcfsetup/install/files/lib/system/attachment/ContactAttachmentObjectType.class.php index 53e907a793e..a871d6df1f6 100644 --- a/wcfsetup/install/files/lib/system/attachment/ContactAttachmentObjectType.class.php +++ b/wcfsetup/install/files/lib/system/attachment/ContactAttachmentObjectType.class.php @@ -50,7 +50,7 @@ public function getMaxCount() /** * @inheritDoc */ - public function canDownload($objectID) + public function canDownload(int $objectID) { if (!CONTACT_FORM_ENABLE_ATTACHMENTS) { return false; @@ -67,7 +67,15 @@ public function canDownload($objectID) /** * @inheritDoc */ - public function canUpload($objectID, $parentObjectID = 0) + public function canViewPreview(int $objectID) + { + return $this->canDownload($objectID); + } + + /** + * @inheritDoc + */ + public function canUpload(int $objectID, int $parentObjectID = 0) { if (!CONTACT_FORM_ENABLE_ATTACHMENTS) { return false; @@ -79,7 +87,7 @@ public function canUpload($objectID, $parentObjectID = 0) /** * @inheritDoc */ - public function canDelete($objectID) + public function canDelete(int $objectID) { return $this->canUpload($objectID); } 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/attachment/SignatureAttachmentObjectType.class.php b/wcfsetup/install/files/lib/system/attachment/SignatureAttachmentObjectType.class.php index 7862dcbec73..4833a60f26a 100644 --- a/wcfsetup/install/files/lib/system/attachment/SignatureAttachmentObjectType.class.php +++ b/wcfsetup/install/files/lib/system/attachment/SignatureAttachmentObjectType.class.php @@ -23,7 +23,7 @@ class SignatureAttachmentObjectType extends AbstractAttachmentObjectType /** * @inheritDoc */ - public function canDownload($objectID) + public function canDownload(int $objectID) { if (!MODULE_USER_SIGNATURE) { return false; @@ -50,7 +50,15 @@ public function canDownload($objectID) /** * @inheritDoc */ - public function canUpload($objectID, $parentObjectID = 0) + public function canViewPreview(int $objectID) + { + return $this->canDownload($objectID); + } + + /** + * @inheritDoc + */ + public function canUpload(int $objectID, int $parentObjectID = 0) { if (!MODULE_USER_SIGNATURE) { return false; @@ -81,7 +89,7 @@ public function canUpload($objectID, $parentObjectID = 0) /** * @inheritDoc */ - public function canDelete($objectID) + public function canDelete(int $objectID) { return $this->canUpload($objectID); } diff --git a/wcfsetup/install/files/lib/system/background/job/TolerantCacheRebuildBackgroundJob.class.php b/wcfsetup/install/files/lib/system/background/job/TolerantCacheRebuildBackgroundJob.class.php index f0dd81ebc05..5e7b31214d3 100644 --- a/wcfsetup/install/files/lib/system/background/job/TolerantCacheRebuildBackgroundJob.class.php +++ b/wcfsetup/install/files/lib/system/background/job/TolerantCacheRebuildBackgroundJob.class.php @@ -15,10 +15,12 @@ */ final class TolerantCacheRebuildBackgroundJob extends AbstractUniqueBackgroundJob { + /** + * @param class-string> $cacheClass + * @param array $parameters + */ public function __construct( - /** @var class-string> */ public readonly string $cacheClass, - /** @var array */ public readonly array $parameters = [] ) {} @@ -52,8 +54,6 @@ public function perform() } $asyncCache = new $this->cacheClass(...$this->parameters); - \assert($asyncCache instanceof AbstractTolerantCache); - $asyncCache->rebuild(); } } diff --git a/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php index 74a2cfc63a2..9792ff6ac6a 100644 --- a/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php @@ -21,7 +21,7 @@ final class AttachmentBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $attachmentID = \intval($openingTag['attributes'][0] ?? 0); diff --git a/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php index d5c975f665d..cf7f8c8a3cb 100644 --- a/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/EmailBBCode.class.php @@ -16,7 +16,7 @@ final class EmailBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $email = ''; if (isset($openingTag['attributes'][0])) { diff --git a/wcfsetup/install/files/lib/system/bbcode/GroupBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/GroupBBCode.class.php index 473b3cdaacd..346a86b8f15 100644 --- a/wcfsetup/install/files/lib/system/bbcode/GroupBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/GroupBBCode.class.php @@ -18,7 +18,7 @@ final class GroupBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $content = $openingTag['attributes'][0]; if (!\str_starts_with($content, '@')) { 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/bbcode/MediaBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/MediaBBCode.class.php index ba72129149c..539d384f85c 100644 --- a/wcfsetup/install/files/lib/system/bbcode/MediaBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/MediaBBCode.class.php @@ -17,7 +17,7 @@ final class MediaBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $content = StringUtil::trim($openingTag['attributes'][0]); $alignment = $openingTag['attributes'][1] ?? 'none'; diff --git a/wcfsetup/install/files/lib/system/bbcode/TdBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/TdBBCode.class.php index f20f5ea2c8f..53b1d56ecf6 100644 --- a/wcfsetup/install/files/lib/system/bbcode/TdBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/TdBBCode.class.php @@ -14,7 +14,7 @@ final class TdBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { // ignore these tags as they occur outside of a table return '[td]' . $content . '[/td]'; diff --git a/wcfsetup/install/files/lib/system/bbcode/TrBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/TrBBCode.class.php index ab1b0752f18..2bcb0f6eb8c 100644 --- a/wcfsetup/install/files/lib/system/bbcode/TrBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/TrBBCode.class.php @@ -14,7 +14,7 @@ final class TrBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { // ignore these tags as they occur outside of a table return '[tr]' . $content . '[/tr]'; diff --git a/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php index 6e22ad802b3..88065701d6c 100644 --- a/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php @@ -19,7 +19,7 @@ final class UserBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $content = $openingTag['attributes'][0]; if (!\str_starts_with($content, '@')) { diff --git a/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteArticleBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteArticleBBCode.class.php index 5ef58313dba..34b18acde2d 100644 --- a/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteArticleBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteArticleBBCode.class.php @@ -21,7 +21,7 @@ final class WoltLabSuiteArticleBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $articleID = 0; if (isset($openingTag['attributes'][0])) { diff --git a/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteMediaBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteMediaBBCode.class.php index 4ba39d32806..05f5e91163d 100644 --- a/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteMediaBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/WoltLabSuiteMediaBBCode.class.php @@ -29,7 +29,7 @@ final class WoltLabSuiteMediaBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $mediaID = (!empty($openingTag['attributes'][0])) ? \intval($openingTag['attributes'][0]) : 0; if (!$mediaID) { diff --git a/wcfsetup/install/files/lib/system/bbcode/WoltLabSuitePageBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/WoltLabSuitePageBBCode.class.php index 47c512df0fc..08938a582b3 100644 --- a/wcfsetup/install/files/lib/system/bbcode/WoltLabSuitePageBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/WoltLabSuitePageBBCode.class.php @@ -20,7 +20,7 @@ final class WoltLabSuitePageBBCode extends AbstractBBCode /** * @inheritDoc */ - public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string + public function getParsedTag(array $openingTag, string $content, array $closingTag, BBCodeParser $parser): string { $pageID = (!empty($openingTag['attributes'][0])) ? \intval($openingTag['attributes'][0]) : 0; if (!$pageID) { 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/bbcode/media/provider/TwitchBBCodeMediaProvider.class.php b/wcfsetup/install/files/lib/system/bbcode/media/provider/TwitchBBCodeMediaProvider.class.php index af3fd8fd646..11067b27895 100644 --- a/wcfsetup/install/files/lib/system/bbcode/media/provider/TwitchBBCodeMediaProvider.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/media/provider/TwitchBBCodeMediaProvider.class.php @@ -23,7 +23,7 @@ class TwitchBBCodeMediaProvider implements IBBCodeMediaProvider /** * @inheritDoc */ - public function parse($url, array $matches = []) + public function parse(string $url, array $matches = []) { $src = ''; if (!empty($matches['CLIP'])) { diff --git a/wcfsetup/install/files/lib/system/bbcode/media/provider/YouTubeBBCodeMediaProvider.class.php b/wcfsetup/install/files/lib/system/bbcode/media/provider/YouTubeBBCodeMediaProvider.class.php index 0a99bf658fe..c7acd0f5bb9 100644 --- a/wcfsetup/install/files/lib/system/bbcode/media/provider/YouTubeBBCodeMediaProvider.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/media/provider/YouTubeBBCodeMediaProvider.class.php @@ -17,7 +17,7 @@ class YouTubeBBCodeMediaProvider implements IBBCodeMediaProvider /** * @inheritDoc */ - public function parse($url, array $matches = []) + public function parse(string $url, array $matches = []) { $parsedUrl = Url::parse($url); \parse_str($parsedUrl['query'], $queryString); diff --git a/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php index 8d87429480f..2907fb75dd9 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php @@ -30,7 +30,7 @@ abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBu /** * @inheritDoc */ - public function getData(array $parameters = [], $arrayIndex = '') + public function getData(array $parameters = [], string $arrayIndex = '') { $index = CacheHandler::getInstance()->getCacheIndex($parameters); diff --git a/wcfsetup/install/files/lib/system/cache/builder/AbstractLegacyCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/AbstractLegacyCacheBuilder.class.php index d3ef487be63..80a94c2cd63 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/AbstractLegacyCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/AbstractLegacyCacheBuilder.class.php @@ -24,7 +24,7 @@ abstract class AbstractLegacyCacheBuilder extends SingletonFactory implements IC private array $cache = []; #[\Override] - public function getData(array $parameters = [], $arrayIndex = '') + public function getData(array $parameters = [], string $arrayIndex = '') { $index = CacheHandler::getInstance()->getCacheIndex($parameters); if (isset($this->cache[$index])) { 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/AbstractRuntimeCache.class.php b/wcfsetup/install/files/lib/system/cache/runtime/AbstractRuntimeCache.class.php index e49ee1b3c62..96e4afd1521 100644 --- a/wcfsetup/install/files/lib/system/cache/runtime/AbstractRuntimeCache.class.php +++ b/wcfsetup/install/files/lib/system/cache/runtime/AbstractRuntimeCache.class.php @@ -39,8 +39,12 @@ abstract class AbstractRuntimeCache extends SingletonFactory implements IRuntime protected $objects = []; #[\Override] - public function cacheObjectID($objectID) + public function cacheObjectID(?int $objectID) { + if ($objectID === null) { + return; + } + $this->cacheObjectIDs([$objectID]); } @@ -83,8 +87,12 @@ public function getCachedObjects() } #[\Override] - public function getObject($objectID) + public function getObject(?int $objectID) { + if ($objectID === null) { + return null; + } + if (\array_key_exists($objectID, $this->objects)) { return $this->objects[$objectID]; } @@ -134,8 +142,12 @@ public function getObjects(array $objectIDs) } #[\Override] - public function removeObject($objectID) + public function removeObject(?int $objectID) { + if ($objectID === null) { + return; + } + $this->removeObjects([$objectID]); } 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..e71bfcd0cf6 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/DiskCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/DiskCacheSource.class.php index 8fd2a3c444e..b5e75c00d15 100644 --- a/wcfsetup/install/files/lib/system/cache/source/DiskCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/DiskCacheSource.class.php @@ -17,7 +17,7 @@ final class DiskCacheSource implements ICacheSource /** * @inheritDoc */ - public function flush($cacheName, $useWildcard) + public function flush(string $cacheName, bool $useWildcard) { if ($useWildcard) { $quoted = \preg_quote($cacheName, '/'); @@ -77,7 +77,7 @@ public function flushAll() /** * @inheritDoc */ - public function get($cacheName, $maxLifetime) + public function get(string $cacheName, int $maxLifetime) { $filename = $this->getFilename($cacheName); if ($this->needRebuild($filename, $maxLifetime)) { @@ -95,7 +95,7 @@ public function get($cacheName, $maxLifetime) /** * @inheritDoc */ - public function set($cacheName, $value, $maxLifetime) + public function set(string $cacheName, mixed $value, int $maxLifetime) { $writer = new AtomicWriter($this->getFilename($cacheName)); $writer->write("objectTypes[$definitionName] ?? null; } @@ -169,7 +169,7 @@ public function getI18nLangVarPrefix() /** * @inheritDoc */ - public function getLanguageVariable($name, $optional = false) + public function getLanguageVariable(string $name, bool $optional = false) { if ($this->langVarPrefix) { $value = WCF::getLanguage()->getDynamicVariable($this->langVarPrefix . '.' . $name, [], true); 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/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/ArticleCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php index 412cf626d0b..1f53d6494fc 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php @@ -5,6 +5,8 @@ use wcf\data\article\content\ArticleContent; use wcf\data\article\content\ArticleContentEditor; use wcf\data\article\content\ArticleContentList; +use wcf\data\comment\Comment; +use wcf\data\comment\response\CommentResponse; use wcf\data\object\type\ObjectTypeCache; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\UserProfileRuntimeCache; @@ -61,7 +63,7 @@ class ArticleCommentManager extends AbstractCommentManager implements IViewableL /** * @inheritDoc */ - public function isAccessible($objectID, $validateWritePermission = false) + public function isAccessible(int $objectID, bool $validateWritePermission = false) { // check object id $articleContent = new ArticleContent($objectID); @@ -89,7 +91,7 @@ public function canModerateObject(int $objectTypeID, int $objectID, UserProfile /** * @inheritDoc */ - public function getLink($objectTypeID, $objectID) + public function getLink(int $objectTypeID, int $objectID) { $articleContent = ViewableArticleContentRuntimeCache::getInstance()->getObject($objectID); if ($articleContent) { @@ -102,7 +104,7 @@ public function getLink($objectTypeID, $objectID) /** * @inheritDoc */ - public function getTitle($objectTypeID, $objectID, $isResponse = false) + public function getTitle(int $objectTypeID, int $objectID, bool $isResponse = false) { if ($isResponse) { return WCF::getLanguage()->get('wcf.article.commentResponse'); @@ -114,7 +116,7 @@ public function getTitle($objectTypeID, $objectID, $isResponse = false) /** * @inheritDoc */ - public function updateCounter($objectID, $value) + public function updateCounter(int $objectID, int $value) { $editor = new ArticleContentEditor(new ArticleContent($objectID)); $editor->updateCounters([ @@ -237,7 +239,7 @@ public function prepare(array $likes) /** * @inheritDoc */ - public function isContentAuthor($commentOrResponse) + public function isContentAuthor(Comment|CommentResponse $commentOrResponse) { $articleContent = ViewableArticleContentRuntimeCache::getInstance() ->getObject($this->getObjectID($commentOrResponse)); 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/comment/manager/ModerationQueueCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php index 9ebc60ddd24..9d6d3208f1a 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php @@ -19,7 +19,7 @@ class ModerationQueueCommentManager extends AbstractCommentManager implements IC /** * @inheritDoc */ - public function isAccessible($objectID, $validateWritePermission = false) + public function isAccessible(int $objectID, bool $validateWritePermission = false) { $entry = new ModerationQueue($objectID); @@ -37,7 +37,7 @@ public function canModerateObject(int $objectTypeID, int $objectID, UserProfile /** * @inheritDoc */ - public function canAddWithoutApproval($objectID) + public function canAddWithoutApproval(int $objectID) { return true; } @@ -45,7 +45,7 @@ public function canAddWithoutApproval($objectID) /** * @inheritDoc */ - public function getLink($objectTypeID, $objectID) + public function getLink(int $objectTypeID, int $objectID) { $entry = new ViewableModerationQueue(new ModerationQueue($objectID)); @@ -55,7 +55,7 @@ public function getLink($objectTypeID, $objectID) /** * @inheritDoc */ - public function getTitle($objectTypeID, $objectID, $isResponse = false) + public function getTitle(int $objectTypeID, int $objectID, bool $isResponse = false) { return ''; } @@ -63,7 +63,7 @@ public function getTitle($objectTypeID, $objectID, $isResponse = false) /** * @inheritDoc */ - public function updateCounter($objectID, $value) + public function updateCounter(int $objectID, int $value) { $entry = new ModerationQueue($objectID); $editor = new ModerationQueueEditor($entry); @@ -78,7 +78,7 @@ public function updateCounter($objectID, $value) /** * @inheritDoc */ - public function canAdd($objectID) + public function canAdd(int $objectID) { if (!$this->isAccessible($objectID, true)) { return false; @@ -90,7 +90,7 @@ public function canAdd($objectID) /** * @inheritDoc */ - protected function canEdit($isOwner) + protected function canEdit(bool $isOwner) { return $isOwner; } @@ -98,7 +98,7 @@ protected function canEdit($isOwner) /** * @inheritDoc */ - protected function canDelete($isOwner) + protected function canDelete(bool $isOwner) { return $isOwner; } diff --git a/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php index 495b54acef6..0815682505d 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php @@ -60,7 +60,7 @@ class PageCommentManager extends AbstractCommentManager implements IViewableLike /** * @inheritDoc */ - public function isAccessible($objectID, $validateWritePermission = false) + public function isAccessible(int $objectID, bool $validateWritePermission = false) { // check object id $page = new Page($objectID); @@ -88,7 +88,7 @@ public function canModerateObject(int $objectTypeID, int $objectID, UserProfile /** * @inheritDoc */ - public function getLink($objectTypeID, $objectID) + public function getLink(int $objectTypeID, int $objectID) { return LinkHandler::getInstance()->getCmsLink($objectID); } @@ -96,7 +96,7 @@ public function getLink($objectTypeID, $objectID) /** * @inheritDoc */ - public function getTitle($objectTypeID, $objectID, $isResponse = false) + public function getTitle(int $objectTypeID, int $objectID, bool $isResponse = false) { if ($isResponse) { return WCF::getLanguage()->get('wcf.page.commentResponse'); @@ -108,9 +108,7 @@ public function getTitle($objectTypeID, $objectID, $isResponse = false) /** * @inheritDoc */ - public function updateCounter($objectID, $value) - { - } + public function updateCounter(int $objectID, int $value) {} /** * @inheritDoc diff --git a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php index b2f4815f663..fe9b38dc89e 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php @@ -63,7 +63,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements /** * @inheritDoc */ - public function isAccessible($objectID, $validateWritePermission = false) + public function isAccessible(int $objectID, bool $validateWritePermission = false) { // check object id $userProfile = UserProfileRuntimeCache::getInstance()->getObject($objectID); @@ -118,7 +118,7 @@ public function canModerateObject(int $objectTypeID, int $objectID, UserProfile /** * @inheritDoc */ - public function getLink($objectTypeID, $objectID) + public function getLink(int $objectTypeID, int $objectID) { $user = UserRuntimeCache::getInstance()->getObject($objectID); if ($user) { @@ -148,7 +148,7 @@ public function getResponseLink(CommentResponse $response) /** * @inheritDoc */ - public function getTitle($objectTypeID, $objectID, $isResponse = false) + public function getTitle(int $objectTypeID, int $objectID, bool $isResponse = false) { if ($isResponse) { return WCF::getLanguage()->get('wcf.user.profile.content.wall.commentResponse'); @@ -160,7 +160,7 @@ public function getTitle($objectTypeID, $objectID, $isResponse = false) /** * @inheritDoc */ - public function updateCounter($objectID, $value) + public function updateCounter(int $objectID, int $value) { // does nothing } diff --git a/wcfsetup/install/files/lib/system/devtools/package/DevtoolsTar.class.php b/wcfsetup/install/files/lib/system/devtools/package/DevtoolsTar.class.php index 325b7b8630a..a9eb2f9ee7d 100644 --- a/wcfsetup/install/files/lib/system/devtools/package/DevtoolsTar.class.php +++ b/wcfsetup/install/files/lib/system/devtools/package/DevtoolsTar.class.php @@ -56,7 +56,7 @@ public function registerFile($filename, $fullPath) /** * @inheritDoc */ - public function getIndexByFilename($filename) + public function getIndexByFilename(string $filename) { return isset($this->files[$filename]) ? $filename : false; } @@ -78,7 +78,7 @@ public function extractToString($index) /** * @inheritDoc */ - public function extract($index, $destination) + public function extract($index, string $destination) { // The source file is empty, if the file is a symlink, which yield to an error. if (empty($this->files[$index])) { diff --git a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPipEntryList.class.php b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPipEntryList.class.php index 6d5a62c4139..83143f94dd9 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPipEntryList.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPipEntryList.class.php @@ -107,7 +107,7 @@ public function filterEntries($filter) /** * @inheritDoc */ - public function getEntries($startIndex = null, $entryCount = null) + public function getEntries(?int $startIndex = null, ?int $entryCount = null) { if ($startIndex !== null && $entryCount !== null) { return \array_slice($this->entries, $startIndex, $entryCount); 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/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php index a8335a2849d..19ad81c9a70 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/TMultiXmlGuiPackageInstallationPlugin.class.php @@ -146,7 +146,7 @@ abstract protected function getProjectXmls($createXmlFiles = false); * @inheritDoc * @return void */ - public function setEditedEntryIdentifier($identifier) + public function setEditedEntryIdentifier(string $identifier) { $editedEntries = []; foreach ($this->getProjectXmls() as $xml) { 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/FormDocument.class.php b/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php index c426d12c936..152e0546a0f 100644 --- a/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/FormDocument.class.php @@ -156,7 +156,7 @@ public function __destruct() /** * @inheritDoc */ - public function action($action) + public function action(string $action) { $this->action = $action; @@ -182,7 +182,7 @@ public function addButton(IFormButton $button) /** * @inheritDoc */ - public function addDefaultButton($addDefaultButton = true) + public function addDefaultButton(bool $addDefaultButton = true) { if ($this->isBuilt) { throw new \BadMethodCallException("After the form document has already been built, changing whether the default button is added is no possible anymore."); @@ -196,7 +196,7 @@ public function addDefaultButton($addDefaultButton = true) /** * @inheritDoc */ - public function ajax($ajax = true) + public function ajax(bool $ajax = true) { $this->ajax = $ajax; @@ -310,7 +310,7 @@ public function errorMessage($languageItem = null, array $variables = []) /** * @inheritDoc */ - public function formMode($formMode) + public function formMode(string $formMode) { if ($this->formMode !== null) { throw new \BadMethodCallException("Form mode has already been set"); @@ -340,7 +340,7 @@ public function getAction() /** * @inheritDoc */ - public function getButton($buttonId) + public function getButton(string $buttonId) { if (!$this->hasButton($buttonId)) { throw new \InvalidArgumentException("Unknown button with id '{$buttonId}'."); @@ -511,7 +511,7 @@ public function getSuccessMessage() /** * @inheritDoc */ - public function hasButton($buttonId) + public function hasButton(string $buttonId) { return isset($this->buttons[$buttonId]); } @@ -549,7 +549,7 @@ public function hasRequestData($index = null) /** * @inheritDoc */ - public function invalid($invalid = true) + public function invalid(bool $invalid = true) { $this->invalid = $invalid; @@ -658,7 +658,7 @@ public function updatedObject(IStorableObject $object, $loadValues = true) /** * @inheritDoc */ - public function method($method) + public function method(string $method) { if ($method !== 'get' && $method !== 'post') { throw new \InvalidArgumentException("Invalid method '{$method}' given."); @@ -672,7 +672,7 @@ public function method($method) /** * @inheritDoc */ - public function prefix($prefix) + public function prefix(string $prefix) { static::validateId($prefix); @@ -712,7 +712,7 @@ public function requestData(array $requestData) /** * @inheritDoc */ - public function showErrorMessage($showErrorMessage = true) + public function showErrorMessage(bool $showErrorMessage = true) { $this->showErrorMessage = $showErrorMessage; @@ -722,7 +722,7 @@ public function showErrorMessage($showErrorMessage = true) /** * @inheritDoc */ - public function showSuccessMessage($showSuccessMessage = true) + public function showSuccessMessage(bool $showSuccessMessage = true) { $this->showSuccessMessage = $showSuccessMessage; 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/Psr15DialogForm.class.php b/wcfsetup/install/files/lib/system/form/builder/Psr15DialogForm.class.php index 3d35c3c8e9e..cc759fadf08 100644 --- a/wcfsetup/install/files/lib/system/form/builder/Psr15DialogForm.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/Psr15DialogForm.class.php @@ -90,7 +90,7 @@ protected function createDefaultButton() /** * @inheritDoc */ - public function ajax($ajax = true) + public function ajax(bool $ajax = true) { /* This implementation forces `$ajax = true`. */ diff --git a/wcfsetup/install/files/lib/system/form/builder/button/FormButton.class.php b/wcfsetup/install/files/lib/system/form/builder/button/FormButton.class.php index a415f72a69f..caa627daff7 100644 --- a/wcfsetup/install/files/lib/system/form/builder/button/FormButton.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/button/FormButton.class.php @@ -39,7 +39,7 @@ class FormButton implements IFormButton /** * @inheritDoc */ - public function accessKey($accessKey = null) + public function accessKey(?string $accessKey = null) { // the value [of the accesskey attribute] must be an ordered set of unique // space-separated tokens that are case-sensitive, each of which must be exactly @@ -94,7 +94,7 @@ public function isSubmit() /** * @inheritDoc */ - public function submit($submit = true) + public function submit(bool $submit = true) { $this->submit = $submit; 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/FormContainer.class.php b/wcfsetup/install/files/lib/system/form/builder/container/FormContainer.class.php index 1e3e3a4c95d..a1d120504e5 100644 --- a/wcfsetup/install/files/lib/system/form/builder/container/FormContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/container/FormContainer.class.php @@ -75,7 +75,7 @@ public function markAsRequired() /** * @inheritDoc */ - public function updatedObject(array $data, IStorableObject $object, $loadValues = true) + public function updatedObject(array $data, IStorableObject $object, bool $loadValues = true) { // does nothing 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/container/wysiwyg/WysiwygFormContainer.class.php b/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php index 3adb51fab9a..f7c6592789d 100644 --- a/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygFormContainer.class.php @@ -434,7 +434,7 @@ public function messageObjectType($messageObjectType) /** * @inheritDoc */ - public function updatedObject(array $data, IStorableObject $object, $loadValues = true) + public function updatedObject(array $data, IStorableObject $object, bool $loadValues = true) { $this->objectId = $object->{$object::getDatabaseTableIndexName()}; diff --git a/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygPollFormContainer.class.php b/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygPollFormContainer.class.php index d9cc109e283..a321c074a8d 100644 --- a/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygPollFormContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/container/wysiwyg/WysiwygPollFormContainer.class.php @@ -254,7 +254,7 @@ public function isAvailable() /** * @inheritDoc */ - public function updatedObject(array $data, IStorableObject $object, $loadValues = true) + public function updatedObject(array $data, IStorableObject $object, bool $loadValues = true) { if ($loadValues && $object instanceof IPollContainer && $object->getPollID() !== null) { $this->poll = new Poll($object->getPollID()); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php index 669f6bbc158..a856f9d4113 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php @@ -188,7 +188,7 @@ public function getValue() /** * @inheritDoc */ - public function hasValidator($validatorId) + public function hasValidator(string $validatorId) { FormFieldValidator::validateId($validatorId); @@ -247,7 +247,7 @@ public function objectProperty($objectProperty) /** * @inheritDoc */ - public function removeValidator($validatorId) + public function removeValidator(string $validatorId) { if (!$this->hasValidator($validatorId)) { throw new \InvalidArgumentException("Unknown validator with id '{$validatorId}' for field '{$this->getId()}'."); @@ -272,7 +272,7 @@ public function required($required = true) /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { $this->value = $value; diff --git a/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormFieldDecorator.class.php b/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormFieldDecorator.class.php index 3c2b1811e7a..12bcf9126a9 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormFieldDecorator.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/AbstractFormFieldDecorator.class.php @@ -108,7 +108,7 @@ public function getValue() /** * @inheritDoc */ - public function hasValidator($validatorId) + public function hasValidator(string $validatorId) { return $this->field->hasValidator($validatorId); } @@ -162,7 +162,7 @@ public function readValue() /** * @inheritDoc */ - public function removeValidator($validatorId) + public function removeValidator(string $validatorId) { $this->field->removeValidator($validatorId); @@ -182,7 +182,7 @@ public function required($required = true) /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { $this->field->value($value); @@ -350,7 +350,7 @@ public function getPrefixedId() /** * @inheritDoc */ - public function hasAttribute($name) + public function hasAttribute(string $name) { return $this->field->hasAttribute($name); } @@ -358,7 +358,7 @@ public function hasAttribute($name) /** * @inheritDoc */ - public function hasClass($class) + public function hasClass(string $class) { return $this->field->hasClass($class); } @@ -366,7 +366,7 @@ public function hasClass($class) /** * @inheritDoc */ - public function hasDependency($dependencyId) + public function hasDependency(string $dependencyId) { return $this->field->hasDependency($dependencyId); } @@ -374,7 +374,7 @@ public function hasDependency($dependencyId) /** * @inheritDoc */ - public function id($id) + public function id(string $id) { $this->field->id($id); @@ -402,7 +402,7 @@ public function populate() /** * @inheritDoc */ - public function removeAttribute($name) + public function removeAttribute(string $name) { $this->field->removeAttribute($name); @@ -412,7 +412,7 @@ public function removeAttribute($name) /** * @inheritDoc */ - public function removeClass($class) + public function removeClass(string $class) { $this->field->removeClass($class); @@ -422,7 +422,7 @@ public function removeClass($class) /** * @inheritDoc */ - public function removeDependency($dependencyId) + public function removeDependency(string $dependencyId) { $this->field->removeDependency($dependencyId); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/AbstractNumericFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/AbstractNumericFormField.class.php index d05bcff6544..4ef5a0542e2 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/AbstractNumericFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/AbstractNumericFormField.class.php @@ -216,7 +216,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { if ($value !== null) { if (\is_string($value) && \is_numeric($value)) { diff --git a/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php index 63e14eb3753..d2c004ae983 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/BadgeColorFormField.class.php @@ -88,7 +88,7 @@ public function validate() } #[\Override] - public function value($value) + public function value(mixed $value) { if ($this->supportsCustomClassName() && !\in_array($value, self::AVAILABLE_CSS_CLASSNAMES)) { parent::value(BadgeColorFormField::CUSTOM_CSS_CLASSNAME); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php index c889cc168ca..738de4fcd1f 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php @@ -77,7 +77,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { if (\is_string($value) && \in_array($value, ['0', '1', 'true', 'false'])) { $value = ($value === '1' || $value === 'true'); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php index a2908d8e993..e8814bd5a7f 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/CaptchaFormField.class.php @@ -119,7 +119,7 @@ public function hasSaveValue() /** * @inheritDoc */ - public function objectType($objectType) + public function objectType(string $objectType) { // ignore empty object type which is the case if no captcha has been set if ($objectType === '') { diff --git a/wcfsetup/install/files/lib/system/form/builder/field/CheckboxFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/CheckboxFormField.class.php index 90a525e5dff..bac6aa0b95a 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/CheckboxFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/CheckboxFormField.class.php @@ -56,7 +56,7 @@ public function getHtml() } #[\Override] - public function value($value) + public function value(mixed $value) { if ($this->isNullable() && $value === null) { $value = 0; diff --git a/wcfsetup/install/files/lib/system/form/builder/field/CurrencyFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/CurrencyFormField.class.php index ee46fb54d54..3813a205da5 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/CurrencyFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/CurrencyFormField.class.php @@ -27,7 +27,7 @@ public function getSaveValue() } #[\Override] - public function value($value) + public function value(mixed $value) { parent::value($value); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php index 88e431e902d..13b62e3a28f 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php @@ -444,7 +444,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { parent::value($value); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php index ce43731602f..4d004a5e651 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php @@ -134,7 +134,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { $values = \explode(';', $value); if (\count($values) !== 2) { diff --git a/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php index 66152c9b177..16f68f6cc93 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/FileProcessorFormField.class.php @@ -182,7 +182,7 @@ public function getFiles(): array } #[\Override] - public function value($value) + public function value(mixed $value) { $fileIDs = []; if ($this->isSingleFileUpload()) { 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/IconFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IconFormField.class.php index ac8ae570ad0..9e6f5d4c36e 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/IconFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/IconFormField.class.php @@ -95,7 +95,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { if (\str_starts_with($value, 'fa-')) { $value = ''; diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ItemListFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ItemListFormField.class.php index 0b0a651e455..315975d5e62 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ItemListFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ItemListFormField.class.php @@ -202,7 +202,7 @@ public function saveValueType($saveValueType) /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { switch ($this->getSaveValueType()) { case self::SAVE_VALUE_TYPE_ARRAY: diff --git a/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php index b8654cbc6e3..40f347a6ba9 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php @@ -123,7 +123,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { // ignore `null` as value which can be passed either for nullable // fields or as value if no options are available diff --git a/wcfsetup/install/files/lib/system/form/builder/field/NumericRangeFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/NumericRangeFormField.class.php index 81ae8c4bac5..d5a2746eb78 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/NumericRangeFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/NumericRangeFormField.class.php @@ -81,7 +81,7 @@ public function validate() } #[\Override] - public function value($value) + public function value(mixed $value) { $values = \explode(';', $value); if (\count($values) !== 2) { diff --git a/wcfsetup/install/files/lib/system/form/builder/field/SelectFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/SelectFormField.class.php index f42c3a9a66c..7426685550f 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/SelectFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/SelectFormField.class.php @@ -81,7 +81,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { if ($value !== null && $value !== '') { if (!isset($this->getOptions()[$value])) { diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php index 4e87e0f30fe..f8b1b5bda67 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php @@ -95,7 +95,7 @@ public function options($options, $nestedOptions = false, $labelLanguageItems = /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { $keys = \array_keys($this->getOptions()); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/SingleSelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/SingleSelectionFormField.class.php index 6e081c898b4..bb3d5193bf5 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/SingleSelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/SingleSelectionFormField.class.php @@ -99,7 +99,7 @@ public function validate() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { // ignore `null` as value which can be passed either for nullable // fields or as value if no options are available diff --git a/wcfsetup/install/files/lib/system/form/builder/field/dependency/AbstractFormFieldDependency.class.php b/wcfsetup/install/files/lib/system/form/builder/field/dependency/AbstractFormFieldDependency.class.php index 0bf20781445..5df38af8604 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/dependency/AbstractFormFieldDependency.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/dependency/AbstractFormFieldDependency.class.php @@ -77,7 +77,7 @@ public function field(IFormField $field) /** * @inheritDoc */ - public function fieldId($fieldId) + public function fieldId(string $fieldId) { if ($this->getField() !== null) { throw new \BadMethodCallException("Cannot set field id after field has been set."); 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/poll/PollOptionsFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/poll/PollOptionsFormField.class.php index 76528c78867..b2838a3cb03 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/poll/PollOptionsFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/poll/PollOptionsFormField.class.php @@ -78,7 +78,7 @@ public function readValue() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { $pollOptions = []; diff --git a/wcfsetup/install/files/lib/system/form/builder/field/tag/TagFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/tag/TagFormField.class.php index 87e553cf428..ee1968906d0 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/tag/TagFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/tag/TagFormField.class.php @@ -148,7 +148,7 @@ public function readValue() /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { if (!\is_array($value)) { throw new InvalidFormFieldValue($this, 'array', \gettype($value)); diff --git a/wcfsetup/install/files/lib/system/form/builder/field/user/UserFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/user/UserFormField.class.php index acd0b103412..96353d8c4e1 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/user/UserFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/user/UserFormField.class.php @@ -235,7 +235,7 @@ static function (?UserProfile $user) { /** * @inheritDoc */ - public function value($value) + public function value(mixed $value) { // ensure array value for form fields that actually support multiple values; // allows enabling support for multiple values for existing fields diff --git a/wcfsetup/install/files/lib/system/form/builder/field/validation/FormFieldValidator.class.php b/wcfsetup/install/files/lib/system/form/builder/field/validation/FormFieldValidator.class.php index e35a07f06d5..9033114b601 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/validation/FormFieldValidator.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/validation/FormFieldValidator.class.php @@ -29,7 +29,7 @@ final class FormFieldValidator implements IFormFieldValidator /** * @inheritDoc */ - public function __construct($id, callable $validator) + public function __construct(string $id, callable $validator) { static::validateId($id); 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/form/container/AbstractFormElementContainer.class.php b/wcfsetup/install/files/lib/system/form/container/AbstractFormElementContainer.class.php index b21ff7fa5c8..d36f3750007 100644 --- a/wcfsetup/install/files/lib/system/form/container/AbstractFormElementContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/container/AbstractFormElementContainer.class.php @@ -37,7 +37,7 @@ abstract class AbstractFormElementContainer implements IFormElementContainer /** * @inheritDoc */ - public function setDescription($description) + public function setDescription(string $description) { $this->description = StringUtil::trim($description); } @@ -53,7 +53,7 @@ public function getDescription() /** * @inheritDoc */ - public function setLabel($label) + public function setLabel(string $label) { $this->label = StringUtil::trim($label); } @@ -93,7 +93,7 @@ public function getChildren() /** * @inheritDoc */ - public function getValue($key) + public function getValue(string $key) { foreach ($this->children as $element) { if ($element instanceof AbstractNamedFormElement) { @@ -123,7 +123,7 @@ public function handleRequest(array $variables) /** * @inheritDoc */ - public function setError($name, $error) + public function setError(string $name, string $error) { foreach ($this->children as $element) { if (!($element instanceof AbstractNamedFormElement)) { diff --git a/wcfsetup/install/files/lib/system/form/container/GroupFormElementContainer.class.php b/wcfsetup/install/files/lib/system/form/container/GroupFormElementContainer.class.php index 68fa0a237b6..c7ddf60530c 100644 --- a/wcfsetup/install/files/lib/system/form/container/GroupFormElementContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/container/GroupFormElementContainer.class.php @@ -14,7 +14,7 @@ class GroupFormElementContainer extends AbstractFormElementContainer /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { $content = ''; foreach ($this->children as $element) { diff --git a/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php b/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php index 76da72ff131..5ca0233fe6f 100644 --- a/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php @@ -31,7 +31,7 @@ public function setValue(array $value) /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { $content = ''; foreach ($this->getChildren() as $element) { diff --git a/wcfsetup/install/files/lib/system/form/container/SingleSelectionFormElementContainer.class.php b/wcfsetup/install/files/lib/system/form/container/SingleSelectionFormElementContainer.class.php index e76bc9650f1..cd04a027bc9 100644 --- a/wcfsetup/install/files/lib/system/form/container/SingleSelectionFormElementContainer.class.php +++ b/wcfsetup/install/files/lib/system/form/container/SingleSelectionFormElementContainer.class.php @@ -33,7 +33,7 @@ public function setValue($value) /** * @inheritDoc */ - public function getValue($key) + public function getValue(string $key) { return $this->value; } @@ -41,7 +41,7 @@ public function getValue($key) /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { $content = ''; foreach ($this->getChildren() as $element) { diff --git a/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php index d7a1e8164fe..804c014f633 100644 --- a/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/AbstractFormElement.class.php @@ -50,7 +50,7 @@ public function __construct(IFormElementContainer $parent) /** * @inheritDoc */ - public function setDescription($description) + public function setDescription(string $description) { $this->description = StringUtil::trim($description); } @@ -66,7 +66,7 @@ public function getDescription() /** * @inheritDoc */ - public function setLabel($label) + public function setLabel(string $label) { $this->label = StringUtil::trim($label); } @@ -90,7 +90,7 @@ public function getParent() /** * @inheritDoc */ - public function setError($error) + public function setError(string $error) { $this->error = $error; } diff --git a/wcfsetup/install/files/lib/system/form/element/LabelFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/LabelFormElement.class.php index 1b3dc2c3e42..7fee814da3d 100644 --- a/wcfsetup/install/files/lib/system/form/element/LabelFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/LabelFormElement.class.php @@ -43,7 +43,7 @@ public function getText() /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { return << diff --git a/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php index fca93a5c77b..b7e95f6538b 100644 --- a/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php @@ -60,7 +60,7 @@ public function getDescription() /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { $disabled = ''; if ($this->disabledMessage) { diff --git a/wcfsetup/install/files/lib/system/form/element/PasswordInputFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/PasswordInputFormElement.class.php index ef8f89c2972..ad5b711e48c 100644 --- a/wcfsetup/install/files/lib/system/form/element/PasswordInputFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/PasswordInputFormElement.class.php @@ -14,7 +14,7 @@ class PasswordInputFormElement extends AbstractNamedFormElement /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { return <<getErrorClass()}> diff --git a/wcfsetup/install/files/lib/system/form/element/SingleSelectionFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/SingleSelectionFormElement.class.php index 4adbcfd3d45..33abcfc55a6 100644 --- a/wcfsetup/install/files/lib/system/form/element/SingleSelectionFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/SingleSelectionFormElement.class.php @@ -18,7 +18,7 @@ class SingleSelectionFormElement extends AbstractNamedFormElement /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { return << {$this->getLabel()} diff --git a/wcfsetup/install/files/lib/system/form/element/TextInputFormElement.class.php b/wcfsetup/install/files/lib/system/form/element/TextInputFormElement.class.php index 8a66b1f64f7..a32b444b8bd 100644 --- a/wcfsetup/install/files/lib/system/form/element/TextInputFormElement.class.php +++ b/wcfsetup/install/files/lib/system/form/element/TextInputFormElement.class.php @@ -14,7 +14,7 @@ class TextInputFormElement extends AbstractNamedFormElement /** * @inheritDoc */ - public function getHTML($formName) + public function getHTML(string $formName) { return <<getErrorClass()}> 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/AbstractHtmlNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php index 217280bcfca..9c049cdb364 100644 --- a/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php @@ -47,7 +47,7 @@ abstract class AbstractHtmlNodeProcessor implements IHtmlNodeProcessor /** * @inheritDoc */ - public function load(IHtmlProcessor $htmlProcessor, $html) + public function load(IHtmlProcessor $htmlProcessor, string $html) { $this->htmlProcessor = $htmlProcessor; 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/AbstractHtmlOutputNode.class.php b/wcfsetup/install/files/lib/system/html/output/node/AbstractHtmlOutputNode.class.php index 487b2651535..01e1826e49e 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/AbstractHtmlOutputNode.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/AbstractHtmlOutputNode.class.php @@ -33,7 +33,7 @@ public function isAllowed(AbstractHtmlNodeProcessor $htmlNodeProcessor) /** * @inheritDoc */ - public function setOutputType($outputType) + public function setOutputType(string $outputType) { $this->outputType = $outputType; } 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/GDImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php index 4a902b1d7f2..cffa0dbddc2 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php @@ -75,7 +75,7 @@ public function isImage($image) /** * @inheritDoc */ - public function load($image, $type = 0) + public function load($image, int $type = 0) { if (!$this->isImage($image)) { throw new SystemException("Image resource is invalid."); @@ -95,7 +95,7 @@ public function load($image, $type = 0) /** * @inheritDoc */ - public function loadFile($file) + public function loadFile(string $file) { [$this->width, $this->height, $this->type] = \getimagesize($file); @@ -140,7 +140,7 @@ public function loadFile($file) /** * @inheritDoc */ - public function createEmptyImage($width, $height) + public function createEmptyImage(int $width, int $height) { $this->image = \imagecreate($width, $height); $this->type = \IMAGETYPE_PNG; @@ -154,7 +154,7 @@ public function createEmptyImage($width, $height) /** * @inheritDoc */ - public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true) + public function createThumbnail(int $maxWidth, int $maxHeight, bool $preserveAspectRatio = true) { $x = $y = 0; $sourceWidth = $this->width; @@ -206,7 +206,7 @@ public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = tr /** * @inheritDoc */ - public function clip($originX, $originY, $width, $height) + public function clip(int $originX, int $originY, int $width, int $height) { $image = \imagecreatetruecolor($width, $height); \imagealphablending($image, false); @@ -221,7 +221,7 @@ public function clip($originX, $originY, $width, $height) /** * @inheritDoc */ - public function resize($originX, $originY, $originWidth, $originHeight, $targetWidth = 0, $targetHeight = 0) + public function resize(int $originX, int $originY, int $originWidth, int $originHeight, int $targetWidth = 0, int $targetHeight = 0) { $image = \imagecreatetruecolor($targetWidth, $targetHeight); \imagealphablending($image, false); @@ -247,7 +247,7 @@ public function resize($originX, $originY, $originWidth, $originHeight, $targetW /** * @inheritDoc */ - public function drawRectangle($startX, $startY, $endX, $endY) + public function drawRectangle(int $startX, int $startY, int $endX, int $endY) { \imagefilledrectangle($this->image, $startX, $startY, $endX, $endY, $this->color); } @@ -255,7 +255,7 @@ public function drawRectangle($startX, $startY, $endX, $endY) /** * @inheritDoc */ - public function drawText($text, $x, $y, $font, $size, $opacity = 1.0) + public function drawText(string $text, int $x, int $y, $font, int $size, float $opacity = 1.0) { // set opacity $color = \imagecolorallocatealpha( @@ -273,7 +273,7 @@ public function drawText($text, $x, $y, $font, $size, $opacity = 1.0) /** * @inheritDoc */ - 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, $font, int $size, float $opacity = 1.0) { // split text into multiple lines $lines = \explode("\n", StringUtil::unifyNewlines($text)); @@ -335,7 +335,7 @@ public function drawTextRelative($text, $position, $margin, $offsetX, $offsetY, /** * @inheritDoc */ - public function textFitsImage($text, $margin, $font, $size) + public function textFitsImage(string $text, int $margin, $font, int $size) { $box = \imagettfbbox($size, 0, $font, $text); @@ -348,7 +348,7 @@ public function textFitsImage($text, $margin, $font, $size) /** * @inheritDoc */ - public function adjustFontSize($text, $margin, $font, $size) + public function adjustFontSize(string $text, int $margin, $font, int $size) { return 0; } @@ -356,7 +356,7 @@ public function adjustFontSize($text, $margin, $font, $size) /** * @inheritDoc */ - public function setColor($red, $green, $blue) + public function setColor(int $red, int $green, int $blue) { $this->color = \imagecolorallocate($this->image, $red, $green, $blue); @@ -379,7 +379,7 @@ public function hasColor() /** * @inheritDoc */ - public function setTransparentColor($red, $green, $blue) + public function setTransparentColor(int $red, int $green, int $blue) { if ($this->type == \IMAGETYPE_PNG) { $color = \imagecolorallocate($this->image, $red, $green, $blue); @@ -390,7 +390,7 @@ public function setTransparentColor($red, $green, $blue) /** * @inheritDoc */ - public function writeImage($image, $filename) + public function writeImage($image, ?string $filename) { if (!$this->isImage($image)) { throw new SystemException("Given image is not a valid image resource."); @@ -464,7 +464,7 @@ public function rotate($degrees) /** * @inheritDoc */ - public function overlayImage($file, $x, $y, $opacity) + public function overlayImage(string $file, int $x, int $y, float $opacity) { $overlayImage = new self(); $overlayImage->loadFile($file); @@ -561,7 +561,7 @@ private function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, /** * @inheritDoc */ - public function overlayImageRelative($file, $position, $margin, $opacity) + public function overlayImageRelative(string $file, string $position, int $margin, float $opacity) { // does nothing } @@ -569,7 +569,7 @@ public function overlayImageRelative($file, $position, $margin, $opacity) /** * @inheritDoc */ - 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 { if (!$this->isImage($image)) { throw new \InvalidArgumentException("Given image is not a valid image resource."); 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/image/adapter/ImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php index 06673b268e8..a010271f48e 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php @@ -52,7 +52,7 @@ public function __construct($adapterClassName) /** * @inheritDoc */ - public function load($image, $type = 0) + public function load($image, int $type = 0) { $this->adapter->load($image, $type); } @@ -60,7 +60,7 @@ public function load($image, $type = 0) /** * @inheritDoc */ - public function loadFile($file) + public function loadFile(string $file) { if (!\file_exists($file) || !\is_readable($file)) { throw new SystemException("Image '" . $file . "' is not readable or does not exists."); @@ -88,7 +88,7 @@ public function loadSingleFrameFromFile(string $filename): void /** * @inheritDoc */ - public function createEmptyImage($width, $height) + public function createEmptyImage(int $width, int $height) { $this->adapter->createEmptyImage($width, $height); } @@ -96,7 +96,7 @@ public function createEmptyImage($width, $height) /** * @inheritDoc */ - public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true) + public function createThumbnail(int $maxWidth, int $maxHeight, bool $preserveAspectRatio = true) { if ($maxWidth > $this->getWidth() && $maxHeight > $this->getHeight()) { throw new SystemException( @@ -119,7 +119,7 @@ public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = tr /** * @inheritDoc */ - public function clip($originX, $originY, $width, $height) + public function clip(int $originX, int $originY, int $width, int $height) { // validate if coordinates and size are within bounds if ($originX < 0 || $originY < 0) { @@ -140,7 +140,7 @@ public function clip($originX, $originY, $width, $height) /** * @inheritDoc */ - public function resize($originX, $originY, $originWidth, $originHeight, $targetWidth, $targetHeight) + public function resize(int $originX, int $originY, int $originWidth, int $originHeight, int $targetWidth, int $targetHeight) { // use origin dimensions if target dimensions are both zero if ($targetWidth == 0 && $targetHeight == 0) { @@ -154,7 +154,7 @@ public function resize($originX, $originY, $originWidth, $originHeight, $targetW /** * @inheritDoc */ - public function drawRectangle($startX, $startY, $endX, $endY) + public function drawRectangle(int $startX, int $startY, int $endX, int $endY) { if (!$this->adapter->hasColor()) { throw new SystemException("Cannot draw a rectangle unless a color has been specified with setColor()."); @@ -166,7 +166,7 @@ public function drawRectangle($startX, $startY, $endX, $endY) /** * @inheritDoc */ - public function drawText($text, $x, $y, $font, $size, $opacity = 1.0) + public function drawText(string $text, int $x, int $y, $font, int $size, float $opacity = 1.0) { if (!$this->adapter->hasColor()) { throw new SystemException("Cannot draw text unless a color has been specified with setColor()."); @@ -183,7 +183,7 @@ public function drawText($text, $x, $y, $font, $size, $opacity = 1.0) /** * @inheritDoc */ - 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, $font, int $size, float $opacity = 1.0) { if (!$this->adapter->hasColor()) { throw new SystemException("Cannot draw text unless a color has been specified with setColor()."); @@ -210,7 +210,7 @@ public function drawTextRelative($text, $position, $margin, $offsetX, $offsetY, /** * @inheritDoc */ - public function textFitsImage($text, $margin, $font, $size) + public function textFitsImage(string $text, int $margin, $font, int $size) { return $this->adapter->textFitsImage($text, $margin, $font, $size); } @@ -218,7 +218,7 @@ public function textFitsImage($text, $margin, $font, $size) /** * @inheritDoc */ - public function adjustFontSize($text, $margin, $font, $size) + public function adjustFontSize(string $text, int $margin, $font, int $size) { // adjust font size while ($size && !$this->textFitsImage($text, $margin, $font, $size)) { @@ -231,7 +231,7 @@ public function adjustFontSize($text, $margin, $font, $size) /** * @inheritDoc */ - public function setColor($red, $green, $blue) + public function setColor(int $red, int $green, int $blue) { $this->adapter->setColor($red, $green, $blue); } @@ -247,7 +247,7 @@ public function hasColor() /** * @inheritDoc */ - public function setTransparentColor($red, $green, $blue) + public function setTransparentColor(int $red, int $green, int $blue) { $this->adapter->setTransparentColor($red, $green, $blue); } @@ -255,7 +255,7 @@ public function setTransparentColor($red, $green, $blue) /** * @inheritDoc */ - public function writeImage($image, $filename = null) + public function writeImage($image, ?string $filename = null) { if ($filename === null) { $filename = $image; @@ -312,7 +312,7 @@ public function rotate($degrees) /** * @inheritDoc */ - public function overlayImage($file, $x, $y, $opacity) + public function overlayImage(string $file, int $x, int $y, float $opacity) { // validate file if (!\file_exists($file)) { @@ -330,7 +330,7 @@ public function overlayImage($file, $x, $y, $opacity) /** * @inheritDoc */ - public function overlayImageRelative($file, $position, $margin, $opacity) + public function overlayImageRelative(string $file, string $position, int $margin, float $opacity) { // validate file if (!\file_exists($file)) { @@ -410,7 +410,7 @@ public function overlayImageRelative($file, $position, $margin, $opacity) /** * @inheritDoc */ - public function checkMemoryLimit($width, $height, $mimeType) + public function checkMemoryLimit(int $width, int $height, string $mimeType) { if ($this->adapter instanceof IMemoryAwareImageAdapter) { return $this->adapter->checkMemoryLimit($width, $height, $mimeType); @@ -424,7 +424,7 @@ public function checkMemoryLimit($width, $height, $mimeType) /** * @inheritDoc */ - 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 { switch ($type) { case "gif": diff --git a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php index 0bd80a3c0bf..700e0db54e7 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php @@ -71,7 +71,7 @@ public function __construct() /** * @inheritDoc */ - public function load($image, $type = 0) + public function load($image, int $type = 0) { // @phpstan-ignore instanceof.alwaysTrue if (!($image instanceof \Imagick)) { @@ -86,7 +86,7 @@ public function load($image, $type = 0) /** * @inheritDoc */ - public function loadFile($file) + public function loadFile(string $file) { try { $this->imagick->clear(); @@ -137,7 +137,7 @@ protected function readImageDimensions() /** * @inheritDoc */ - public function createEmptyImage($width, $height) + public function createEmptyImage(int $width, int $height) { $this->imagick->newImage($width, $height, 'white'); @@ -148,11 +148,8 @@ public function createEmptyImage($width, $height) /** * @inheritDoc */ - public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true) + public function createThumbnail(int $maxWidth, int $maxHeight, bool $preserveAspectRatio = true) { - $maxHeight = (int)$maxHeight; - $maxWidth = (int)$maxWidth; - $thumbnail = clone $this->imagick; if (\in_array($thumbnail->getImageFormat(), self::$animatedFormats)) { @@ -179,7 +176,7 @@ public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = tr /** * @inheritDoc */ - public function clip($originX, $originY, $width, $height) + public function clip(int $originX, int $originY, int $width, int $height) { if (\in_array($this->imagick->getImageFormat(), self::$animatedFormats)) { $this->imagick = $this->imagick->coalesceImages(); @@ -196,7 +193,7 @@ public function clip($originX, $originY, $width, $height) /** * @inheritDoc */ - public function resize($originX, $originY, $originWidth, $originHeight, $targetWidth, $targetHeight) + public function resize(int $originX, int $originY, int $originWidth, int $originHeight, int $targetWidth, int $targetHeight) { if (\in_array($this->imagick->getImageFormat(), self::$animatedFormats)) { $image = $this->imagick->coalesceImages(); @@ -218,7 +215,7 @@ public function resize($originX, $originY, $originWidth, $originHeight, $targetW /** * @inheritDoc */ - public function drawRectangle($startX, $startY, $endX, $endY) + public function drawRectangle(int $startX, int $startY, int $endX, int $endY) { $draw = new \ImagickDraw(); $draw->setFillColor($this->color); @@ -231,7 +228,7 @@ public function drawRectangle($startX, $startY, $endX, $endY) /** * @inheritDoc */ - public function drawText($text, $x, $y, $font, $size, $opacity = 1.0) + public function drawText(string $text, int $x, int $y, $font, int $size, float $opacity = 1.0) { $draw = new \ImagickDraw(); $draw->setFillColor($this->color); @@ -257,7 +254,7 @@ public function drawText($text, $x, $y, $font, $size, $opacity = 1.0) /** * @inheritDoc */ - 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, $font, int $size, float $opacity = 1.0) { // split text into multiple lines $lines = \explode("\n", StringUtil::unifyNewlines($text)); @@ -322,7 +319,7 @@ public function drawTextRelative($text, $position, $margin, $offsetX, $offsetY, /** * @inheritDoc */ - public function textFitsImage($text, $margin, $font, $size) + public function textFitsImage(string $text, int $margin, $font, int $size) { $draw = new \ImagickDraw(); $draw->setFont($font); @@ -335,7 +332,7 @@ public function textFitsImage($text, $margin, $font, $size) /** * @inheritDoc */ - public function adjustFontSize($text, $margin, $font, $size) + public function adjustFontSize(string $text, int $margin, $font, int $size) { return 0; } @@ -343,7 +340,7 @@ public function adjustFontSize($text, $margin, $font, $size) /** * @inheritDoc */ - public function setColor($red, $green, $blue) + public function setColor(int $red, int $green, int $blue) { $this->color = new \ImagickPixel(); $this->color->setColor('rgb(' . $red . ',' . $green . ',' . $blue . ')'); @@ -364,7 +361,7 @@ public function hasColor() /** * @inheritDoc */ - public function setTransparentColor($red, $green, $blue) + public function setTransparentColor(int $red, int $green, int $blue) { $color = 'rgb(' . $red . ',' . $green . ',' . $blue . ')'; $this->imagick->paintTransparentImage($color, 0.0, 0); @@ -381,7 +378,7 @@ public function getImage() /** * @inheritDoc */ - public function writeImage($image, $filename) + public function writeImage($image, ?string $filename) { if (!($image instanceof \Imagick)) { throw new SystemException("Given image is not a valid Imagick-object."); @@ -438,7 +435,7 @@ public function rotate($degrees) /** * @inheritDoc */ - public function overlayImage($file, $x, $y, $opacity) + public function overlayImage(string $file, int $x, int $y, float $opacity) { try { $overlayImage = new \Imagick($file); @@ -469,7 +466,7 @@ public function overlayImage($file, $x, $y, $opacity) /** * @inheritDoc */ - public function overlayImageRelative($file, $position, $margin, $opacity) + public function overlayImageRelative(string $file, string $position, int $margin, float $opacity) { // does nothing } @@ -514,9 +511,8 @@ public static function getVersion() /** * @inheritDoc */ - 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 { - // @phpstan-ignore instanceof.alwaysTrue if (!($image instanceof \Imagick)) { throw new \InvalidArgumentException("Given image is not a valid Imagick-object."); } diff --git a/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php index 23a247383cc..1d5266829b3 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php @@ -48,7 +48,7 @@ public function __construct() /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { if (!isset($this->options[$additionalData['optionName']])) { return 0; diff --git a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php index cea149ac5ae..88efd9a4dd1 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php @@ -30,7 +30,7 @@ class AbstractAttachmentImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { // check file location if (!\is_readable($additionalData['fileLocation'])) { diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php index b66302fda42..0ffa6a1ab24 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php @@ -37,7 +37,7 @@ class AbstractCategoryImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { if (!empty($data['parentCategoryID'])) { $data['parentCategoryID'] = ImportHandler::getInstance() diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php index 36951ab9795..e45c5a6eadd 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php @@ -34,7 +34,7 @@ class AbstractCommentImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); diff --git a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php index f72fd2884b6..231317ee7a9 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php @@ -29,7 +29,7 @@ class AbstractCommentResponseImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); diff --git a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php index 3f97a0bbcf3..7ba435971e5 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php @@ -38,7 +38,7 @@ class AbstractLikeImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { if ($data['objectUserID']) { $data['objectUserID'] = ImportHandler::getInstance() diff --git a/wcfsetup/install/files/lib/system/importer/AbstractPollImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractPollImporter.class.php index a13171434de..dc6d7e09927 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractPollImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractPollImporter.class.php @@ -34,7 +34,7 @@ class AbstractPollImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $poll = PollEditor::create(\array_merge($data, ['objectTypeID' => $this->objectTypeID])); diff --git a/wcfsetup/install/files/lib/system/importer/AbstractPollOptionImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractPollOptionImporter.class.php index 25489a81e9b..7e73996cceb 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractPollOptionImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractPollOptionImporter.class.php @@ -34,7 +34,7 @@ class AbstractPollOptionImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['pollID'] = ImportHandler::getInstance()->getNewID($this->pollObjectTypeName, $data['pollID']); if (!$data['pollID']) { diff --git a/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php index 933157712c6..973ef7bea72 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php @@ -28,7 +28,7 @@ class AbstractPollOptionVoteImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); if (!$data['userID']) { diff --git a/wcfsetup/install/files/lib/system/importer/AbstractWatchedObjectImporter.class.php b/wcfsetup/install/files/lib/system/importer/AbstractWatchedObjectImporter.class.php index 62132c113e8..e06ca9df9c6 100644 --- a/wcfsetup/install/files/lib/system/importer/AbstractWatchedObjectImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/AbstractWatchedObjectImporter.class.php @@ -29,7 +29,7 @@ class AbstractWatchedObjectImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); if (!$data['userID']) { diff --git a/wcfsetup/install/files/lib/system/importer/ArticleAttachmentImporter.class.php b/wcfsetup/install/files/lib/system/importer/ArticleAttachmentImporter.class.php index 5983c0228ff..262641f975b 100644 --- a/wcfsetup/install/files/lib/system/importer/ArticleAttachmentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/ArticleAttachmentImporter.class.php @@ -25,7 +25,7 @@ public function __construct() } #[\Override] - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['objectID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.article', $data['objectID']); if (!$data['objectID']) { diff --git a/wcfsetup/install/files/lib/system/importer/ArticleCommentImporter.class.php b/wcfsetup/install/files/lib/system/importer/ArticleCommentImporter.class.php index 050c0598e86..99ef14fe5ec 100644 --- a/wcfsetup/install/files/lib/system/importer/ArticleCommentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/ArticleCommentImporter.class.php @@ -32,7 +32,7 @@ public function __construct() /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $articleID = ImportHandler::getInstance() ->getNewID('com.woltlab.wcf.article', $data['objectID'] ?? $additionalData['articleID']); diff --git a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php index be762d6b20f..004ca28ee26 100644 --- a/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/ArticleImporter.class.php @@ -33,7 +33,7 @@ class ArticleImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); 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/importer/LabelGroupImporter.class.php b/wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php index d729cd7e65b..a9baac98396 100644 --- a/wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php @@ -23,7 +23,7 @@ class LabelGroupImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { // save label group $labelGroup = LabelGroupEditor::create($data); diff --git a/wcfsetup/install/files/lib/system/importer/LabelImporter.class.php b/wcfsetup/install/files/lib/system/importer/LabelImporter.class.php index dc8f57c5757..8ad03020f7d 100644 --- a/wcfsetup/install/files/lib/system/importer/LabelImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/LabelImporter.class.php @@ -22,7 +22,7 @@ class LabelImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['groupID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.label.group', $data['groupID']); if (!$data['groupID']) { diff --git a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php index 3f5129038a6..23b66ee934f 100644 --- a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php @@ -26,7 +26,7 @@ class MediaImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { // check file location if (!\is_readable($additionalData['fileLocation'])) { diff --git a/wcfsetup/install/files/lib/system/importer/PageImporter.class.php b/wcfsetup/install/files/lib/system/importer/PageImporter.class.php index 9af96594e17..56addd4db20 100644 --- a/wcfsetup/install/files/lib/system/importer/PageImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/PageImporter.class.php @@ -25,7 +25,7 @@ class PageImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $contents = []; foreach ($additionalData['contents'] as $languageCode => $contentData) { diff --git a/wcfsetup/install/files/lib/system/importer/ReactionTypeImporter.class.php b/wcfsetup/install/files/lib/system/importer/ReactionTypeImporter.class.php index 061813e433c..7866d95a2ac 100644 --- a/wcfsetup/install/files/lib/system/importer/ReactionTypeImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/ReactionTypeImporter.class.php @@ -23,7 +23,7 @@ class ReactionTypeImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { // copy reaction type image $data['iconFile'] = \basename($additionalData['fileLocation']); diff --git a/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php b/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php index ab37c5f746a..c2999c05896 100644 --- a/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php @@ -53,7 +53,7 @@ public function __construct() /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { // copy smiley $data['smileyPath'] = 'images/smilies/' . \basename($additionalData['fileLocation']); diff --git a/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php b/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php index 7e3cc223f39..32f208d2f55 100644 --- a/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/TrophyImporter.class.php @@ -32,7 +32,7 @@ class TrophyImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { if (isset($data['categoryID'])) { $data['categoryID'] = ImportHandler::getInstance() diff --git a/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php index 9d15a211931..fc8f21b539e 100644 --- a/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php @@ -20,7 +20,7 @@ class UserAvatarImporter extends AbstractFileImporter protected string $objectType = 'com.woltlab.wcf.user.avatar'; #[\Override] - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { // get user id $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); diff --git a/wcfsetup/install/files/lib/system/importer/UserCommentImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserCommentImporter.class.php index af2e25351a4..8f2f063a96f 100644 --- a/wcfsetup/install/files/lib/system/importer/UserCommentImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserCommentImporter.class.php @@ -31,7 +31,7 @@ public function __construct() /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['objectID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['objectID']); if (!$data['objectID']) { diff --git a/wcfsetup/install/files/lib/system/importer/UserCoverPhotoImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserCoverPhotoImporter.class.php index 37b9d19e688..9e737954152 100644 --- a/wcfsetup/install/files/lib/system/importer/UserCoverPhotoImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserCoverPhotoImporter.class.php @@ -21,7 +21,7 @@ class UserCoverPhotoImporter extends AbstractFileImporter protected string $objectType = 'com.woltlab.wcf.user.coverPhoto'; #[\Override] - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); if (!$data['userID']) { diff --git a/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php index d73928c1cbf..e466a2c3eca 100644 --- a/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php @@ -22,7 +22,7 @@ class UserFollowerImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); $data['followUserID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['followUserID']); diff --git a/wcfsetup/install/files/lib/system/importer/UserGroupImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserGroupImporter.class.php index 375378d8128..17c934c0094 100644 --- a/wcfsetup/install/files/lib/system/importer/UserGroupImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserGroupImporter.class.php @@ -24,7 +24,7 @@ class UserGroupImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { if ($data['groupType'] < 4) { $newGroupID = UserGroup::getGroupByType($data['groupType'])->groupID; diff --git a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php index 3df3756a96e..715d8b1bdc9 100644 --- a/wcfsetup/install/files/lib/system/importer/UserImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserImporter.class.php @@ -78,7 +78,7 @@ public function __construct() /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $targetUser = null; diff --git a/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php index 4802bc83741..2040601877e 100644 --- a/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php @@ -55,7 +55,7 @@ public function __construct() /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['packageID'] = 1; // set temporary option name diff --git a/wcfsetup/install/files/lib/system/importer/UserRankImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserRankImporter.class.php index 2a4a70a6354..f0ee3eca3da 100644 --- a/wcfsetup/install/files/lib/system/importer/UserRankImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserRankImporter.class.php @@ -23,7 +23,7 @@ class UserRankImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { $data['groupID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user.group', $data['groupID']); if (!$data['groupID']) { diff --git a/wcfsetup/install/files/lib/system/importer/UserTrophyImporter.class.php b/wcfsetup/install/files/lib/system/importer/UserTrophyImporter.class.php index 7716e0c22f4..1e3561fb6b6 100644 --- a/wcfsetup/install/files/lib/system/importer/UserTrophyImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/UserTrophyImporter.class.php @@ -23,7 +23,7 @@ class UserTrophyImporter extends AbstractImporter /** * @inheritDoc */ - public function import($oldID, array $data, array $additionalData = []) + public function import(mixed $oldID, array $data, array $additionalData = []) { if (isset($data['trophyID'])) { $data['trophyID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.trophy', $data['trophyID']); 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/io/Tar.class.php b/wcfsetup/install/files/lib/system/io/Tar.class.php index 63a332654eb..8a9225e25bb 100644 --- a/wcfsetup/install/files/lib/system/io/Tar.class.php +++ b/wcfsetup/install/files/lib/system/io/Tar.class.php @@ -179,7 +179,7 @@ public function getFileInfo($index) /** * @inheritDoc */ - public function getIndexByFilename($filename) + public function getIndexByFilename(string $filename) { foreach ($this->contentList as $index => $file) { if ($file['filename'] == $filename) { @@ -260,7 +260,7 @@ public function extractToChunks(int|string $index, int $chunkSize): \Generator /** * @inheritDoc */ - public function extract($index, $destination) + public function extract($index, string $destination) { if (!$this->read) { $this->open(); diff --git a/wcfsetup/install/files/lib/system/io/Zip.class.php b/wcfsetup/install/files/lib/system/io/Zip.class.php index fd71164d63a..60f3072df9b 100644 --- a/wcfsetup/install/files/lib/system/io/Zip.class.php +++ b/wcfsetup/install/files/lib/system/io/Zip.class.php @@ -41,7 +41,7 @@ public function __construct($filename) /** * @inheritDoc */ - public function getIndexByFilename($filename) + public function getIndexByFilename(string $filename) { if (isset($this->centralDirectory['files'][$filename])) { return $this->centralDirectory['files'][$filename]['offset']; @@ -116,7 +116,7 @@ public function extractToString($index) /** * @inheritDoc */ - public function extract($index, $destination) + public function extract($index, string $destination) { if (!\is_int($index)) { $index = $this->getIndexByFilename($index); diff --git a/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php b/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php index 626d065d440..d1af44a0d50 100644 --- a/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php @@ -78,7 +78,7 @@ public function getLabelGroups(array $parameters = []) /** * @inheritDoc */ - public function validateLabelIDs(array $labelIDs, $optionName = '', $legacyReturnValue = true) + public function validateLabelIDs(array $labelIDs, string $optionName = '', bool $legacyReturnValue = true) { $optionID = 0; if (!empty($optionName)) { @@ -150,7 +150,7 @@ public function validateLabelIDs(array $labelIDs, $optionName = '', $legacyRetur /** * @inheritDoc */ - public function setLabels(array $labelIDs, $objectID, $validatePermissions = true) + public function setLabels(array $labelIDs, int $objectID, bool $validatePermissions = true) { LabelHandler::getInstance()->setLabels($labelIDs, $this->objectTypeID, $objectID, $validatePermissions); } @@ -158,7 +158,7 @@ public function setLabels(array $labelIDs, $objectID, $validatePermissions = tru /** * @inheritDoc */ - public function removeLabels($objectID, $validatePermissions = true) + public function removeLabels(int $objectID, bool $validatePermissions = true) { // @phpstan-ignore function.impossibleType $objectIDs = (\is_array($objectID)) ? $objectID : [$objectID]; @@ -168,7 +168,7 @@ public function removeLabels($objectID, $validatePermissions = true) /** * @inheritDoc */ - public function getAssignedLabels(array $objectIDs, $validatePermissions = true) + public function getAssignedLabels(array $objectIDs, bool $validatePermissions = true) { return LabelHandler::getInstance()->getAssignedLabels($this->objectTypeID, $objectIDs, $validatePermissions); } 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/AbstractLabelObjectTypeHandler.class.php b/wcfsetup/install/files/lib/system/label/object/type/AbstractLabelObjectTypeHandler.class.php index 380b44ba6fe..32fbd056661 100644 --- a/wcfsetup/install/files/lib/system/label/object/type/AbstractLabelObjectTypeHandler.class.php +++ b/wcfsetup/install/files/lib/system/label/object/type/AbstractLabelObjectTypeHandler.class.php @@ -29,7 +29,7 @@ abstract class AbstractLabelObjectTypeHandler extends SingletonFactory implement public $objectTypeID = 0; #[\Override] - public function setObjectTypeID($objectTypeID) + public function setObjectTypeID(int $objectTypeID) { $this->objectTypeID = $objectTypeID; } 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/AboutUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/AboutUserProfileMenuContent.class.php index 2fc6b9157c9..7040cb338b5 100644 --- a/wcfsetup/install/files/lib/system/menu/user/profile/content/AboutUserProfileMenuContent.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/profile/content/AboutUserProfileMenuContent.class.php @@ -26,7 +26,7 @@ class AboutUserProfileMenuContent extends SingletonFactory implements IUserProfi /** * @inheritDoc */ - public function getContent($userID) + public function getContent(int $userID) { if ($this->optionHandler === null) { $this->optionHandler = new UserOptionHandler(false, '', 'profile'); @@ -47,7 +47,7 @@ public function getContent($userID) /** * @inheritDoc */ - public function isVisible($userID) + public function isVisible(int $userID) { return true; } diff --git a/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php index ca73baf4075..5dbcb72cd00 100644 --- a/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php @@ -30,7 +30,7 @@ class CommentUserProfileMenuContent extends SingletonFactory implements IUserPro /** * @inheritDoc */ - public function getContent($userID) + public function getContent(int $userID) { if ($this->commentManager === null) { $this->objectTypeID = CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user.profileComment'); @@ -57,7 +57,7 @@ public function getContent($userID) /** * @inheritDoc */ - public function isVisible($userID) + public function isVisible(int $userID) { return true; } 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/menu/user/profile/content/LikesUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/LikesUserProfileMenuContent.class.php index 030153f8fee..c46c889773e 100644 --- a/wcfsetup/install/files/lib/system/menu/user/profile/content/LikesUserProfileMenuContent.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/profile/content/LikesUserProfileMenuContent.class.php @@ -18,7 +18,7 @@ class LikesUserProfileMenuContent extends SingletonFactory implements IUserProfi /** * @inheritDoc */ - public function getContent($userID) + public function getContent(int $userID) { $likeList = new ViewableLikeList(); $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", [$userID]); @@ -34,7 +34,7 @@ public function getContent($userID) /** * @inheritDoc */ - public function isVisible($userID) + public function isVisible(int $userID) { if (!WCF::getSession()->getPermission('user.like.canViewLike')) { return false; diff --git a/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php b/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php index 49fc02e2c54..d427dd3bfcc 100644 --- a/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php +++ b/wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php @@ -19,7 +19,7 @@ class RecentActivityUserProfileMenuContent extends SingletonFactory implements I /** * @inheritDoc */ - public function getContent($userID) + public function getContent(int $userID) { $eventList = new ViewableUserActivityEventList(); @@ -45,7 +45,7 @@ public function getContent($userID) /** * @inheritDoc */ - public function isVisible($userID) + public function isVisible(int $userID) { return true; } diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/ArticleMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/ArticleMessageEmbeddedObjectHandler.class.php index 6c977cc9369..a773a36592a 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/ArticleMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/ArticleMessageEmbeddedObjectHandler.class.php @@ -74,7 +74,7 @@ public function loadObjects(array $objectIDs) /** * @inheritDoc */ - public function validateValues($objectType, $objectID, array $values) + public function validateValues(string $objectType, int $objectID, array $values) { $articleList = new AccessibleArticleList(); $articleList->getConditionBuilder()->add('article.articleID IN (?)', [$values]); @@ -89,7 +89,7 @@ public function validateValues($objectType, $objectID, array $values) /** * @inheritDoc */ - public function replaceSimple($objectType, $objectID, $value, array $attributes) + public function replaceSimple(string $objectType, int $objectID, string|int $value, array $attributes) { $article = MessageEmbeddedObjectManager::getInstance()->getObject('com.woltlab.wcf.article', $value); if ($article === null) { 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/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php index f9f72ba1b4b..87fdd2c943e 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php @@ -78,7 +78,7 @@ public function loadObjects(array $objectIDs) /** * @inheritDoc */ - public function validateValues($objectType, $objectID, array $values) + public function validateValues(string $objectType, int $objectID, array $values) { $mediaList = new MediaList(); $mediaList->getConditionBuilder()->add("media.mediaID IN (?)", [$values]); @@ -90,7 +90,7 @@ public function validateValues($objectType, $objectID, array $values) /** * @inheritDoc */ - public function replaceSimple($objectType, $objectID, $value, array $attributes) + public function replaceSimple(string $objectType, int $objectID, string|int $value, array $attributes) { /** @var ?Media $media */ $media = MessageEmbeddedObjectManager::getInstance()->getObject('com.woltlab.wcf.media', $value); diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/PageMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/PageMessageEmbeddedObjectHandler.class.php index 93be66986c4..3fcfde4d34f 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/PageMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/PageMessageEmbeddedObjectHandler.class.php @@ -51,7 +51,7 @@ public function loadObjects(array $objectIDs) /** * @inheritDoc */ - public function validateValues($objectType, $objectID, array $values) + public function validateValues(string $objectType, int $objectID, array $values) { // Pages can be referenced as `123#Some Text`, where everything after the number // is a comment for better readability. Converting the values to integers via @@ -66,7 +66,7 @@ public function validateValues($objectType, $objectID, array $values) /** * @inheritDoc */ - public function replaceSimple($objectType, $objectID, $value, array $attributes) + public function replaceSimple(string $objectType, int $objectID, string|int $value, array $attributes) { $page = MessageEmbeddedObjectManager::getInstance()->getObject('com.woltlab.wcf.page', $value); if ($page === null) { diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentCommentModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentCommentModerationQueueHandler.class.php index 32232633ea2..048f9af5d8f 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentCommentModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentCommentModerationQueueHandler.class.php @@ -77,7 +77,7 @@ public function assignQueues(array $queues) /** * @inheritDoc */ - public function getContainerID($objectID) + public function getContainerID(int $objectID) { return 0; } @@ -85,7 +85,7 @@ public function getContainerID($objectID) /** * @inheritDoc */ - public function isValid($objectID) + public function isValid(int $objectID) { if ($this->getComment($objectID) === null) { return false; @@ -181,7 +181,7 @@ protected function getRelatedContent(ViewableModerationQueue $queue) } #[\Override] - public function isAffectedUser(ModerationQueue $queue, $userID) + public function isAffectedUser(ModerationQueue $queue, int $userID) { if (!parent::isAffectedUser($queue, $userID)) { return false; diff --git a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php index c08cc23d5d0..a19bb2b8ad5 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractCommentResponseModerationQueueHandler.class.php @@ -96,7 +96,7 @@ public function getRelatedContent(ViewableModerationQueue $queue) /** * @inheritDoc */ - public function isValid($objectID) + public function isValid(int $objectID) { if ($this->getResponse($objectID) === null) { return false; @@ -155,7 +155,7 @@ public function populate(array $queues) /** * @inheritDoc */ - public function removeContent(ModerationQueue $queue, $message) + public function removeContent(ModerationQueue $queue, string $message) { if ($this->isValid($queue->objectID)) { (new \wcf\command\comment\response\DeleteResponses([$this->getResponse($queue->objectID)]))(); @@ -163,7 +163,7 @@ public function removeContent(ModerationQueue $queue, $message) } #[\Override] - public function isAffectedUser(ModerationQueue $queue, $userID) + public function isAffectedUser(ModerationQueue $queue, int $userID) { if (!AbstractModerationQueueHandler::isAffectedUser($queue, $userID)) { return false; 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/AbstractModerationQueueManager.class.php b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php index 7cf63826e8e..da27750ddad 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php @@ -30,7 +30,7 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement /** * @inheritDoc */ - public function assignQueues($objectTypeID, array $queues) + public function assignQueues(int $objectTypeID, array $queues) { ModerationQueueManager::getInstance() ->getProcessor($this->definitionName, null, $objectTypeID) @@ -40,7 +40,7 @@ public function assignQueues($objectTypeID, array $queues) /** * @inheritDoc */ - public function isValid($objectType, $objectID = null) + public function isValid(string $objectType, ?int $objectID = null) { return ModerationQueueManager::getInstance()->isValid($this->definitionName, $objectType); } @@ -48,7 +48,7 @@ public function isValid($objectType, $objectID = null) /** * @inheritDoc */ - public function getObjectTypeID($objectType) + public function getObjectTypeID(string $objectType) { return ModerationQueueManager::getInstance()->getObjectTypeID($this->definitionName, $objectType); } @@ -56,7 +56,7 @@ public function getObjectTypeID($objectType) /** * @inheritDoc */ - public function getProcessor($objectType, $objectTypeID = null) + public function getProcessor(?string $objectType, ?int $objectTypeID = null) { return ModerationQueueManager::getInstance()->getProcessor($this->definitionName, $objectType, $objectTypeID); } @@ -64,7 +64,7 @@ public function getProcessor($objectType, $objectTypeID = null) /** * @inheritDoc */ - public function populate($objectTypeID, array $objects) + public function populate(int $objectTypeID, array $objects) { ModerationQueueManager::getInstance() ->getProcessor($this->definitionName, null, $objectTypeID) @@ -82,7 +82,7 @@ public function canRemoveContent(ModerationQueue $queue) /** * @inheritDoc */ - public function removeContent(ModerationQueue $queue, $message = '') + public function removeContent(ModerationQueue $queue, string $message = '') { $this->getProcessor(null, $queue->objectTypeID)->removeContent($queue, $message); } @@ -277,7 +277,7 @@ public function getController(): string } #[\Override] - public function getLink($queueID) + public function getLink(int $queueID) { return LinkHandler::getInstance()->getControllerLink($this->getController(), [ 'id' => $queueID, 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/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/moderation/queue/report/ArticleModerationQueueReportHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/report/ArticleModerationQueueReportHandler.class.php index 60024fd759e..e46445d73f7 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/report/ArticleModerationQueueReportHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/report/ArticleModerationQueueReportHandler.class.php @@ -37,7 +37,7 @@ class ArticleModerationQueueReportHandler extends AbstractModerationQueueHandler /** * @inheritDoc */ - public function canReport($objectID) + public function canReport(int $objectID) { if (!$this->isValid($objectID)) { return false; @@ -66,7 +66,7 @@ public function getReportedContent(ViewableModerationQueue $queue) * * @return ViewableArticle|null */ - public function getReportedObject($objectID) + public function getReportedObject(int $objectID) { if ($this->isValid($objectID)) { return $this->getArticle($objectID); @@ -118,7 +118,7 @@ public function assignQueues(array $queues) /** * @inheritDoc */ - public function getContainerID($objectID) + public function getContainerID(int $objectID) { if ($this->isValid($objectID)) { return $this->getArticle($objectID)->getCategory()->categoryID; @@ -130,7 +130,7 @@ public function getContainerID($objectID) /** * @inheritDoc */ - public function isValid($objectID) + public function isValid(int $objectID) { if ($this->getArticle($objectID) === null) { return false; @@ -174,7 +174,7 @@ public function canRemoveContent(ModerationQueue $queue) /** * @inheritDoc */ - public function removeContent(ModerationQueue $queue, $message) + public function removeContent(ModerationQueue $queue, string $message) { if ($this->isValid($queue->objectID)) { (new ArticleAction([$this->getArticle($queue->objectID)->getDecoratedObject()], 'trash'))->executeAction(); @@ -182,7 +182,7 @@ public function removeContent(ModerationQueue $queue, $message) } #[\Override] - public function isAffectedUser(ModerationQueue $queue, $userID) + public function isAffectedUser(ModerationQueue $queue, int $userID) { if (!parent::isAffectedUser($queue, $userID)) { return false; diff --git a/wcfsetup/install/files/lib/system/moderation/queue/report/CommentCommentModerationQueueReportHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/report/CommentCommentModerationQueueReportHandler.class.php index 6021173ae76..8c3dab1871d 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/report/CommentCommentModerationQueueReportHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/report/CommentCommentModerationQueueReportHandler.class.php @@ -23,7 +23,7 @@ class CommentCommentModerationQueueReportHandler extends AbstractCommentCommentM /** * @inheritDoc */ - public function canReport($objectID) + public function canReport(int $objectID) { if (!$this->isValid($objectID)) { return false; @@ -48,7 +48,7 @@ public function getReportedContent(ViewableModerationQueue $queue) /** * @inheritDoc */ - public function getReportedObject($objectID) + public function getReportedObject(int $objectID) { return $this->getComment($objectID); } diff --git a/wcfsetup/install/files/lib/system/moderation/queue/report/CommentResponseModerationQueueReportHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/report/CommentResponseModerationQueueReportHandler.class.php index 1cc1cd26176..8be2416e380 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/report/CommentResponseModerationQueueReportHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/report/CommentResponseModerationQueueReportHandler.class.php @@ -23,7 +23,7 @@ class CommentResponseModerationQueueReportHandler extends AbstractCommentRespons /** * @inheritDoc */ - public function canReport($objectID) + public function canReport(int $objectID) { if (!$this->isValid($objectID)) { return false; @@ -49,7 +49,7 @@ public function getReportedContent(ViewableModerationQueue $queue) /** * @inheritDoc */ - public function getReportedObject($objectID) + public function getReportedObject(int $objectID) { return $this->getResponse($objectID); } 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/moderation/queue/report/UserModerationQueueReportHandler.class.php b/wcfsetup/install/files/lib/system/moderation/queue/report/UserModerationQueueReportHandler.class.php index 1d61402c5b2..79e0c414c69 100644 --- a/wcfsetup/install/files/lib/system/moderation/queue/report/UserModerationQueueReportHandler.class.php +++ b/wcfsetup/install/files/lib/system/moderation/queue/report/UserModerationQueueReportHandler.class.php @@ -57,7 +57,7 @@ public function assignQueues(array $queues) /** * @inheritDoc */ - public function canReport($objectID) + public function canReport(int $objectID) { if (!$this->isValid($objectID)) { return false; @@ -69,7 +69,7 @@ public function canReport($objectID) /** * @inheritDoc */ - public function getContainerID($objectID) + public function getContainerID(int $objectID) { return 0; } @@ -90,7 +90,7 @@ public function getReportedContent(ViewableModerationQueue $queue) /** * @inheritDoc */ - public function getReportedObject($objectID) + public function getReportedObject(int $objectID) { if ($this->isValid($objectID)) { return $this->getUser($objectID); @@ -102,7 +102,7 @@ public function getReportedObject($objectID) /** * @inheritDoc */ - public function isValid($objectID) + public function isValid(int $objectID) { if ($this->getUser($objectID) === null) { return false; @@ -153,7 +153,7 @@ public function canRemoveContent(ModerationQueue $queue) /** * @inheritDoc */ - public function removeContent(ModerationQueue $queue, $message) + public function removeContent(ModerationQueue $queue, string $message) { throw new SystemException("it's not allowed to delete users using the moderation"); } diff --git a/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php b/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php index a77443becb5..5bb173b80aa 100644 --- a/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/AboutMeOptionType.class.php @@ -19,7 +19,7 @@ class AboutMeOptionType extends MessageOptionType /** * @inheritDoc */ - public function validate(Option $option, $newValue) + public function validate(Option $option, mixed $newValue) { parent::validate($option, $newValue); diff --git a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php index fc36c363852..a5ade117e73 100644 --- a/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php @@ -33,7 +33,7 @@ abstract class AbstractCategoryMultiSelectOptionType extends AbstractOptionType /** * @inheritDoc */ - public function getFormElement(Option $option, $value) + public function getFormElement(Option $option, mixed $value) { /** @var CategoryNodeTree $categoryTree */ $categoryTree = new $this->nodeTreeClassname($this->objectType); @@ -49,7 +49,7 @@ public function getFormElement(Option $option, $value) /** * @inheritDoc */ - public function validate(Option $option, $newValue) + public function validate(Option $option, mixed $newValue) { if (!\is_array($newValue)) { $newValue = []; @@ -70,7 +70,7 @@ public function validate(Option $option, $newValue) /** * @inheritDoc */ - public function getData(Option $option, $newValue) + public function getData(Option $option, mixed $newValue) { if (!\is_array($newValue)) { $newValue = []; diff --git a/wcfsetup/install/files/lib/system/option/AbstractOptionType.class.php b/wcfsetup/install/files/lib/system/option/AbstractOptionType.class.php index 21d88cc8b65..5a02093e411 100644 --- a/wcfsetup/install/files/lib/system/option/AbstractOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/AbstractOptionType.class.php @@ -22,14 +22,12 @@ abstract class AbstractOptionType implements IOptionType /** * @inheritDoc */ - public function validate(Option $option, $newValue) - { - } + public function validate(Option $option, mixed $newValue) {} /** * @inheritDoc */ - public function getData(Option $option, $newValue) + public function getData(Option $option, mixed $newValue) { return $newValue; } @@ -53,7 +51,7 @@ public function supportI18n() /** * @inheritDoc */ - public function compare($value1, $value2) + public function compare(mixed $value1, mixed $value2) { return 0; } @@ -69,7 +67,7 @@ public function hideLabelInSearch() /** * @inheritDoc */ - public function getDisabledOptionNames($value, $enableOptions) + public function getDisabledOptionNames(mixed $value, string $enableOptions) { return []; } diff --git a/wcfsetup/install/files/lib/system/option/BirthdayOptionType.class.php b/wcfsetup/install/files/lib/system/option/BirthdayOptionType.class.php index a895c6d5eca..f800c04d28c 100644 --- a/wcfsetup/install/files/lib/system/option/BirthdayOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/BirthdayOptionType.class.php @@ -27,7 +27,7 @@ class BirthdayOptionType extends DateOptionType /** * @inheritDoc */ - public function validate(Option $option, $newValue) + public function validate(Option $option, mixed $newValue) { parent::validate($option, $newValue); @@ -44,7 +44,7 @@ public function validate(Option $option, $newValue) /** * @inheritDoc */ - public function getData(Option $option, $newValue) + public function getData(Option $option, mixed $newValue) { return $newValue; } @@ -52,7 +52,7 @@ public function getData(Option $option, $newValue) /** * @inheritDoc */ - public function getSearchFormElement(Option $option, $value) + public function getSearchFormElement(Option $option, mixed $value) { $ageFrom = $ageTo = ''; if (!empty($value['ageFrom'])) { @@ -72,7 +72,7 @@ public function getSearchFormElement(Option $option, $value) /** * @inheritDoc */ - public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) + public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, mixed $value) { if (empty($value['ageFrom']) && empty($value['ageTo'])) { return false; @@ -115,7 +115,7 @@ public function getCondition(PreparedStatementConditionBuilder &$conditions, Opt /** * @inheritDoc */ - public function addCondition(UserList $userList, Option $option, $value) + public function addCondition(UserList $userList, Option $option, mixed $value) { $ageFrom = \intval($value['ageFrom']); $ageTo = \intval($value['ageTo']); @@ -156,7 +156,7 @@ public function addCondition(UserList $userList, Option $option, $value) /** * @inheritDoc */ - public function checkUser(User $user, Option $option, $value) + public function checkUser(User $user, Option $option, mixed $value) { if (!$user->birthdayShowYear || !$user->birthday) { return false; @@ -179,7 +179,7 @@ public function checkUser(User $user, Option $option, $value) /** * @inheritDoc */ - public function getConditionData(Option $option, $newValue) + public function getConditionData(Option $option, mixed $newValue) { if (!$newValue['ageFrom'] && !$newValue['ageTo']) { return; diff --git a/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php b/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php index 9d9ae906161..3b5015c2482 100644 --- a/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php @@ -27,7 +27,7 @@ class BooleanOptionType extends AbstractOptionType implements ISearchableConditi /** * @inheritDoc */ - public function getFormElement(Option $option, $value) + public function getFormElement(Option $option, mixed $value) { $options = Option::parseEnableOptions($option->enableOptions); @@ -42,7 +42,7 @@ public function getFormElement(Option $option, $value) /** * @inheritDoc */ - public function getData(Option $option, $newValue) + public function getData(Option $option, mixed $newValue) { if ($newValue == 1) { // @phpstan-ignore return.type @@ -56,7 +56,7 @@ public function getData(Option $option, $newValue) /** * @inheritDoc */ - public function getSearchFormElement(Option $option, $value) + public function getSearchFormElement(Option $option, mixed $value) { $options = Option::parseEnableOptions($option->enableOptions); @@ -72,7 +72,7 @@ public function getSearchFormElement(Option $option, $value) /** * @inheritDoc */ - public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) + public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, mixed $value) { if (!isset($_POST['searchOptions'][$option->optionName])) { return false; @@ -86,7 +86,7 @@ public function getCondition(PreparedStatementConditionBuilder &$conditions, Opt /** * @inheritDoc */ - public function addCondition(UserList $userList, Option $option, $value) + public function addCondition(UserList $userList, Option $option, mixed $value) { $userList->getConditionBuilder()->add( 'user_option_value.userOption' . $option->optionID . ' = ?', @@ -97,7 +97,7 @@ public function addCondition(UserList $userList, Option $option, $value) /** * @inheritDoc */ - public function checkUser(User $user, Option $option, $value) + public function checkUser(User $user, Option $option, mixed $value) { if (!$value) { return false; @@ -109,7 +109,7 @@ public function checkUser(User $user, Option $option, $value) /** * @inheritDoc */ - public function getConditionData(Option $option, $newValue) + public function getConditionData(Option $option, mixed $newValue) { return $newValue; } @@ -117,7 +117,7 @@ public function getConditionData(Option $option, $newValue) /** * @inheritDoc */ - public function compare($value1, $value2) + public function compare(mixed $value1, mixed $value2) { if ($value1 == $value2) { return 0; @@ -129,7 +129,7 @@ public function compare($value1, $value2) /** * @inheritDoc */ - public function getDisabledOptionNames($value, $enableOptions) + public function getDisabledOptionNames(mixed $value, string $enableOptions) { $options = ArrayUtil::trim(\explode(',', $enableOptions)); $result = []; diff --git a/wcfsetup/install/files/lib/system/option/CaptchaSelectOptionType.class.php b/wcfsetup/install/files/lib/system/option/CaptchaSelectOptionType.class.php index 2688a9033b1..d8062d763e0 100644 --- a/wcfsetup/install/files/lib/system/option/CaptchaSelectOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/CaptchaSelectOptionType.class.php @@ -20,7 +20,7 @@ class CaptchaSelectOptionType extends AbstractOptionType /** * @inheritDoc */ - public function getFormElement(Option $option, $value) + public function getFormElement(Option $option, mixed $value) { RecaptchaHandler::$forceIsAvailable = true; $selectOptions = CaptchaHandler::getInstance()->getCaptchaSelection(); @@ -84,7 +84,7 @@ protected function parseEnableOptions(Option $option) /** * @inheritDoc */ - public function validate(Option $option, $newValue) + public function validate(Option $option, mixed $newValue) { if (!$newValue) { return; diff --git a/wcfsetup/install/files/lib/system/option/DateOptionType.class.php b/wcfsetup/install/files/lib/system/option/DateOptionType.class.php index b2f285ccd98..3a65ff178ff 100644 --- a/wcfsetup/install/files/lib/system/option/DateOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/DateOptionType.class.php @@ -27,7 +27,7 @@ class DateOptionType extends TextOptionType /** * @inheritDoc */ - public function validate(Option $option, $newValue) + public function validate(Option $option, mixed $newValue) { if (empty($newValue)) { return; @@ -45,7 +45,7 @@ public function validate(Option $option, $newValue) /** * @inheritDoc */ - public function compare($value1, $value2) + public function compare(mixed $value1, mixed $value2) { if ($value1 == $value2) { return 0; @@ -57,7 +57,7 @@ public function compare($value1, $value2) /** * @inheritDoc */ - public function getFormElement(Option $option, $value) + public function getFormElement(Option $option, mixed $value) { if ($value == '0000-00-00') { $value = ''; diff --git a/wcfsetup/install/files/lib/system/option/FileOptionType.class.php b/wcfsetup/install/files/lib/system/option/FileOptionType.class.php index 0befb288279..82203e1252e 100644 --- a/wcfsetup/install/files/lib/system/option/FileOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/FileOptionType.class.php @@ -41,7 +41,7 @@ protected function createUploadHandler(Option $option) /** * @inheritDoc */ - public function getData(Option $option, $newValue) + public function getData(Option $option, mixed $newValue) { $this->createUploadHandler($option); if ($this->uploadHandlers[$option->optionName] === null) { @@ -84,7 +84,7 @@ public function getData(Option $option, $newValue) /** * @inheritDoc */ - public function getFormElement(Option $option, $value) + public function getFormElement(Option $option, mixed $value) { return WCF::getTPL()->render('wcf', 'fileOptionType', [ 'option' => $option, @@ -95,7 +95,7 @@ public function getFormElement(Option $option, $value) /** * @inheritDoc */ - public function validate(Option $option, $newValue) + public function validate(Option $option, mixed $newValue) { $this->createUploadHandler($option); if ($this->uploadHandlers[$option->optionName] === null) { diff --git a/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php b/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php index ac688f46207..508fb845131 100644 --- a/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php @@ -70,7 +70,7 @@ public function getContent(Option $option, $newValue) /** * @inheritDoc */ - public function getFormElement(Option $option, $value) + public function getFormElement(Option $option, mixed $value) { $value = FileUtil::formatFilesize(\intval($value)); @@ -80,7 +80,7 @@ public function getFormElement(Option $option, $value) /** * @inheritDoc */ - public function compare($value1, $value2) + public function compare(mixed $value1, mixed $value2) { if ($value1 == $value2) { return 0; diff --git a/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php b/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php index 768207eab43..cd43ed7457e 100644 --- a/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/FloatOptionType.class.php @@ -24,7 +24,7 @@ class FloatOptionType extends TextOptionType /** * @inheritDoc */ - public function getFormElement(Option $option, $value) + public function getFormElement(Option $option, mixed $value) { $value = \str_replace('.', WCF::getLanguage()->get('wcf.global.decimalPoint'), $value); @@ -34,7 +34,7 @@ public function getFormElement(Option $option, $value) /** * @inheritDoc */ - public function getData(Option $option, $newValue) + public function getData(Option $option, mixed $newValue) { // @phpstan-ignore return.type return $this->toFloat($newValue); @@ -43,7 +43,7 @@ public function getData(Option $option, $newValue) /** * @inheritDoc */ - public function compare($value1, $value2) + public function compare(mixed $value1, mixed $value2) { if ($value1 == $value2) { return 0; @@ -55,7 +55,7 @@ public function compare($value1, $value2) /** * @inheritDoc */ - public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) + public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, mixed $value) { if (!isset($_POST['searchOptions'][$option->optionName])) { return false; 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