From ba997cccb69b76707ad71579d350a02230a14240 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 27 Jul 2018 15:53:47 +0200 Subject: [PATCH] Remove explicit return types See #2508 See #2720 --- .../install/files/lib/data/like/Like.class.php | 2 +- .../lib/data/like/object/LikeObject.class.php | 2 +- .../lib/data/reaction/ReactionAction.class.php | 4 ++-- .../data/reaction/type/ReactionType.class.php | 12 ++++++------ .../reaction/type/ReactionTypeCache.class.php | 6 +++--- .../builder/ReactionTypeCacheBuilder.class.php | 2 +- .../system/reaction/ReactionHandler.class.php | 16 ++++++++-------- .../TReactionUserNotificationEvent.class.php | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/wcfsetup/install/files/lib/data/like/Like.class.php b/wcfsetup/install/files/lib/data/like/Like.class.php index bb07b36c4f..b9a20fcdad 100644 --- a/wcfsetup/install/files/lib/data/like/Like.class.php +++ b/wcfsetup/install/files/lib/data/like/Like.class.php @@ -98,7 +98,7 @@ class Like extends DatabaseObject { * @return ReactionType * @since 3.2 */ - public function getReactionType(): ReactionType { + public function getReactionType() { return ReactionTypeCache::getInstance()->getReactionTypeByID($this->reactionTypeID); } } diff --git a/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php b/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php index 23e7c66342..9ac2d813b2 100644 --- a/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php +++ b/wcfsetup/install/files/lib/data/like/object/LikeObject.class.php @@ -139,7 +139,7 @@ class LikeObject extends DatabaseObject { * @return integer[] * @since 3.2 */ - public function getReactions(): array { + public function getReactions() { return $this->reactions; } diff --git a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php index d0ec69c953..21e3ba9dd2 100644 --- a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php +++ b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php @@ -81,7 +81,7 @@ class ReactionAction extends AbstractDatabaseObjectAction { * * @return string[] */ - public function getReactionDetails(): array { + public function getReactionDetails() { $likeList = new ViewableLikeList(); $likeList->getConditionBuilder()->add('objectID = ?', [$this->parameters['data']['objectID']]); $likeList->getConditionBuilder()->add('objectTypeID = ?', [$this->objectType->objectTypeID]); @@ -142,7 +142,7 @@ class ReactionAction extends AbstractDatabaseObjectAction { * * @return array */ - public function react(): array { + public function react() { $reactionData = ReactionHandler::getInstance()->react($this->likeableObject, WCF::getUser(), $this->reactionType->reactionTypeID); // get stats diff --git a/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php b/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php index 7e64db68ee..e2f70b9b6a 100644 --- a/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php +++ b/wcfsetup/install/files/lib/data/reaction/type/ReactionType.class.php @@ -47,7 +47,7 @@ class ReactionType extends DatabaseObject implements ITitledObject { /** * @inheritDoc */ - public function getTitle(): string { + public function getTitle() { return WCF::getLanguage()->get($this->title); } @@ -56,7 +56,7 @@ class ReactionType extends DatabaseObject implements ITitledObject { * * @return string */ - public function renderIcon(): string { + public function renderIcon() { return WCF::getTPL()->fetch('reactionTypeImage', 'wcf', [ 'reactionType' => $this ], true); @@ -67,7 +67,7 @@ class ReactionType extends DatabaseObject implements ITitledObject { * * @return string */ - public function getIconPath(): string { + public function getIconPath() { return WCF::getPath() . 'images/reaction/'. $this->iconFile; } @@ -76,7 +76,7 @@ class ReactionType extends DatabaseObject implements ITitledObject { * * @return bool */ - public function isPositive(): bool { + public function isPositive() { return $this->type == self::REACTION_TYPE_POSITIVE; } @@ -85,7 +85,7 @@ class ReactionType extends DatabaseObject implements ITitledObject { * * @return bool */ - public function isNegative(): bool { + public function isNegative() { return $this->type == self::REACTION_TYPE_NEGATIVE; } @@ -94,7 +94,7 @@ class ReactionType extends DatabaseObject implements ITitledObject { * * @return bool */ - public function isNeutral(): bool { + public function isNeutral() { return $this->type == self::REACTION_TYPE_NEUTRAL; } } diff --git a/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeCache.class.php b/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeCache.class.php index de7269d404..ea8e0f8c98 100644 --- a/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeCache.class.php +++ b/wcfsetup/install/files/lib/data/reaction/type/ReactionTypeCache.class.php @@ -53,7 +53,7 @@ class ReactionTypeCache extends SingletonFactory { * @param integer[] $reactionTypeIDs * @return ReactionType[] */ - public function getReactionTypesByID(array $reactionTypeIDs): array { + public function getReactionTypesByID(array $reactionTypeIDs) { $returnValues = []; foreach ($reactionTypeIDs as $reactionType) { @@ -68,7 +68,7 @@ class ReactionTypeCache extends SingletonFactory { * * @return ReactionType[] */ - public function getReactionTypes(): array { + public function getReactionTypes() { return $this->reactionTypes; } @@ -77,7 +77,7 @@ class ReactionTypeCache extends SingletonFactory { * * @return ReactionType[] */ - public function getEnabledReactionTypes(): array { + public function getEnabledReactionTypes() { return $this->enabledReactionTypes; } diff --git a/wcfsetup/install/files/lib/system/cache/builder/ReactionTypeCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ReactionTypeCacheBuilder.class.php index 566863c203..ecef1f4b15 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ReactionTypeCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ReactionTypeCacheBuilder.class.php @@ -15,7 +15,7 @@ class ReactionTypeCacheBuilder extends AbstractCacheBuilder { /** * @inheritDoc */ - public function rebuild(array $parameters): array { + public function rebuild(array $parameters) { $reactionTypeList = new ReactionTypeList(); if (isset($parameters['onlyEnabled']) && $parameters['onlyEnabled']) { diff --git a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php index d547c0598d..0b220ee0a4 100644 --- a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php +++ b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php @@ -61,7 +61,7 @@ class ReactionHandler extends SingletonFactory { * * @return string */ - public function getReactionsJSVariable(): string { + public function getReactionsJSVariable() { $reactions = ReactionTypeCache::getInstance()->getEnabledReactionTypes(); $returnValues = []; @@ -103,7 +103,7 @@ class ReactionHandler extends SingletonFactory { * @param integer $objectID * @return string */ - public function getDataAttributes($objectName, $objectID): string { + public function getDataAttributes($objectName, $objectID) { $objectType = $this->getObjectType($objectName); if ($objectType === null) { throw new \InvalidArgumentException("ObjectName '{$objectName}' is unknown for definition 'com.woltlab.wcf.like.likeableObject'."); @@ -178,7 +178,7 @@ class ReactionHandler extends SingletonFactory { * @param ObjectType $objectType * @return LikeObject[] */ - public function getLikeObjects(ObjectType $objectType): array { + public function getLikeObjects(ObjectType $objectType) { if (isset($this->likeObjectCache[$objectType->objectTypeID])) { return $this->likeObjectCache[$objectType->objectTypeID]; } @@ -194,7 +194,7 @@ class ReactionHandler extends SingletonFactory { * @param array $objectIDs * @return integer */ - public function loadLikeObjects(ObjectType $objectType, array $objectIDs): int { + public function loadLikeObjects(ObjectType $objectType, array $objectIDs) { if (empty($objectIDs)) { return 0; } @@ -244,7 +244,7 @@ class ReactionHandler extends SingletonFactory { * @param integer $time * @return array */ - public function react(ILikeObject $likeable, User $user, $reactionTypeID, $time = TIME_NOW): array { + public function react(ILikeObject $likeable, User $user, $reactionTypeID, $time = TIME_NOW) { // verify if object is already liked by user $like = Like::getLike($likeable->getObjectType()->objectTypeID, $likeable->getObjectID(), $user->userID); @@ -350,7 +350,7 @@ class ReactionHandler extends SingletonFactory { * @param ReactionType $reactionType * @return array */ - private function updateLikeObject(ILikeObject $likeable, LikeObject $likeObject, Like $like, ReactionType $reactionType): array { + private function updateLikeObject(ILikeObject $likeable, LikeObject $likeObject, Like $like, ReactionType $reactionType) { // update existing object if ($likeObject->likeObjectID) { $likes = $likeObject->likes; @@ -495,7 +495,7 @@ class ReactionHandler extends SingletonFactory { * @param User $user * @return array */ - public function revertReact(Like $like, ILikeObject $likeable, LikeObject $likeObject, User $user): array { + public function revertReact(Like $like, ILikeObject $likeable, LikeObject $likeObject, User $user) { if (!$like->likeID) { throw new \InvalidArgumentException('The given parameter $like is invalid.'); } @@ -550,7 +550,7 @@ class ReactionHandler extends SingletonFactory { * @param Like $like * @return array */ - private function revertLikeObject(LikeObject $likeObject, Like $like): array { + private function revertLikeObject(LikeObject $likeObject, Like $like) { if (!$likeObject->likeObjectID) { throw new \InvalidArgumentException('The given parameter $likeObject is invalid.'); } diff --git a/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php index d71a22f61e..7e9c0f2311 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/TReactionUserNotificationEvent.class.php @@ -29,7 +29,7 @@ trait TReactionUserNotificationEvent { * * @return int[] */ - protected final function getReactionsForAuthors(): array { + protected final function getReactionsForAuthors() { if ($this->cachedReactions !== null) { return $this->cachedReactions; } -- 2.20.1