1 | <?php |
||
8 | class Text |
||
9 | { |
||
10 | const TEXT_NON_CH = '/[^A-Za-z0-9 .,:\'\/()?+\-!"#%&*;<>÷=@_$£[\]{}\` ́~àáâäçèéêëìíîïñòóôöùúûüýßÀÁÂÄÇÈÉÊËÌÍÎÏÒÓÔÖÙÚÛÜÑ]+/u'; |
||
11 | const TEXT_NON_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 | 8 | public static function sanitize($input, $maxLength) |
|
30 | |||
31 | /** |
||
32 | * Sanitizes and trims a string to conform to the Swiss character |
||
33 | * set. |
||
34 | * |
||
35 | * @param string|null $input |
||
36 | * @param int $maxLength |
||
37 | * |
||
38 | * @return string|null The sanitized string or null if it is empty. |
||
39 | */ |
||
40 | 1 | public static function sanitizeOptional($input, $maxLength) |
|
46 | |||
47 | /** |
||
48 | * @internal |
||
49 | */ |
||
50 | 3 | public static function assertOptional($input, $maxLength) |
|
58 | |||
59 | /** |
||
60 | * @internal |
||
61 | */ |
||
62 | 7 | public static function assert($input, $maxLength) |
|
66 | |||
67 | /** |
||
68 | * @internal |
||
69 | */ |
||
70 | 6 | public static function assertIdentifier($input) |
|
79 | |||
80 | /** |
||
81 | * @internal |
||
82 | */ |
||
83 | 4 | public static function assertCountryCode($input) |
|
91 | |||
92 | 10 | protected static function assertNotPattern($input, $maxLength, $pattern) |
|
104 | |||
105 | /** |
||
106 | * @internal |
||
107 | */ |
||
108 | 3 | public static function xml(DOMDocument $doc, $tag, $content) |
|
115 | } |
||
116 |