<?php
/*
 * Software Name: Eorisis Setup
 * Software URI: https://eorisis.com/shop/software/joomla/setup
 * Author: Eorisis
 * Author URI: https://eorisis.com
 * Copyright: Copyright (C) 2011-2025 EORISIS. All Rights Reserved.
 * License: GNU General Public License version 2; See https://eorisis.com/gpl
 * Terms of Service: https://eorisis.com/tos
 */
namespace eorisis_setup\framework\install\lib\core\model;
\defined('_JEXEC') or die;
\defined('EORISIS_MBSTRING') or \define('EORISIS_MBSTRING', \extension_loaded('mbstring'));

class convert
{
	public function __construct() {}

	// --------------------------------------------------

	public static function to_lowercase($string, bool $advanced = false, bool $utf8 = true) : string
	{
		if (!$utf8 or !EORISIS_MBSTRING)
		{
			return \strtolower($string);
		}

		if (!$advanced)
		{
			return \mb_strtolower($string, 'UTF-8');
		}

		return \mb_convert_case($string, MB_CASE_LOWER, 'UTF-8');
	}

	// --------------------------------------------------

	public static function to_camelcase_first($string, bool $to_lowercase = true) : string
	{
		if ($to_lowercase)
		{
			$string = self::to_lowercase($string);
		}

		return \ucfirst($string);
	}
}
