Skip to content

Commit

Permalink
Namespace error renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Sep 4, 2017
1 parent f83feaf commit 99c65fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Expand Up @@ -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
Expand All @@ -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));
}
}
2 changes: 1 addition & 1 deletion installation/src/Service/Provider/Application.php
Expand Up @@ -62,7 +62,7 @@ function (Container $container)
JsonRenderer::class,
function (Container $container)
{
return new \InstallationErrorJson;
return new \Joomla\CMS\Installation\Error\Renderer\JsonRenderer;
}
);
}
Expand Down

0 comments on commit 99c65fe

Please sign in to comment.