functions.php
23 lines
| 1 | <?php |
| 2 | namespace MailPoetVendor\Symfony\Component\String; |
| 3 | if (!defined('ABSPATH')) exit; |
| 4 | if (!\function_exists(u::class)) { |
| 5 | function u(?string $string = '') : UnicodeString |
| 6 | { |
| 7 | return new UnicodeString($string ?? ''); |
| 8 | } |
| 9 | } |
| 10 | if (!\function_exists(b::class)) { |
| 11 | function b(?string $string = '') : ByteString |
| 12 | { |
| 13 | return new ByteString($string ?? ''); |
| 14 | } |
| 15 | } |
| 16 | if (!\function_exists(s::class)) { |
| 17 | function s(?string $string = '') : AbstractString |
| 18 | { |
| 19 | $string = $string ?? ''; |
| 20 | return \preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); |
| 21 | } |
| 22 | } |
| 23 |