Skip to content

Commit c2d26fc

Browse files
committed
Add Str::PRESERVE_QUOTED
1 parent 143ec80 commit c2d26fc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Toolkit/Core/Utility/Str.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ final class Str extends AbstractUtility
1414
{
1515
public const PRESERVE_DOUBLE_QUOTED = 1;
1616
public const PRESERVE_SINGLE_QUOTED = 2;
17+
public const PRESERVE_QUOTED = Str::PRESERVE_DOUBLE_QUOTED | Str::PRESERVE_SINGLE_QUOTED;
1718

1819
/**
1920
* Get the first string that is not null or empty, or return the last value

tests/unit/Toolkit/Core/Utility/StrTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,23 +627,23 @@ public function splitDelimitedProvider(): array
627627
"'apple, banana', cherry",
628628
false,
629629
null,
630-
Str::PRESERVE_DOUBLE_QUOTED | Str::PRESERVE_SINGLE_QUOTED,
630+
Str::PRESERVE_QUOTED,
631631
],
632632
[
633633
["'apple, banana'", '"cherry, strawberry"'],
634634
',',
635635
' ,, \'apple, banana\' , , "cherry, strawberry" , ',
636636
true,
637637
null,
638-
Str::PRESERVE_DOUBLE_QUOTED | Str::PRESERVE_SINGLE_QUOTED,
638+
Str::PRESERVE_QUOTED,
639639
],
640640
[
641641
[' ', " 'apple, banana' ", ' ', ' "cherry, strawberry" ', ' '],
642642
',',
643643
' ,, \'apple, banana\' , , "cherry, strawberry" , ',
644644
true,
645645
'',
646-
Str::PRESERVE_DOUBLE_QUOTED | Str::PRESERVE_SINGLE_QUOTED,
646+
Str::PRESERVE_QUOTED,
647647
],
648648
[
649649
[' ', '', " 'apple", " banana' ", ' ', ' "cherry', ' strawberry" ', ' '],

0 commit comments

Comments
 (0)