Skip to content

Commit fd3c3ec

Browse files
committed
fix test
1 parent 399b888 commit fd3c3ec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/PHPStan/Analyser/nsrt/bug-11311-php72.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use function PHPStan\Testing\assertType;
66

7-
function doFoo() {
8-
if (1 === preg_match('/(?<major>\d+)\.(?<minor>\d+)(?:\.(?<patch>\d+))?/', '12.5', $matches, PREG_UNMATCHED_AS_NULL)) {
7+
function doFoo(string $s) {
8+
if (1 === preg_match('/(?<major>\d+)\.(?<minor>\d+)(?:\.(?<patch>\d+))?/', $s, $matches, PREG_UNMATCHED_AS_NULL)) {
99
// on PHP < 7.4, unmatched-as-null does not return null values; see https://3v4l.org/v3HE4
1010
assertType('array{0: string, major: string, 1: string, minor: string, 2: string, patch?: string, 3?: string}', $matches);
1111
}

tests/PHPStan/Analyser/nsrt/bug-11311.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use function PHPStan\Testing\assertType;
66

7-
function doFoo() {
8-
if (1 === preg_match('/(?<major>\d+)\.(?<minor>\d+)(?:\.(?<patch>\d+))?/', '12.5', $matches, PREG_UNMATCHED_AS_NULL)) {
7+
function doFoo(string $s) {
8+
if (1 === preg_match('/(?<major>\d+)\.(?<minor>\d+)(?:\.(?<patch>\d+))?/', $s, $matches, PREG_UNMATCHED_AS_NULL)) {
99

1010
assertType('array{0: string, major: string|null, 1: string|null, minor: string|null, 2: string|null, patch: string|null, 3: string|null}', $matches);
1111
}

0 commit comments

Comments
 (0)