core/lib/Drupal/Core/Controller/HtmlControllerBase.php | 4 ++-- .../tests/modules/system_test/src/Controller/SystemTestController.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/lib/Drupal/Core/Controller/HtmlControllerBase.php b/core/lib/Drupal/Core/Controller/HtmlControllerBase.php index 3bc6957..7c84167 100644 --- a/core/lib/Drupal/Core/Controller/HtmlControllerBase.php +++ b/core/lib/Drupal/Core/Controller/HtmlControllerBase.php @@ -49,7 +49,7 @@ public function __construct(TitleResolverInterface $title_resolver, RenderHtmlRe /** * Converts a render array into an HtmlFragment object. * - * @param array|\Drupal\Core\Page\HtmlFragment $page_content + * @param array|\Drupal\Core\Page\HtmlFragment|\Symfony\Component\HttpFoundation\Response $page_content * The page content area to display. * @param \Symfony\Component\HttpFoundation\Request $request * The request object. @@ -66,7 +66,7 @@ protected function createHtmlFragment($page_content, Request $request) { } if (is_string($page_content)) { - throw new \LogicException('_content controllers may not return strings.'); + throw new \InvalidArgumentException('_content controllers may not return strings.'); } $fragment = $this->renderHtmlRenderer->render($page_content); diff --git a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php index 9906b10..d79e3f6 100644 --- a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php +++ b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php @@ -154,8 +154,9 @@ public function shutdownFunctions($arg1, $arg2) { // @see _drupal_shutdown_function() // @see \Drupal\system\Tests\System\ShutdownFunctionsTest if (function_exists('fastcgi_finish_request')) { - return 'The function fastcgi_finish_request exists when serving the request.'; + return ['#markup' => 'The function fastcgi_finish_request exists when serving the request.']; } + return []; } /**