Skip to content

Commit

Permalink
Update preg_match_shapes.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jul 16, 2024
1 parent b874b8d commit 1111067
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/PHPStan/Analyser/nsrt/preg_match_shapes.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ function bug11277a(string $value): void
if (preg_match('/^\[(.+,?)*\]$/', $value, $matches)) {
assertType('array{0: string, 1?: non-empty-string}', $matches);
if (count($matches) === 2) {
assertType('array{string, non-empty-string}', $matches);
assertType('array{string, string}', $matches); // could be array{string, non-empty-string}
}
}
}
Expand All @@ -350,10 +350,10 @@ function bug11277b(string $value): void
if (preg_match('/^(?:(.+,?)|(x))*$/', $value, $matches)) {
assertType('array{0: string, 1?: non-empty-string, 2?: non-empty-string}', $matches);
if (count($matches) === 2) {
assertType('array{string, non-empty-string}', $matches);
assertType('array{string, string}', $matches); // could be array{string, non-empty-string}
}
if (count($matches) === 3) {
assertType('array{string, non-empty-string, non-empty-string}', $matches);
assertType('array{string, string, string}', $matches); // could be array{string, non-empty-string, non-empty-string}
}
}
}
Expand Down

0 comments on commit 1111067

Please sign in to comment.