CoreFiles by mySites.guru
Configuration.php45 lines, 1,008 bytes, from Joomla_6.2.1-rc1-Release_Candidate-Full_Package.zip
Raw History Compare with 6.2.0-rc2
md5
49c5e880b888431443d34c59e2e46b66
sha1
a6e9602cc339c008874c6a672937930960205bde
sha256
762320539906590b447ea9e020771eb0d7ce19a165ee00431c709df0e6775f8a
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_admin
 *
 * @copyright   (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

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

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * 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');
    }
}

The same content is in 208 releases, Joomla 4.3.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.