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 | 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 | 3 | public static function assertOptional($input, $maxLength) |
|
57 | |||
58 | /** |
||
59 | * @internal |
||
60 | */ |
||
61 | 7 | public static function assert($input, $maxLength) |
|
65 | |||
66 | /** |
||
67 | * @internal |
||
68 | */ |
||
69 | 6 | public static function assertIdentifier($input) |
|
78 | |||
79 | /** |
||
80 | * @internal |
||
81 | */ |
||
82 | 4 | public static function assertCountryCode($input) |
|
90 | |||
91 | 10 | protected static function assertNotPattern($input, $maxLength, $pattern) |
|
103 | |||
104 | /** |
||
105 | * @internal |
||
106 | */ |
||
107 | 3 | public static function xml(DOMDocument $doc, $tag, $content) |
|
114 | } |
||
115 |