From: Matthias Schmidt Date: Tue, 10 May 2016 18:46:25 +0000 (+0200) Subject: Add @method documentation for IObjectTypeProvider implementations X-Git-Tag: 3.0.0_Beta_1~1745 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7cb93482d2ed144f3f102deca1f8154bb8cae409;p=GitHub%2FWoltLab%2FWCF.git Add @method documentation for IObjectTypeProvider implementations --- diff --git a/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php b/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php index 000b678be0..1a881351ed 100644 --- a/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php +++ b/wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php @@ -10,30 +10,33 @@ use wcf\system\like\IViewableLikeProvider; * Object type provider for comments * * @author Alexander Ebert - * @copyright 2001-2015 WoltLab GmbH + * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage data.comment * @category Community Framework + * + * @method LikeableComment getObjectByID($objectID) + * @method LikeableComment[] getObjectsByIDs(array $objectIDs) */ class LikeableCommentProvider extends AbstractObjectTypeProvider implements ILikeObjectTypeProvider, IViewableLikeProvider { /** - * @see \wcf\data\object\type\AbstractObjectTypeProvider::$className + * @inheritDoc */ - public $className = 'wcf\data\comment\Comment'; + public $className = Comment::class; /** - * @see \wcf\data\object\type\AbstractObjectTypeProvider::$decoratorClassName + * @inheritDoc */ - public $decoratorClassName = 'wcf\data\comment\LikeableComment'; + public $decoratorClassName = LikeableComment::class; /** - * @see \wcf\data\object\type\AbstractObjectTypeProvider::$listClassName + * @inheritDoc */ - public $listClassName = 'wcf\data\comment\CommentList'; + public $listClassName = CommentList::class; /** - * @see \wcf\data\like\ILikeObjectTypeProvider::checkPermissions() + * @inheritDoc */ public function checkPermissions(ILikeObject $comment) { if (!$comment->commentID) return false; @@ -43,10 +46,10 @@ class LikeableCommentProvider extends AbstractObjectTypeProvider implements ILik } /** - * @see \wcf\system\like\IViewableLikeProvider::prepare() + * @inheritDoc */ public function prepare(array $likes) { - $commentIDs = array(); + $commentIDs = []; foreach ($likes as $like) { $commentIDs[] = $like->objectID; } @@ -58,11 +61,11 @@ class LikeableCommentProvider extends AbstractObjectTypeProvider implements ILik $comments = $commentList->getObjects(); // group likes by object type id - $likeData = array(); + $likeData = []; foreach ($likes as $like) { if (isset($comments[$like->objectID])) { if (!isset($likeData[$comments[$like->objectID]->objectTypeID])) { - $likeData[$comments[$like->objectID]->objectTypeID] = array(); + $likeData[$comments[$like->objectID]->objectTypeID] = []; } $likeData[$comments[$like->objectID]->objectTypeID][] = $like; } 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 df2bfec7ec..93b687bcd5 100644 --- a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php @@ -13,30 +13,33 @@ use wcf\system\WCF; * Object type provider for likeable comment responses. * * @author Matthias Schmidt - * @copyright 2001-2015 WoltLab GmbH + * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage data.comment.response * @category Community Framework + * + * @method LikeableCommentResponse getObjectByID($objectID) + * @method LikeableCommentResponse[] getObjectsByIDs(array $objectIDs) */ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider implements ILikeObjectTypeProvider, IViewableLikeProvider { /** - * @see \wcf\data\object\type\AbstractObjectTypeProvider::$className + * @inheritDoc */ - public $className = 'wcf\data\comment\response\CommentResponse'; + public $className = CommentResponse::class; /** - * @see \wcf\data\object\type\AbstractObjectTypeProvider::$decoratorClassName + * @inheritDoc */ - public $decoratorClassName = 'wcf\data\comment\response\LikeableCommentResponse'; + public $decoratorClassName = LikeableCommentResponse::class; /** - * @see \wcf\data\object\type\AbstractObjectTypeProvider::$listClassName + * @inheritDoc */ - public $listClassName = 'wcf\data\comment\response\CommentResponseList'; + public $listClassName = CommentResponseList::class; /** - * @see \wcf\data\like\ILikeObjectTypeProvider::checkPermissions() + * @inheritDoc */ public function checkPermissions(ILikeObject $response) { if (!$response->responseID) return false; @@ -50,18 +53,18 @@ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider impleme } /** - * @see \wcf\system\like\IViewableLikeProvider::prepare() + * @inheritDoc */ public function prepare(array $likes) { - $responseIDs = array(); + $responseIDs = []; foreach ($likes as $like) { $responseIDs[] = $like->objectID; } // get objects type ids - $responses = array(); + $responses = []; $conditionBuilder = new PreparedStatementConditionBuilder(); - $conditionBuilder->add('comment_response.responseID IN (?)', array($responseIDs)); + $conditionBuilder->add('comment_response.responseID IN (?)', [$responseIDs]); $sql = "SELECT comment.objectTypeID, comment_response.responseID FROM wcf".WCF_N."_comment_response comment_response LEFT JOIN wcf".WCF_N."_comment comment @@ -74,11 +77,11 @@ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider impleme } // group likes by object type id - $likeData = array(); + $likeData = []; foreach ($likes as $like) { if (isset($responses[$like->objectID])) { if (!isset($likeData[$responses[$like->objectID]])) { - $likeData[$responses[$like->objectID]] = array(); + $likeData[$responses[$like->objectID]] = []; } $likeData[$responses[$like->objectID]][] = $like; }