@param Comment $comment

@throws \Exception

@return \Illuminate\Http\RedirectResponse
557968
public function remove(Comment $comment)
    {
        $comment->delete();

        Alert::info(__('Comment was removed'));

        return redirect()->route('platform.systems.comments');
    }
359496
public function dispatchCommentDeleteEvent(Post $post, Comment $comment)
    {
        $event = new LogCommentDeleteEvent($post, $comment);

        return $this->dispatch($event);
    }
1374612
protected function outputComment($comment)
	{
		if ($this->commentOptions instanceof \Closure) {
			$options = call_user_func($this->commentOptions, $comment);
		} else {
			$options = $this->commentOptions;
		}
		$options = ArrayHelper::merge($options, ['data-comment-id'=>$comment->id]);
		if ($this->useBootstrapClasses) Html::addCssClass($options, 'media');

		//render comment
		echo Html::beginTag('div', $options);

			//body
			$wrapperOptions = ['class'=>'comment-wrapper'];
			if ($this->useBootstrapClasses) Html::addCssClass($wrapperOptions, 'media-body');
			echo Html::beginTag('div', $wrapperOptions);

				//title
				if (!empty($comment->title)) {
					$titleOptions = ['class'=>'comment-title'];
					if ($this->useBootstrapClasses) Html::addCssClass($titleOptions, 'media-heading');
					$title = $this->encodeCommentTitle ? Html::encode($comment->title) : $comment->title;
					echo Html::tag($this->commentTitleTag, $title, $titleOptions);
				}

				//content
				$content = $this->encodeCommentContents ? Html::encode($comment->content) : $comment->content;
				echo Html::tag('div', $content, ['class'=>'comment-content']);

				//meta
				echo Html::beginTag('dl', ['class'=>'comment-meta']);
				echo Html::tag('dt', Yii::t('app', 'Created'));
				echo Html::tag('dd', Yii::$app->formatter->asDatetime($comment->created));
				if (!empty($comment->updated) && $comment->updated != $comment->created) {
					echo Html::tag('dt', Yii::t('app', 'Updated'));
					echo Html::tag('dd', Yii::$app->formatter->asDatetime($comment->updated));
				}
				if (!empty($comment->user_id)) {
					$author = $this->authorCallback === null ? $comment->created_by : call_user_func($this->authorCallback, $comment->created_by);
					echo Html::tag('dt', Yii::t('app', 'Author'));
					echo Html::tag('dd', $author);
				}
				echo Html::endTag('dl');

			echo Html::endTag('div');
		echo Html::endTag('div');
	}
1217204
public function ReplyForm($comment)
    {
        // Enables multiple forms with different names to use the same handler
        $form = $this->CommentsForm();
        $form->setName('ReplyForm_' . $comment->ID);
        $form->setHTMLID(null);
        $form->addExtraClass('reply-form');

        // Load parent into reply form
        $form->loadDataFrom([
            'ParentCommentID' => $comment->ID
        ]);

        // Customise action
        $form->setFormAction($this->Link('reply', $comment->ID));

        $this->extend('updateReplyForm', $form);

        return $form;
    }
1279462
public function addComment($comment)
    {
        $comment->setPaymentId($this->getPaymentId());
        $comment->save();

        $this->load($this->getPaymentId());

        return $comment;
    }
824694
public function addCommentAbove($comment) {
    if ($comment instanceof LineCommentBlockNode) {
      $this->before($comment);
    }
    elseif (is_string($comment)) {
      $this->addCommentAbove(LineCommentBlockNode::create($comment));
    }
    else {
      throw new \InvalidArgumentException();
    }
    return $this;
  }
251162
public function edit(Comment $comment)
    {
        $this->authorize($comment);

        pageinfo([
            'title' => __('comments.edit_page'),
            'robots' => 'noindex,follow',
        ]);

        return $this->makeResponse('edit', compact('comment'));
    }
63739
public function dispatchCommentCreateEvent(Post $post, Comment $comment)
    {
        $event = new LogCommentCreateEvent($post, $comment, $this->translator);

        return $this->dispatch($event);
    }
1074698
public function comment( $comment = '#' )
    {
        foreach( $this->lines as &$line ) {
            $line = $comment . $line;
        }
        return $this;
    }
355733
public function addComment(\Innova\CollecticielBundle\Entity\Comment $comments)
    {
        $this->comments[] = $comments;

        return $this;
    }
185398
private function renderChangedCommentState($comment)
    {
        $referer = $this->request->getHeader('Referer');

        // Render comment using AJAX
        if ($this->request->isAjax()) {
            return $comment->renderWith('Includes/CommentsInterface_singlecomment');
        }

        // Redirect to either the comment or start of the page
        if (empty($referer)) {
            return $this->redirectBack();
        }

        // Redirect to the comment, but check for phishing
        $url = $referer . '#comment-' . $comment->ID;
        // absolute redirection URLs not located on this site may cause phishing
        if (Director::is_site_url($url)) {
            return $this->redirect($url);
        }

        return false;
    }
1181151
public function fromComment($comment, $context = null)
    {
        if ($context === null) {
            $context = new Context(['comment' => $comment]);
        } else {
            $context->comment = $comment;
        }
        try {
            self::$context = $context;
            if ($context->is('annotations') === false) {
                $context->annotations = [];
            }
            $comment = preg_replace_callback(
                '/^[\t ]*\*[\t ]+/m',
                function ($match) {
                    // Replace leading tabs with spaces.
                    // Workaround for http://www.doctrine-project.org/jira/browse/DCOM-255
                    return str_replace("\t", ' ', $match[0]);
                },
                $comment
            );
            $annotations = $this->docParser->parse($comment, $context);
            self::$context = null;
            return $annotations;
        } catch (Exception $e) {
            self::$context = null;
            if (preg_match('/^(.+) at position ([0-9]+) in ' . preg_quote((string)$context, '/') . '\.$/', $e->getMessage(), $matches)) {
                $errorMessage = $matches[1];
                $errorPos = (int)$matches[2];
                $atPos = strpos($comment, '@');
                $context->line += substr_count($comment, "\n", 0, $atPos + $errorPos);
                $lines = explode("\n", substr($comment, $atPos, $errorPos));
                $context->character = strlen(array_pop($lines)) + 1; // position starts at 0 character starts at 1
                Logger::warning(new Exception($errorMessage . ' in ' . $context, $e->getCode(), $e));
            } else {
                Logger::warning($e);
            }
            return [];
        }
    }
117007
public function update(Request $request, Comment $comment)
    {
        $attributes = $request->validate([
            'text' => 'required'
        ]);

        tap($comment)
            ->update($attributes)
            ->clearMentions()
            ->mention($request->mentions);

        return back();
    }
121636
public function setComment($comment)
    {
        if ( ! is_string($comment))
        {
            throw new InvalidArgumentException(
                'Expected a string, but got '.gettype($comment)
            );
        }

        $this->comment = $comment;
    }
718565
public function sendCommentSpamRequestMail( $comment, $updatePath ) {

		$siteName		= $this->coreProperties->getSiteName();
		$fromEmail		= $this->mailProperties->getSenderEmail();
		$fromName		= $this->mailProperties->getSenderName();
		$contactEmail	= $this->mailProperties->getContactEmail();

		// Send Mail
		$this->getMailer()->compose( self::MAIL_COMMENT_SPAM_REQUEST, [ 'coreProperties' => $this->coreProperties, 'comment' => $comment, 'updatePath' => $updatePath ] )
			->setTo( $contactEmail )
			->setFrom( [ $fromEmail => "$fromName | $siteName" ] )
			->setSubject( "Spam Request | " . $this->coreProperties->getSiteName() )
			//->setTextBody( "heroor" )
			->send();
	}
249515
public function reply(Request $request, Comment $comment)
    {
        $this->authorize('reply-to-comment', $comment);

        $this->validate($request, [
            'message' => 'required|string'
        ]);

        $reply = new Comment;
        $reply->commenter()->associate(auth()->user());
        $reply->commentable()->associate($comment->commentable);
        $reply->parent()->associate($comment);
        $reply->comment = $request->message;
        $reply->save();

        return redirect()->to(url()->previous() . '#comment-' . $reply->id);
    }
177962
public function removeComment(\Haven\CmsBundle\Entity\Comment $comment)
    {
        $this->comments->removeElement($comment);
    }