From 99c65fe8a159a9ca19f41944aa834c7a43bd73c5 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Mon, 4 Sep 2017 15:43:01 +0200 Subject: [PATCH] Namespace error renderer --- .../json.php => src/Error/Renderer/JsonRenderer.php} | 11 +++++++---- installation/src/Service/Provider/Application.php | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) rename installation/{error/json.php => src/Error/Renderer/JsonRenderer.php} (67%) diff --git a/installation/error/json.php b/installation/src/Error/Renderer/JsonRenderer.php similarity index 67% rename from installation/error/json.php rename to installation/src/Error/Renderer/JsonRenderer.php index 596801d99d248..1288fef8562e9 100644 --- a/installation/error/json.php +++ b/installation/src/Error/Renderer/JsonRenderer.php @@ -7,16 +7,19 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ +namespace Joomla\CMS\Installation\Error\Renderer; + defined('_JEXEC') or die; use Joomla\CMS\Error\AbstractRenderer; +use Joomla\CMS\Installation\Response\JsonResponse; /** * JSON error page renderer for the installation application * * @since 4.0 */ -class InstallationErrorJson extends AbstractRenderer +class JsonRenderer extends AbstractRenderer { /** * The format (type) of the error page @@ -29,14 +32,14 @@ class InstallationErrorJson extends AbstractRenderer /** * Render the error page for the given object * - * @param Throwable $error The error object to be rendered + * @param \Throwable $error The error object to be rendered * * @return string * * @since 4.0 */ - public function render(Throwable $error): string + public function render(\Throwable $error): string { - return json_encode(new InstallationResponseJson($error)); + return json_encode(new JsonResponse($error)); } } diff --git a/installation/src/Service/Provider/Application.php b/installation/src/Service/Provider/Application.php index 42d2e39b6175c..341f8d9bfa8f2 100644 --- a/installation/src/Service/Provider/Application.php +++ b/installation/src/Service/Provider/Application.php @@ -62,7 +62,7 @@ function (Container $container) JsonRenderer::class, function (Container $container) { - return new \InstallationErrorJson; + return new \Joomla\CMS\Installation\Error\Renderer\JsonRenderer; } ); }