CoreFiles by mySites.guru
JsonRenderer.php45 lines, 941 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
fc2aba0642c7b0cd92b6b23008140857
sha1
2fb5dc81f4564cc669a7eb2343c22348e022a1ab
sha256
3b68fcb2b88421a75c2126dd4564ec22d9ce633b5fdcd8497a971f7fb84ae51c
<?php
/**
 * @package     Joomla.Installation
 * @subpackage  Error
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @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 JsonRenderer extends AbstractRenderer
{
	/**
	 * The format (type) of the error page
	 *
	 * @var    string
	 * @since  4.0
	 */
	protected $type = 'json';

	/**
	 * Render the error page for the given object
	 *
	 * @param   \Throwable  $error  The error object to be rendered
	 *
	 * @return  string
	 *
	 * @since   4.0
	 */
	public function render(\Throwable $error): string
	{
		return json_encode(new JsonResponse($error));
	}
}

The same content is in 6 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha12. See them all, or every version of this file.