@@ -15,21 +15,21 @@ function (string $s): void {
15
15
assertType ('array{string, string}|null ' , $ result );
16
16
17
17
$ result = Strings::match ($ s , '/(foo)(bar)(baz)/ ' , PREG_OFFSET_CAPTURE );
18
- assertType (' array{array{string, int<0, max>}, array{non-empty-string , int<0, max>}, array{non-empty-string , int<0, max>}, array{non-empty-string , int<0, max>}}|null ' , $ result );
18
+ assertType (" array{array{string, int<0, max>}, array{'foo' , int<0, max>}, array{'bar' , int<0, max>}, array{'baz' , int<0, max>}}|null " , $ result );
19
19
20
20
$ result = Strings::match ($ s , '/(foo)(bar)(baz)/ ' );
21
- assertType (' array{string, non-empty-string, non-empty-string, non-empty-string }|null ' , $ result );
21
+ assertType (" array{string, 'foo', 'bar', 'baz' }|null " , $ result );
22
22
23
23
$ result = Strings::match ($ s , '/(foo)(bar) ' . preg_quote ($ s ) .'(baz)/ ' );
24
- assertType (' array{string, non-empty-string, non-empty-string, non-empty-string }|null ' , $ result );
24
+ assertType (" array{string, 'foo', 'bar', 'baz' }|null " , $ result );
25
25
};
26
26
27
27
function (string $ s ): void {
28
28
$ result = Strings::matchAll ($ s , '/ab(?P<num>\d+)(?P<suffix>ab)?/ ' , PREG_SET_ORDER );
29
- assertType ("list<array{0: string, num: numeric-string, 1: numeric-string, suffix?: non-empty-string , 2?: non-empty-string }> " , $ result );
29
+ assertType ("list<array{0: string, num: numeric-string, 1: numeric-string, suffix?: 'ab' , 2?: 'ab' }> " , $ result );
30
30
};
31
31
32
32
function (string $ s ): void {
33
33
$ result = Strings::matchAll ($ s , '/ab(?P<num>\d+)(?P<suffix>ab)?/ ' , PREG_PATTERN_ORDER );
34
- assertType ("array{0: list<string>, num: list<numeric-string>, 1: list<numeric-string>, suffix: list<string >, 2: list<string >} " , $ result );
34
+ assertType ("array{0: list<string>, num: list<numeric-string>, 1: list<numeric-string>, suffix: list<''|'ab' >, 2: list<''|'ab' >} " , $ result );
35
35
};
0 commit comments