diff --git a/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php index 4e230f4..d6143be 100644 --- a/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php +++ b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php @@ -92,7 +92,6 @@ public function onException(GetResponseForExceptionEvent $event) { $handled_formats = $this->getHandledFormats(); $format = $request->query->get(MainContentViewSubscriber::WRAPPER_ENVELOPE) ?: $request->getRequestFormat(); - debug($format); if ($exception instanceof HttpExceptionInterface && (empty($handled_formats) || in_array($format, $handled_formats))) { $method = 'on' . $exception->getStatusCode(); diff --git a/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php index cbdce65..625d2a6 100644 --- a/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php @@ -85,9 +85,9 @@ public function onViewRenderArray(GetResponseForControllerResultEvent $event) { // Render the controller result into a response if it's a render array. if (is_array($result)) { - // We default to getRequestFormat() because content negotiation uses this as - // its fallback method for displaying a 406 when we fail to match a route - // based on format. + // We default to getRequestFormat() because content negotiation uses this + // as its fallback method for displaying a 406 when we fail to match a + // route based on format. // @todo this logic should be replaced with a more clear opt in to avoid // cache poisoning. https://www.drupal.org/node/2364011 $wrapper = $request->query->get(static::WRAPPER_ENVELOPE, $request->getRequestFormat()); diff --git a/core/lib/Drupal/Core/Routing/RequestFormatMatcher.php b/core/lib/Drupal/Core/Routing/RequestFormatMatcher.php index d27fc62..a29deb7 100644 --- a/core/lib/Drupal/Core/Routing/RequestFormatMatcher.php +++ b/core/lib/Drupal/Core/Routing/RequestFormatMatcher.php @@ -27,7 +27,7 @@ public function filter(RouteCollection $collection, Request $request) { if ($format = $request->getRequestFormat('html')) { foreach ($collection as $name => $route) { // If its not a match, we move the route to the end, so we effectively - // Move the matching route to the front. + // move the matching route to the front. $supported_formats = array_filter(explode('|', $route->getRequirement('_format'))); if (!in_array($format, $supported_formats)) { $collection->add($name, $route); diff --git a/core/modules/page_cache/src/Tests/PageCacheTest.php b/core/modules/page_cache/src/Tests/PageCacheTest.php index bebcbab..6e55e12 100644 --- a/core/modules/page_cache/src/Tests/PageCacheTest.php +++ b/core/modules/page_cache/src/Tests/PageCacheTest.php @@ -79,7 +79,8 @@ function testPageCacheTags() { } /** - * Tests support for different cache items with different request formats specified via a query parameter. + * Tests support for different cache items with different request formats + * specified via a query parameter. */ function testQueryParameterFormatRequests() { $config = $this->config('system.performance'); diff --git a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php b/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php index 8eb8ecb..71cbc30 100644 --- a/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php +++ b/core/modules/system/src/Tests/Routing/ContentNegotiationRoutingTest.php @@ -68,25 +68,25 @@ function testContentRouting() { // No extension. Constant Content-type. ['conneg/html', '', 'text/html', FALSE], ['conneg/html', '*/*', 'text/html', FALSE], - // @TODO We have to turn of full content negotiation to support this. + // @todo We have to turn of full content negotiation to support this. ['conneg/html', 'application/xml', 'text/html', FALSE], ['conneg/html', 'text/xml', 'text/html', FALSE], ['conneg/html', 'text/html', 'text/html', FALSE], // Dynamic extension. Linked Content-type. - // @TODO We have to turn of full content negotiation to support this. + // @todo We have to turn of full content negotiation to support this. ['conneg/html?_format=json', '', 'application/json', FALSE], ['conneg/html?_format=json', '*/*', 'application/json', FALSE], ['conneg/html?_format=json', 'application/xml', 'application/json', FALSE], ['conneg/html?_format=json', 'application/json', 'application/json', FALSE], - // @TODO We have to turn of full content negotiation to support this. + // @todo We have to turn of full content negotiation to support this. ['conneg/html?_format=xml', '', 'application/xml', FALSE], ['conneg/html?_format=xml', '*/*', 'application/xml', FALSE], ['conneg/html?_format=xml', 'application/json', 'application/xml', FALSE], ['conneg/html?_format=xml', 'application/xml', 'application/xml', FALSE], - // @TODO a Drupal vendor protocol? + // @todo a Drupal vendor protocol? // Path with a variable. Variable contains a period. - // @TODO We have to turn of full content negotiation to support these. + // @todo We have to turn of full content negotiation to support these. ['conneg/plugin/plugin.id', '', 'text/html', FALSE], ['conneg/plugin/plugin.id', '*/*', 'text/html', FALSE], ['conneg/plugin/plugin.id', 'text/xml', 'text/html', FALSE], @@ -106,7 +106,7 @@ function testContentRouting() { // ['alias.json', 'application/json', 'application/json', FALSE], // Alias with extension pointing to dynamic extension/linked content-type. - // @TODO how to test aliasing? Can we just assume aliasing does its thing? + // @todo how to test aliasing? Can we just assume aliasing does its thing? // this might not even work :( ]; @@ -120,8 +120,9 @@ function testContentRouting() { /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */ $kernel = \Drupal::getContainer()->get('http_kernel'); $response = $kernel->handle($request); - - $this->assertTrue(TRUE, $message); // verbose message since simpletest doesn't let us provide a message and see the error. + // Verbose message since simpletest doesn't let us provide a message and + // see the error. + $this->assertTrue(TRUE, $message); $this->assertEqual($response->getStatusCode(), Response::HTTP_OK); $this->assertTrue(strpos($response->headers->get('Content-type'), $test[2]) !== FALSE); @@ -156,8 +157,9 @@ public function ptestFullNegotiation() { /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $kernel */ $kernel = \Drupal::getContainer()->get('http_kernel'); $response = $kernel->handle($request); - - $this->assertTrue(TRUE, $message); // verbose message since simpletest doesn't let us provide a message and see the error. + // Verbose message since simpletest doesn't let us provide a message and + // see the error. + $this->assertTrue(TRUE, $message); $this->assertEqual($response->getStatusCode(), Response::HTTP_OK); $this->assertEqual($response->headers->get('Content-type'), $test[2]); $this->assertEqual($response->headers->get('Cache-Control'), 'public'); @@ -177,7 +179,8 @@ public function ptestContentRouting400() { 'text/html', Response::HTTP_NOT_ACCEPTABLE ], - // TODO negotiate a content type no support by the path but supported by error handler. + // @todo negotiate a content type no support by the path but supported by + // error handler. ['conneg/html.dne', 'vnd/dne', 'text/html', Response::HTTP_NOT_FOUND], ]; @@ -191,7 +194,9 @@ public function ptestContentRouting400() { $kernel = \Drupal::getContainer()->get('http_kernel'); $response = $kernel->handle($request); - $this->assertTrue(TRUE, $message); // verbose message since simpletest doesn't let us provide a message and see the error. + // Verbose message since simpletest doesn't let us provide a message and + // see the error. + $this->assertTrue(TRUE, $message); $this->assertEqual($response->getStatusCode(), $test[3]); $this->assertEqual($response->headers->get('Content-type'), $test[2]); } diff --git a/core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php b/core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php index ad5adc3..e7da745 100644 --- a/core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php +++ b/core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php @@ -121,7 +121,7 @@ public function dialog() { '#url' => Url::fromRoute('ajax_test.dialog_contents'), '#attributes' => array( 'class' => array('use-ajax'), - 'data-accepts' => 'application/vnd.drupal-modal', // TODO replace this. + 'data-accepts' => 'application/vnd.drupal-modal', // @todo replace this. ), );