Skip to content

Commit

Permalink
Remove element traits
Browse files Browse the repository at this point in the history
Rename Lang to Language to match the xs:language type
  • Loading branch information
tvdijen committed Jan 16, 2025
1 parent a73db7e commit f37d864
Show file tree
Hide file tree
Showing 33 changed files with 195 additions and 1,517 deletions.
8 changes: 4 additions & 4 deletions src/Assert/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @method static void validIDRefs(mixed $value, string $message = '', string $exception = '')
* @method static void validInt(mixed $value, string $message = '', string $exception = '')
* @method static void validInteger(mixed $value, string $message = '', string $exception = '')
* @method static void validLang(mixed $value, string $message = '', string $exception = '')
* @method static void validLanguage(mixed $value, string $message = '', string $exception = '')
* @method static void validLong(mixed $value, string $message = '', string $exception = '')
* @method static void validMonth(mixed $value, string $message = '', string $exception = '')
* @method static void validName(mixed $value, string $message = '', string $exception = '')
Expand Down Expand Up @@ -70,7 +70,7 @@
* @method static void nullOrValidIDRefs(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidInt(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidInteger(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidLang(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidLanguage(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidLong(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidMonth(mixed $value, string $message = '', string $exception = '')
* @method static void nullOrValidName(mixed $value, string $message = '', string $exception = '')
Expand Down Expand Up @@ -112,7 +112,7 @@
* @method static void allValidIDRefs(mixed $value, string $message = '', string $exception = '')
* @method static void allValidInt(mixed $value, string $message = '', string $exception = '')
* @method static void allValidInteger(mixed $value, string $message = '', string $exception = '')
* @method static void allValidLang(mixed $value, string $message = '', string $exception = '')
* @method static void allValidLanguage(mixed $value, string $message = '', string $exception = '')
* @method static void allValidLong(mixed $value, string $message = '', string $exception = '')
* @method static void allValidMonth(mixed $value, string $message = '', string $exception = '')
* @method static void allValidName(mixed $value, string $message = '', string $exception = '')
Expand Down Expand Up @@ -157,7 +157,7 @@ class Assert extends BaseAssert
use IDRefsTrait;
use IntTrait;
use IntegerTrait;
use LangTrait;
use LanguageTrait;
use LongTrait;
use MonthTrait;
use NameTrait;
Expand Down
8 changes: 4 additions & 4 deletions src/Assert/LangTrait.php → src/Assert/LanguageTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
/**
* @package simplesamlphp/xml-common
*/
trait LangTrait
trait LanguageTrait
{
/** @var string */
private static string $lang_regex = '/^([a-z]{2}|[i]-[a-z]+|[x]-[a-z]{1,8})(-[a-z]{1,8})*$/Di';
private static string $language_regex = '/^([a-z]{2}|[i]-[a-z]+|[x]-[a-z]{1,8})(-[a-z]{1,8})*$/Di';


/**
* @param string $value
* @param string $message
*/
protected static function validLang(string $value, string $message = ''): void
protected static function validLanguage(string $value, string $message = ''): void
{
Assert::regex(
$value,
self::$lang_regex,
self::$language_regex,
$message ?: '%s is not a valid xs:language',
InvalidArgumentException::class,
);
Expand Down
64 changes: 0 additions & 64 deletions src/Base64ElementTrait.php

This file was deleted.

68 changes: 0 additions & 68 deletions src/BooleanElementTrait.php

This file was deleted.

65 changes: 0 additions & 65 deletions src/HexBinaryElementTrait.php

This file was deleted.

35 changes: 0 additions & 35 deletions src/IntegerElementTrait.php

This file was deleted.

101 changes: 0 additions & 101 deletions src/LocalizedStringElementTrait.php

This file was deleted.

Loading

0 comments on commit f37d864

Please sign in to comment.