Skip to content

Commit f37d864

Browse files
committed
Remove element traits
Rename Lang to Language to match the xs:language type
1 parent a73db7e commit f37d864

33 files changed

+195
-1517
lines changed

src/Assert/Assert.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* @method static void validIDRefs(mixed $value, string $message = '', string $exception = '')
2929
* @method static void validInt(mixed $value, string $message = '', string $exception = '')
3030
* @method static void validInteger(mixed $value, string $message = '', string $exception = '')
31-
* @method static void validLang(mixed $value, string $message = '', string $exception = '')
31+
* @method static void validLanguage(mixed $value, string $message = '', string $exception = '')
3232
* @method static void validLong(mixed $value, string $message = '', string $exception = '')
3333
* @method static void validMonth(mixed $value, string $message = '', string $exception = '')
3434
* @method static void validName(mixed $value, string $message = '', string $exception = '')
@@ -70,7 +70,7 @@
7070
* @method static void nullOrValidIDRefs(mixed $value, string $message = '', string $exception = '')
7171
* @method static void nullOrValidInt(mixed $value, string $message = '', string $exception = '')
7272
* @method static void nullOrValidInteger(mixed $value, string $message = '', string $exception = '')
73-
* @method static void nullOrValidLang(mixed $value, string $message = '', string $exception = '')
73+
* @method static void nullOrValidLanguage(mixed $value, string $message = '', string $exception = '')
7474
* @method static void nullOrValidLong(mixed $value, string $message = '', string $exception = '')
7575
* @method static void nullOrValidMonth(mixed $value, string $message = '', string $exception = '')
7676
* @method static void nullOrValidName(mixed $value, string $message = '', string $exception = '')
@@ -112,7 +112,7 @@
112112
* @method static void allValidIDRefs(mixed $value, string $message = '', string $exception = '')
113113
* @method static void allValidInt(mixed $value, string $message = '', string $exception = '')
114114
* @method static void allValidInteger(mixed $value, string $message = '', string $exception = '')
115-
* @method static void allValidLang(mixed $value, string $message = '', string $exception = '')
115+
* @method static void allValidLanguage(mixed $value, string $message = '', string $exception = '')
116116
* @method static void allValidLong(mixed $value, string $message = '', string $exception = '')
117117
* @method static void allValidMonth(mixed $value, string $message = '', string $exception = '')
118118
* @method static void allValidName(mixed $value, string $message = '', string $exception = '')
@@ -157,7 +157,7 @@ class Assert extends BaseAssert
157157
use IDRefsTrait;
158158
use IntTrait;
159159
use IntegerTrait;
160-
use LangTrait;
160+
use LanguageTrait;
161161
use LongTrait;
162162
use MonthTrait;
163163
use NameTrait;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
/**
1010
* @package simplesamlphp/xml-common
1111
*/
12-
trait LangTrait
12+
trait LanguageTrait
1313
{
1414
/** @var string */
15-
private static string $lang_regex = '/^([a-z]{2}|[i]-[a-z]+|[x]-[a-z]{1,8})(-[a-z]{1,8})*$/Di';
15+
private static string $language_regex = '/^([a-z]{2}|[i]-[a-z]+|[x]-[a-z]{1,8})(-[a-z]{1,8})*$/Di';
1616

1717

1818
/**
1919
* @param string $value
2020
* @param string $message
2121
*/
22-
protected static function validLang(string $value, string $message = ''): void
22+
protected static function validLanguage(string $value, string $message = ''): void
2323
{
2424
Assert::regex(
2525
$value,
26-
self::$lang_regex,
26+
self::$language_regex,
2727
$message ?: '%s is not a valid xs:language',
2828
InvalidArgumentException::class,
2929
);

src/Base64ElementTrait.php

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/BooleanElementTrait.php

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/HexBinaryElementTrait.php

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/IntegerElementTrait.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/LocalizedStringElementTrait.php

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)