1 | <?php |
||
8 | class Text |
||
9 | { |
||
10 | const TEXT_NOT_CH = '/[^A-Za-z0-9 .,:\'\/()?+\-!"#%&*;<>÷=@_$£[\]{}\` ́~àáâäçèéêëìíîïñòóôöùúûüýßÀÁÂÄÇÈÉÊËÌÍÎÏÒÓÔÖÙÚÛÜÑ]+/u'; |
||
11 | const TEXT_NOT_SWIFT = '/[^A-Za-z0-9 .,:\'\/()?+\-]+/'; |
||
12 | |||
13 | /** |
||
14 | * Sanitizes and trims a string to conform to the Swiss character |
||
15 | * set. |
||
16 | * |
||
17 | * @param string|null $input |
||
18 | * @param int $maxLength |
||
19 | * |
||
20 | * @return string The sanitized string |
||
21 | */ |
||
22 | 6 | public static function sanitize($input, $maxLength) |
|
29 | |||
30 | /** |
||
31 | * Sanitizes and trims a string to conform to the Swiss character |
||
32 | * set. |
||
33 | * |
||
34 | * @param string|null $input |
||
35 | * @param int $maxLength |
||
36 | * |
||
37 | * @return string|null The sanitized string or null if it is empty. |
||
38 | */ |
||
39 | 1 | public static function sanitizeOptional($input, $maxLength) |
|
45 | |||
46 | /** |
||
47 | * @internal |
||
48 | */ |
||
49 | 1 | public static function sanitizeCountryCode($input) |
|
53 | |||
54 | /** |
||
55 | * @internal |
||
56 | */ |
||
57 | 3 | public static function assertOptional($input, $maxLength) |
|
65 | |||
66 | /** |
||
67 | * @internal |
||
68 | */ |
||
69 | 7 | public static function assert($input, $maxLength) |
|
73 | |||
74 | /** |
||
75 | * @internal |
||
76 | */ |
||
77 | 6 | public static function assertIdentifier($input) |
|
86 | |||
87 | /** |
||
88 | * @internal |
||
89 | */ |
||
90 | 3 | public static function assertCountryCode($input) |
|
98 | |||
99 | 10 | protected static function assertNotPattern($input, $maxLength, $pattern) |
|
111 | |||
112 | /** |
||
113 | * @internal |
||
114 | */ |
||
115 | 3 | public static function xml(DOMDocument $doc, $tag, $content) |
|
122 | } |
||
123 |