Apply PSR-12 code style (#3886)
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / moderation / queue / report / CommentResponseModerationQueueReportHandler.class.php
1 <?php
2
3 namespace wcf\system\moderation\queue\report;
4
5 use wcf\data\moderation\queue\ViewableModerationQueue;
6 use wcf\system\moderation\queue\AbstractCommentResponseModerationQueueHandler;
7
8 /**
9 * An implementation of IModerationQueueReportHandler for comment responses.
10 *
11 * @author Alexander Ebert
12 * @copyright 2001-2019 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\Moderation\Queue
15 */
16 class CommentResponseModerationQueueReportHandler extends AbstractCommentResponseModerationQueueHandler implements
17 IModerationQueueReportHandler
18 {
19 /**
20 * @inheritDoc
21 */
22 public function canReport($objectID)
23 {
24 if (!$this->isValid($objectID)) {
25 return false;
26 }
27
28 $response = $this->getResponse($objectID);
29 $comment = $this->getComment($response->commentID);
30 if (!$this->getCommentManager($comment)->isAccessible($comment->objectID)) {
31 return false;
32 }
33
34 return true;
35 }
36
37 /**
38 * @inheritDoc
39 */
40 public function getReportedContent(ViewableModerationQueue $queue)
41 {
42 return $this->getRelatedContent($queue);
43 }
44
45 /**
46 * @inheritDoc
47 */
48 public function getReportedObject($objectID)
49 {
50 return $this->getResponse($objectID);
51 }
52 }