From: Matthias Schmidt Date: Fri, 27 Jul 2018 13:47:46 +0000 (+0200) Subject: Remove explicit return types X-Git-Tag: 5.2.0_Alpha_1~364^2~116 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=59d9d26d323a50c81871bbf3caace486c57e971a;p=GitHub%2FWoltLab%2FWCF.git Remove explicit return types See #2720 --- diff --git a/wcfsetup/install/files/lib/data/article/Article.class.php b/wcfsetup/install/files/lib/data/article/Article.class.php index 49e91efdd6..9ce4ee3916 100644 --- a/wcfsetup/install/files/lib/data/article/Article.class.php +++ b/wcfsetup/install/files/lib/data/article/Article.class.php @@ -290,7 +290,7 @@ class Article extends DatabaseObject implements ILinkableObject { * @return string[] * @since 3.2 */ - public static function getAllDiscussionProviders(): array { + public static function getAllDiscussionProviders() { /** @var string[] $discussionProviders */ static $discussionProviders; 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 69e0fbebc8..1102bf279c 100644 --- a/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php +++ b/wcfsetup/install/files/lib/data/object/type/ObjectType.class.php @@ -122,7 +122,7 @@ class ObjectType extends ProcessibleDatabaseObject { * @return Package * @since 3.2 */ - public function getPackage(): Package { + public function getPackage() { return PackageCache::getInstance()->getPackage($this->packageID); } } diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index 3d00dae34d..c141e667d9 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -359,7 +359,7 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject { * @return bool * @since 3.2 */ - public function showShareButtons(): bool { + public function showShareButtons() { return $this->enableShareButtons && $this->pageType !== 'system'; } diff --git a/wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php b/wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php index 1a778e92c5..2cb4419f21 100644 --- a/wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php +++ b/wcfsetup/install/files/lib/data/search/ICustomIconSearchResultObject.class.php @@ -19,5 +19,5 @@ interface ICustomIconSearchResultObject extends ISearchResultObject { * * @return string */ - public function getCustomSearchResultIcon(): string; + public function getCustomSearchResultIcon(); } diff --git a/wcfsetup/install/files/lib/system/article/discussion/CommentArticleDiscussionProvider.class.php b/wcfsetup/install/files/lib/system/article/discussion/CommentArticleDiscussionProvider.class.php index 1bc3f0cdb8..95eac42a36 100644 --- a/wcfsetup/install/files/lib/system/article/discussion/CommentArticleDiscussionProvider.class.php +++ b/wcfsetup/install/files/lib/system/article/discussion/CommentArticleDiscussionProvider.class.php @@ -17,21 +17,21 @@ class CommentArticleDiscussionProvider extends AbstractArticleDiscussionProvider /** * @inheritDoc */ - public function getDiscussionCount(): int { + public function getDiscussionCount() { return $this->article->comments; } /** * @inheritDoc */ - public function getDiscussionCountPhrase(): string { + public function getDiscussionCountPhrase() { return WCF::getLanguage()->getDynamicVariable('wcf.article.articleComments', ['article' => $this->article]); } /** * @inheritDoc */ - public function renderDiscussions(): string { + public function renderDiscussions() { $commentCanAdd = WCF::getSession()->getPermission('user.article.canAddComment'); $commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment'); $commentManager = CommentHandler::getInstance()->getObjectType($commentObjectTypeID)->getProcessor(); @@ -51,7 +51,7 @@ class CommentArticleDiscussionProvider extends AbstractArticleDiscussionProvider /** * @inheritDoc */ - public static function isResponsible(Article $article): bool { + public static function isResponsible(Article $article) { return !!$article->enableComments; } } diff --git a/wcfsetup/install/files/lib/system/article/discussion/IArticleDiscussionProvider.class.php b/wcfsetup/install/files/lib/system/article/discussion/IArticleDiscussionProvider.class.php index ef4b342d4b..797f68fc00 100644 --- a/wcfsetup/install/files/lib/system/article/discussion/IArticleDiscussionProvider.class.php +++ b/wcfsetup/install/files/lib/system/article/discussion/IArticleDiscussionProvider.class.php @@ -18,7 +18,7 @@ interface IArticleDiscussionProvider { * * @return int */ - public function getDiscussionCount(): int; + public function getDiscussionCount(); /** * Returns the simple phrase "X " that is used for both the statistics @@ -26,14 +26,14 @@ interface IArticleDiscussionProvider { * * @return string */ - public function getDiscussionCountPhrase(): string; + public function getDiscussionCountPhrase(); /** * Renders the input and display section of the associated discussion. * * @return string */ - public function renderDiscussions(): string; + public function renderDiscussions(); /** * Sets the content object required for the separate discussions per article language. @@ -49,5 +49,5 @@ interface IArticleDiscussionProvider { * @param Article $article * @return bool */ - public static function isResponsible(Article $article): bool; + public static function isResponsible(Article $article); } diff --git a/wcfsetup/install/files/lib/system/article/discussion/VoidArticleDiscussionProvider.class.php b/wcfsetup/install/files/lib/system/article/discussion/VoidArticleDiscussionProvider.class.php index a1dbffaec0..37aebb865f 100644 --- a/wcfsetup/install/files/lib/system/article/discussion/VoidArticleDiscussionProvider.class.php +++ b/wcfsetup/install/files/lib/system/article/discussion/VoidArticleDiscussionProvider.class.php @@ -16,28 +16,28 @@ class VoidArticleDiscussionProvider extends AbstractArticleDiscussionProvider { /** * @inheritDoc */ - public function getDiscussionCount(): int { + public function getDiscussionCount() { return 0; } /** * @inheritDoc */ - public function getDiscussionCountPhrase(): string { + public function getDiscussionCountPhrase() { return ''; } /** * @inheritDoc */ - public function renderDiscussions(): string { + public function renderDiscussions() { return ''; } /** * @inheritDoc */ - public static function isResponsible(Article $article): bool { + public static function isResponsible(Article $article) { return true; } } diff --git a/wcfsetup/install/files/lib/system/html/toc/HtmlToc.class.php b/wcfsetup/install/files/lib/system/html/toc/HtmlToc.class.php index ad5b4fe54a..07fb5af4f5 100644 --- a/wcfsetup/install/files/lib/system/html/toc/HtmlToc.class.php +++ b/wcfsetup/install/files/lib/system/html/toc/HtmlToc.class.php @@ -19,7 +19,7 @@ class HtmlToc { * @param string $idPrefix prefix for all generated ids, must not end with a delimiter * @return string the HTML of the generated table of contents or an empty string if there are too few headings */ - public static function forMessage(\DOMDocument $document, string $idPrefix): string { + public static function forMessage(\DOMDocument $document, string $idPrefix) { $titleRegex = new Regex('[^\p{L}\p{N}]+', Regex::UTF_8); // fetch all headings in their order of appearance 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 566d720ff7..a8a4d2ef46 100644 --- a/wcfsetup/install/files/lib/system/html/toc/HtmlTocItem.class.php +++ b/wcfsetup/install/files/lib/system/html/toc/HtmlTocItem.class.php @@ -37,15 +37,15 @@ class HtmlTocItem implements \Countable, \RecursiveIterator { $this->title = $title; } - public function getID(): string { + public function getID() { return $this->id; } - public function getLevel(): int { + public function getLevel() { return $this->level; } - public function getTitle(): string { + public function getTitle() { return $this->title; } @@ -69,7 +69,7 @@ class HtmlTocItem implements \Countable, \RecursiveIterator { $this->depth = $depth; } - public function getDepth(): int { + public function getDepth() { return $this->depth; } @@ -78,7 +78,7 @@ class HtmlTocItem implements \Countable, \RecursiveIterator { * * @return integer */ - public function count(): int { + public function count() { return count($this->children); } @@ -87,7 +87,7 @@ class HtmlTocItem implements \Countable, \RecursiveIterator { * * @return bool */ - public function isLastSibling(): bool { + public function isLastSibling() { foreach ($this->getParent() as $key => $child) { if ($child === $this) { return ($key === count($this->getParent()) - 1); @@ -102,7 +102,7 @@ class HtmlTocItem implements \Countable, \RecursiveIterator { * * @return int */ - public function getOpenParentNodes(): int { + public function getOpenParentNodes() { $element = $this; $i = 0; @@ -124,7 +124,7 @@ class HtmlTocItem implements \Countable, \RecursiveIterator { /** * @inheritDoc */ - public function valid(): bool { + public function valid() { return isset($this->children[$this->position]); } @@ -138,32 +138,32 @@ class HtmlTocItem implements \Countable, \RecursiveIterator { /** * @inheritDoc */ - public function current(): HtmlTocItem { + public function current() { return $this->children[$this->position]; } /** * @inheritDoc */ - public function key(): int { + public function key() { return $this->position; } /** * @inheritDoc */ - public function getChildren(): HtmlTocItem { + public function getChildren() { return $this->children[$this->position]; } /** * @inheritDoc */ - public function hasChildren(): bool { + public function hasChildren() { return count($this->children) > 0; } - public function getIterator(): \RecursiveIteratorIterator { + public function getIterator() { return new \RecursiveIteratorIterator($this, \RecursiveIteratorIterator::SELF_FIRST); } } diff --git a/wcfsetup/install/files/lib/system/log/modification/IExtendedModificationLogHandler.class.php b/wcfsetup/install/files/lib/system/log/modification/IExtendedModificationLogHandler.class.php index 15d2cdb0f9..eebbefcadb 100644 --- a/wcfsetup/install/files/lib/system/log/modification/IExtendedModificationLogHandler.class.php +++ b/wcfsetup/install/files/lib/system/log/modification/IExtendedModificationLogHandler.class.php @@ -19,7 +19,7 @@ interface IExtendedModificationLogHandler { * * @return string[] */ - public function getAvailableActions(): array; + public function getAvailableActions(); /** * Processes a list of items by converting them into IViewableModificationLog @@ -28,5 +28,5 @@ interface IExtendedModificationLogHandler { * @param ModificationLog[] $items * @return IViewableModificationLog[] */ - public function processItems(array $items): array; + public function processItems(array $items); }