diff --git a/core/modules/comment/lib/Drupal/comment/CommentRequestController.php b/core/modules/comment/lib/Drupal/comment/CommentRequestController.php index 157b0b0..6db83f7 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentRequestController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentRequestController.php @@ -21,33 +21,25 @@ class CommentRequestController implements ControllerInterface { /** - * @var Symfony\Component\HttpFoundation\Request - */ - protected $request; - - /** * @var Symfony\Component\HttpKernel\HttpKernelInterface */ - protected $http_kernal; + protected $httpKernel; /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static($container->get('request'), $container->get('http_kernal')); + return new static($container->get('http_kernel')); } /** * Contructs a new CommentController instance * - * @param Symfony\Component\HttpFoundation\Request $request - * The active request object - * @param Symfony\Component\HttpKernel\HttpKernelInterface $http_kernal - * HTTP kernal to hondle requests + * @param Symfony\Component\HttpKernel\HttpKernelInterface $httpKernel + * HTTP kernel to handle requests. */ - public function __construct(Request $request, HttpKernelInterface $http_kernal) { - $this->request = $request; - $this->http_kernal = $http_kernal; + public function __construct(HttpKernelInterface $httpKernel) { + $this->httpKernel = $httpKernel; } /** @@ -67,7 +59,7 @@ public function __construct(Request $request, HttpKernelInterface $http_kernal) * @return Symfony\Component\HttpFoundation\Response * The comment listing set to the page on which the comment appears. */ - public function commentPermalink(Comment $comment) { + public function commentPermalink(Request $request, Comment $comment) { if ($node = $comment->nid->entity) { // Check access permissions for the node entity. if (!entity_page_access($node, 'view')) { @@ -76,11 +68,11 @@ public function commentPermalink(Comment $comment) { // Find the current display page for this comment. $page = comment_get_display_page($comment->id(), $node->type); // @todo: Cleaner sub request handling. - $redirect_request = Request::create('/node/' . $node->nid, 'GET', $this->request->query->all(), $this->request->cookies->all(), array(), $this->request->server->all()); + $redirect_request = Request::create('/node/' . $node->nid, 'GET', $request->query->all(), $request->cookies->all(), array(), $request->server->all()); $redirect_request->query->set('page', $page); // @todo: Convert the pager to use the request object. $_GET['page'] = $page; - return $this->http_kernal->handle($redirect_request, HttpKernelInterface::SUB_REQUEST); + return $this->httpKernel->handle($redirect_request, HttpKernelInterface::SUB_REQUEST); } throw new NotFoundHttpException(); }