1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Hard code possible bit-shift values

This commit is contained in:
Brown 2020-09-04 18:31:50 -04:00
parent 4d82d3ddad
commit d3d8c4ed87
2 changed files with 24 additions and 2 deletions

View File

@ -642,7 +642,29 @@ function preg_replace_callback($search, $replace, $subject, int $limit = -1, &$c
* @param string $subject
* @param mixed $matches
* @param TFlags $flags
* @param-out (TFlags is 256 ? list<list<array{string, int}>> : list<list<string>>) $matches
* @param-out (
* TFlags is 1
? array<list<string>>
: (TFlags is 2
? list<array<string>>
: (TFlags is 256|257
? array<list<array{string, int}>>
: (TFlags is 258
? list<array<array{string, int}>>
: (TFlags is 512|513
? array<list<?string>>
: (TFlags is 514
? list<array<?string>>
: (TFlags is 770
? list<array<array{?string, 1}>>
: array
)
)
)
)
)
)
* ) $matches
* @return int
*/
function preg_match_all($pattern, $replace, &$matches, int $flags = 1) {}

View File

@ -1327,7 +1327,7 @@ class FunctionCallTest extends TestCase
/**
* @psalm-pure
*
* @return list<list<string>>
* @return array<list<string>>
*/
function extractUsernames(string $input): array {
preg_match_all(\'/@[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}(?!\w)/\', $input, $matches);