| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the Symfony package. |
| 5 |
* |
| 6 |
* (c) Fabien Potencier <fabien@symfony.com> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
namespace WindPressDeps\Symfony\Component\String; |
| 12 |
|
| 13 |
if (!\function_exists(u::class)) { |
| 14 |
function u(?string $string = '') : UnicodeString |
| 15 |
{ |
| 16 |
return new UnicodeString($string ?? ''); |
| 17 |
} |
| 18 |
} |
| 19 |
if (!\function_exists(b::class)) { |
| 20 |
function b(?string $string = '') : ByteString |
| 21 |
{ |
| 22 |
return new ByteString($string ?? ''); |
| 23 |
} |
| 24 |
} |
| 25 |
if (!\function_exists(s::class)) { |
| 26 |
/** |
| 27 |
* @return UnicodeString|ByteString |
| 28 |
*/ |
| 29 |
function s(?string $string = '') : AbstractString |
| 30 |
{ |
| 31 |
$string = $string ?? ''; |
| 32 |
return \preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); |
| 33 |
} |
| 34 |
} |
| 35 |
|