File tree Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \String ;
13
13
14
- function u (?string $ string = '' ): UnicodeString
15
- {
16
- return new UnicodeString ($ string ?? '' );
14
+ if (!\function_exists (u::class)) {
15
+ function u (?string $ string = '' ): UnicodeString
16
+ {
17
+ return new UnicodeString ($ string ?? '' );
18
+ }
17
19
}
18
20
19
- function b (?string $ string = '' ): ByteString
20
- {
21
- return new ByteString ($ string ?? '' );
21
+ if (!\function_exists (b::class)) {
22
+ function b (?string $ string = '' ): ByteString
23
+ {
24
+ return new ByteString ($ string ?? '' );
25
+ }
22
26
}
23
27
24
- /**
25
- * @return UnicodeString|ByteString
26
- */
27
- function s (?string $ string = '' ): AbstractString
28
- {
29
- $ string = $ string ?? '' ;
28
+ if (!\function_exists (s::class)) {
29
+ /**
30
+ * @return UnicodeString|ByteString
31
+ */
32
+ function s (?string $ string = '' ): AbstractString
33
+ {
34
+ $ string = $ string ?? '' ;
30
35
31
- return preg_match ('//u ' , $ string ) ? new UnicodeString ($ string ) : new ByteString ($ string );
36
+ return preg_match ('//u ' , $ string ) ? new UnicodeString ($ string ) : new ByteString ($ string );
37
+ }
32
38
}
You can’t perform that action at this time.
0 commit comments