From 3c3f931db775f3790ebad88433fc0e5f0ac0f55f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 20 Sep 2021 15:48:03 +0200 Subject: [PATCH] Fix return type of `count()` for the remaining classes implementing \Countable see 3f6b343d10b044ab08d41fec525f69ffe0a95e49 --- .../files/lib/data/comment/StructuredComment.class.php | 2 +- .../files/lib/data/label/group/ViewableLabelGroup.class.php | 2 +- .../install/files/lib/data/menu/item/MenuItemNode.class.php | 4 +--- wcfsetup/install/files/lib/data/page/PageNode.class.php | 4 +--- .../files/lib/data/smiley/category/SmileyCategory.class.php | 2 +- wcfsetup/install/files/lib/system/MetaTagHandler.class.php | 2 +- .../files/lib/system/attachment/AttachmentHandler.class.php | 2 +- .../install/files/lib/system/breadcrumb/Breadcrumbs.class.php | 2 +- .../install/files/lib/system/html/toc/HtmlTocItem.class.php | 4 +--- .../label/object/type/LabelObjectTypeContainer.class.php | 2 +- .../files/lib/system/message/quote/QuotedMessage.class.php | 2 +- .../files/lib/system/search/acp/ACPSearchResultList.class.php | 2 +- .../install/files/lib/system/user/GroupedUserList.class.php | 2 +- 13 files changed, 13 insertions(+), 19 deletions(-) diff --git a/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php b/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php index b225d41c59..786c73d55d 100644 --- a/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php +++ b/wcfsetup/install/files/lib/data/comment/StructuredComment.class.php @@ -166,7 +166,7 @@ class StructuredComment extends DatabaseObjectDecorator implements \Countable, \ /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->responses); } 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 3e57254224..f9923c7b0e 100644 --- a/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php +++ b/wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php @@ -171,7 +171,7 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable, /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->labels); } diff --git a/wcfsetup/install/files/lib/data/menu/item/MenuItemNode.class.php b/wcfsetup/install/files/lib/data/menu/item/MenuItemNode.class.php index 42531c7909..47ea28c62c 100644 --- a/wcfsetup/install/files/lib/data/menu/item/MenuItemNode.class.php +++ b/wcfsetup/install/files/lib/data/menu/item/MenuItemNode.class.php @@ -93,10 +93,8 @@ class MenuItemNode extends DatabaseObjectDecorator implements \Countable, \Recur /** * Returns the number of children. - * - * @return int */ - public function count() + public function count(): int { return \count($this->children); } diff --git a/wcfsetup/install/files/lib/data/page/PageNode.class.php b/wcfsetup/install/files/lib/data/page/PageNode.class.php index 5e18aae9ed..8279740f63 100644 --- a/wcfsetup/install/files/lib/data/page/PageNode.class.php +++ b/wcfsetup/install/files/lib/data/page/PageNode.class.php @@ -87,10 +87,8 @@ class PageNode extends DatabaseObjectDecorator implements \Countable, \Recursive /** * Returns the number of children. - * - * @return int */ - public function count() + public function count(): int { return \count($this->children); } 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 53ceb156f4..ac43aed81c 100644 --- a/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php +++ b/wcfsetup/install/files/lib/data/smiley/category/SmileyCategory.class.php @@ -57,7 +57,7 @@ class SmileyCategory extends AbstractDecoratedCategory implements \Countable, IT /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->smilies); } diff --git a/wcfsetup/install/files/lib/system/MetaTagHandler.class.php b/wcfsetup/install/files/lib/system/MetaTagHandler.class.php index 36c74c2857..68ed3f1bd9 100644 --- a/wcfsetup/install/files/lib/system/MetaTagHandler.class.php +++ b/wcfsetup/install/files/lib/system/MetaTagHandler.class.php @@ -100,7 +100,7 @@ class MetaTagHandler extends SingletonFactory implements \Countable, \Iterator /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->objects); } diff --git a/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php b/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php index b6c6d06202..f74b5b5921 100644 --- a/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php +++ b/wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php @@ -111,7 +111,7 @@ class AttachmentHandler implements \Countable /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->getAttachmentList()); } diff --git a/wcfsetup/install/files/lib/system/breadcrumb/Breadcrumbs.class.php b/wcfsetup/install/files/lib/system/breadcrumb/Breadcrumbs.class.php index 781edc9e2b..27bc9f50af 100644 --- a/wcfsetup/install/files/lib/system/breadcrumb/Breadcrumbs.class.php +++ b/wcfsetup/install/files/lib/system/breadcrumb/Breadcrumbs.class.php @@ -123,7 +123,7 @@ class Breadcrumbs extends SingletonFactory implements \Countable, \Iterator /** * @inheritDoc */ - public function count() + public function count(): int { if ($this->items === null) { $this->loadBreadcrumbs(); diff --git a/wcfsetup/install/files/lib/system/html/toc/HtmlTocItem.class.php b/wcfsetup/install/files/lib/system/html/toc/HtmlTocItem.class.php index a1912fa901..8f9d08e23f 100644 --- a/wcfsetup/install/files/lib/system/html/toc/HtmlTocItem.class.php +++ b/wcfsetup/install/files/lib/system/html/toc/HtmlTocItem.class.php @@ -94,10 +94,8 @@ class HtmlTocItem implements \Countable, \RecursiveIterator /** * Returns the number of children. - * - * @return int */ - public function count() + public function count(): int { return \count($this->children); } diff --git a/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php b/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php index ac6c2d9e05..7b797c05fa 100644 --- a/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php +++ b/wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php @@ -116,7 +116,7 @@ class LabelObjectTypeContainer implements \Countable, \Iterator /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->objectTypes); } diff --git a/wcfsetup/install/files/lib/system/message/quote/QuotedMessage.class.php b/wcfsetup/install/files/lib/system/message/quote/QuotedMessage.class.php index 94f3cf87ef..c38c57993c 100644 --- a/wcfsetup/install/files/lib/system/message/quote/QuotedMessage.class.php +++ b/wcfsetup/install/files/lib/system/message/quote/QuotedMessage.class.php @@ -160,7 +160,7 @@ class QuotedMessage implements \Countable, \Iterator /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->quotes); } diff --git a/wcfsetup/install/files/lib/system/search/acp/ACPSearchResultList.class.php b/wcfsetup/install/files/lib/system/search/acp/ACPSearchResultList.class.php index 5e8c2b6f31..81611b87a0 100644 --- a/wcfsetup/install/files/lib/system/search/acp/ACPSearchResultList.class.php +++ b/wcfsetup/install/files/lib/system/search/acp/ACPSearchResultList.class.php @@ -120,7 +120,7 @@ class ACPSearchResultList implements \Countable, \Iterator /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->results); } diff --git a/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php b/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php index ffff722a4d..6a7dcc5c97 100644 --- a/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php +++ b/wcfsetup/install/files/lib/system/user/GroupedUserList.class.php @@ -132,7 +132,7 @@ class GroupedUserList implements \Countable, \Iterator /** * @inheritDoc */ - public function count() + public function count(): int { return \count($this->userIDs); } -- 2.20.1