CoreFiles by mySites.guru
Configuration.php44 lines, 861 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
f6be44ea09dabcaa2fdf40bcf0304f5a
sha1
467a38d2d9d5ea7e1f926ed65a40817539bfdcc1
sha256
8d57acbaa2f23b3def1dffa645e24a7ece2e7077c172b02ae26e87152ad18ae3
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_admin
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Admin\Administrator\Service\HTML;

\defined('_JEXEC') or die;

/**
 * Class for rendering configuration values
 *
 * @since  4.0.0
 */
class Configuration
{
	/**
	 * Method to generate a string for a value
	 *
	 * @param   mixed  $value  The configuration value
	 *
	 * @return  string  Formatted and escaped string
	 *
	 * @since  4.0.0
	 */
	public function value($value): string
	{
		if (\is_bool($value))
		{
			return $value ? 'true' : 'false';
		}

		if (\is_array($value))
		{
			$value = implode(', ', $value);
		}

		return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
	}
}

No other release has this exact content. See every version of this file.