Skip to content

Commit 1c9f823

Browse files
bytestreamondrejmirtes
authored andcommitted
Update string compare return values
1 parent cf0c60c commit 1c9f823

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

resources/functionMap.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11693,10 +11693,10 @@
1169311693
'str_shuffle' => ['string', 'str'=>'string'],
1169411694
'str_split' => ['non-empty-array<int,string>|false', 'str'=>'string', 'split_length='=>'positive-int'],
1169511695
'str_word_count' => ['array<int,string>|int|false', 'string'=>'string', 'format='=>'int', 'charlist='=>'string'],
11696-
'strcasecmp' => ['int', 'str1'=>'string', 'str2'=>'string'],
11696+
'strcasecmp' => ['int<-1, 1>', 'str1'=>'string', 'str2'=>'string'],
1169711697
'strchr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'],
11698-
'strcmp' => ['int', 'str1'=>'string', 'str2'=>'string'],
11699-
'strcoll' => ['int', 'str1'=>'string', 'str2'=>'string'],
11698+
'strcmp' => ['int<-1, 1>', 'str1'=>'string', 'str2'=>'string'],
11699+
'strcoll' => ['int<-1, 1>', 'str1'=>'string', 'str2'=>'string'],
1170011700
'strcspn' => ['int', 'str'=>'string', 'mask'=>'string', 'start='=>'int', 'length='=>'int'],
1170111701
'stream_bucket_append' => ['void', 'brigade'=>'resource', 'bucket'=>'object'],
1170211702
'stream_bucket_make_writeable' => ['stdClass|null', 'brigade'=>'resource'],
@@ -11777,10 +11777,10 @@
1177711777
'stripslashes' => ['string', 'str'=>'string'],
1177811778
'stristr' => ['string|false', 'haystack'=>'string', 'needle'=>'mixed', 'before_needle='=>'bool'],
1177911779
'strlen' => ['0|positive-int', 'string'=>'string'],
11780-
'strnatcasecmp' => ['int', 's1'=>'string', 's2'=>'string'],
11781-
'strnatcmp' => ['int', 's1'=>'string', 's2'=>'string'],
11782-
'strncasecmp' => ['int', 'str1'=>'string', 'str2'=>'string', 'len'=>'int'],
11783-
'strncmp' => ['int', 'str1'=>'string', 'str2'=>'string', 'len'=>'int'],
11780+
'strnatcasecmp' => ['int<-1, 1>', 's1'=>'string', 's2'=>'string'],
11781+
'strnatcmp' => ['int<-1, 1>', 's1'=>'string', 's2'=>'string'],
11782+
'strncasecmp' => ['int<-1, 1>', 'str1'=>'string', 'str2'=>'string', 'len'=>'int'],
11783+
'strncmp' => ['int<-1, 1>', 'str1'=>'string', 'str2'=>'string', 'len'=>'int'],
1178411784
'strpbrk' => ['string|false', 'haystack'=>'string', 'char_list'=>'string'],
1178511785
'strpos' => ['positive-int|0|false', 'haystack'=>'string', 'needle'=>'string|int', 'offset='=>'int'],
1178611786
'strptime' => ['array|false', 'datestr'=>'string', 'format'=>'string'],
@@ -11799,7 +11799,7 @@
1179911799
'strtr\'1' => ['string', 'str'=>'string', 'replace_pairs'=>'array'],
1180011800
'strval' => ['string', 'var'=>'mixed'],
1180111801
'substr' => ['__benevolent<string|false>', 'string'=>'string', 'start'=>'int', 'length='=>'int'],
11802-
'substr_compare' => ['int|false', 'main_str'=>'string', 'str'=>'string', 'offset'=>'int', 'length='=>'int', 'case_sensitivity='=>'bool'],
11802+
'substr_compare' => ['int<-1, 1>|false', 'main_str'=>'string', 'str'=>'string', 'offset'=>'int', 'length='=>'int', 'case_sensitivity='=>'bool'],
1180311803
'substr_count' => ['0|positive-int', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'length='=>'int'],
1180411804
'substr_replace' => ['string|array', 'str'=>'string|array', 'repl'=>'mixed', 'start'=>'mixed', 'length='=>'mixed'],
1180511805
'suhosin_encrypt_cookie' => ['string', 'name'=>'string', 'value'=>'string'],

tests/PHPStan/Rules/Functions/data/array_udiff.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ static function(int $a, int $b): int {
3232
},
3333
);
3434

35+
array_udiff(
36+
["25","26"],
37+
["26","27"],
38+
'strcasecmp',
39+
);

0 commit comments

Comments
 (0)