mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
update
This commit is contained in:
parent
ebbc08fe9b
commit
27ac3f18a6
|
|
@ -528,5 +528,5 @@ class ISO3166CharEnum extends Enum
|
|||
|
||||
public const _XXX = 'XXX';
|
||||
|
||||
use ISO3166RegionTrait;
|
||||
use ISO3166Trait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -528,5 +528,5 @@ class ISO3166NameEnum extends Enum
|
|||
|
||||
public const _XXX = 'XXX';
|
||||
|
||||
use ISO3166RegionTrait;
|
||||
use ISO3166Trait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -528,5 +528,5 @@ class ISO3166NumEnum extends Enum
|
|||
|
||||
public const _XXX = '000';
|
||||
|
||||
use ISO3166RegionTrait;
|
||||
use ISO3166Trait;
|
||||
}
|
||||
|
|
|
|||
9
Localization/ISO3166RegionTrait.php → Localization/ISO3166Trait.php
Executable file → Normal file
9
Localization/ISO3166RegionTrait.php → Localization/ISO3166Trait.php
Executable file → Normal file
|
|
@ -22,8 +22,15 @@ namespace phpOMS\Localization;
|
|||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
trait ISO3166RegionTrait
|
||||
trait ISO3166Trait
|
||||
{
|
||||
public static function getBy2Code(string $code)
|
||||
{
|
||||
$code3 = ISO3166TwoEnum::getName($code);
|
||||
|
||||
return self::getByName($code3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get countries in a region
|
||||
*
|
||||
|
|
@ -528,5 +528,5 @@ class ISO3166TwoEnum extends Enum
|
|||
|
||||
public const _XXX = 'XX';
|
||||
|
||||
use ISO3166RegionTrait;
|
||||
use ISO3166Trait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -396,5 +396,5 @@ class ISO639Enum extends Enum
|
|||
|
||||
public const _ZU = 'Zulu';
|
||||
|
||||
use ISO639CountryTrait;
|
||||
use ISO639Trait;
|
||||
}
|
||||
|
|
|
|||
9
Localization/ISO639CountryTrait.php → Localization/ISO639Trait.php
Executable file → Normal file
9
Localization/ISO639CountryTrait.php → Localization/ISO639Trait.php
Executable file → Normal file
|
|
@ -22,12 +22,17 @@ namespace phpOMS\Localization;
|
|||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
trait ISO639CountryTrait
|
||||
trait ISO639Trait
|
||||
{
|
||||
public static function getBy2Code(string $code)
|
||||
{
|
||||
return self::getByName('_' . \strtoupper($code));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get language from country.
|
||||
*
|
||||
* @param string $country Country
|
||||
* @param string $country Country 2 code
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
|
|
@ -396,5 +396,5 @@ class ISO639x1Enum extends Enum
|
|||
|
||||
public const _ZH = 'zh';
|
||||
|
||||
use ISO639CountryTrait;
|
||||
use ISO639Trait;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -396,5 +396,5 @@ class ISO639x2Enum extends Enum
|
|||
|
||||
public const _ZU = 'zul';
|
||||
|
||||
use ISO639CountryTrait;
|
||||
use ISO639Trait;
|
||||
}
|
||||
|
|
|
|||
38
Utils/Formatter/HtmlFormatter.php
Normal file
38
Utils/Formatter/HtmlFormatter.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package phpOMS\Utils\Formatter
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace phpOMS\Utils\Formatter;
|
||||
|
||||
/**
|
||||
* Gray encoding class
|
||||
*
|
||||
* @package phpOMS\Utils\Formatter
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class HtmlFormatter
|
||||
{
|
||||
public static function format(string $text) : string
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
|
||||
$dom->loadHTML($text);
|
||||
|
||||
$dom->preserveWhiteSpace = false;
|
||||
$dom->formatOutput = true;
|
||||
|
||||
return $dom->saveXML($dom->documentElement);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user