diff --git a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php index 7260018..c5244ac 100644 --- a/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php +++ b/core/modules/comment/lib/Drupal/comment/Controller/CommentController.php @@ -60,7 +60,7 @@ class CommentController extends ControllerBase implements ContainerInjectionInte /** * Constructs a CommentController object. * - * @param \Symfony\Component\HttpKernel\HttpKernelInterface $httpKernel + * @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel * HTTP kernel to handle requests. * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token * The CSRF token manager service. @@ -69,8 +69,8 @@ class CommentController extends ControllerBase implements ContainerInjectionInte * @param \Drupal\comment\CommentManagerInterface $comment_manager * The comment manager service. */ - public function __construct(HttpKernelInterface $httpKernel, CsrfTokenGenerator $csrf_token, FieldInfo $field_info, CommentManagerInterface $comment_manager) { - $this->httpKernel = $httpKernel; + public function __construct(HttpKernelInterface $http_kernel, CsrfTokenGenerator $csrf_token, FieldInfo $field_info, CommentManagerInterface $comment_manager) { + $this->httpKernel = $http_kernel; $this->csrfToken = $csrf_token; $this->fieldInfo = $field_info; $this->commentManager = $comment_manager; @@ -98,6 +98,7 @@ public static function create(ContainerInterface $container) { * * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException * @return \Symfony\Component\HttpFoundation\RedirectResponse. + * Redirects to the permalink URL for this comment. */ public function commentApprove(Request $request, CommentInterface $comment) { // @todo CRSF tokens are validated in the content controller until it gets @@ -190,7 +191,8 @@ public function redirectNode(EntityInterface $node) { * - replies to comments * - replies to entities * - attempts to reply to entities that can no longer accept comments - * - respecting access permissions ('access comments', 'post comments', etc.) + * - respecting access permissions ('access comments', 'post comments', + * etc.) * * @param \Symfony\Component\HttpFoundation\Request $request * The current request object. @@ -204,6 +206,7 @@ public function redirectNode(EntityInterface $node) { * (optional) Some comments are replies to other comments. In those cases, * $pid is the parent comment's comment ID. Defaults to NULL. * + * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException * @return array|\Symfony\Component\HttpFoundation\RedirectResponse * One of the following: * An associative array containing: @@ -257,7 +260,8 @@ public function getReplyForm(Request $request, $entity_type, $entity_id, $field_ } // Load the parent comment. $comment = $this->entityManager()->getStorageController('comment')->load($pid); - // Check if the parent comment is published and belongs to the current nid. + // Check if the parent comment is published and belongs to the current + // nid. if (($comment->status->value == COMMENT_NOT_PUBLISHED) || ($comment->entity_id->value != $entity->id())) { drupal_set_message($this->t('The comment you are replying to does not exist.'), 'error'); return new RedirectResponse($this->urlGenerator()->generateFromPath($uri['path'], array('absolute' => TRUE))); @@ -299,6 +303,8 @@ public function getReplyForm(Request $request, $entity_type, $entity_id, $field_ * @param \Symfony\Component\HttpFoundation\Request $request * The request of the page. * + * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException + * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException * @return \Symfony\Component\HttpFoundation\JsonResponse * The JSON response. */ @@ -321,7 +327,7 @@ public function renderNewCommentsNodeLinks(Request $request) { $new = comment_num_new($node->id(), 'node'); $query = comment_new_page_count($node->{$field_name}->comment_count, $new, $node); $links[$nid] = array( - 'new_comment_count' => (int)$new, + 'new_comment_count' => (int) $new, 'first_new_comment_link' => $this->urlGenerator()->generateFromPath('node/' . $node->id(), array('query' => $query, 'fragment' => 'new')), ); }