Skip to content

Commit 77fc29b

Browse files
committed
adjust LegacyNodeScopeResolverTest test expectations
1 parent 75700b7 commit 77fc29b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public function dataAssignInIf(): array
302302
$testScope,
303303
'matches',
304304
TrinaryLogic::createYes(),
305-
'mixed',
305+
'(0 is 256 ? array<array{string, int<-1, max>}> : (0 is 512 ? array<string|null> : (0 is 768 ? array<array{null, -1}|array{string, int<0, max>}> : array<string>)))',
306306
],
307307
[
308308
$testScope,
@@ -343,7 +343,7 @@ public function dataAssignInIf(): array
343343
$testScope,
344344
'matches2',
345345
TrinaryLogic::createMaybe(),
346-
'mixed',
346+
'(0 is 256 ? array<array{string, int<-1, max>}> : (0 is 512 ? array<string|null> : (0 is 768 ? array<array{null, -1}|array{string, int<0, max>}> : array<string>)))',
347347
],
348348
[
349349
$testScope,
@@ -355,13 +355,13 @@ public function dataAssignInIf(): array
355355
$testScope,
356356
'matches3',
357357
TrinaryLogic::createYes(),
358-
'mixed',
358+
'(0 is 256 ? array<array{string, int<-1, max>}> : (0 is 512 ? array<string|null> : (0 is 768 ? array<array{null, -1}|array{string, int<0, max>}> : array<string>)))',
359359
],
360360
[
361361
$testScope,
362362
'matches4',
363363
TrinaryLogic::createMaybe(),
364-
'mixed',
364+
'(0 is 256 ? array<array{string, int<-1, max>}> : (0 is 512 ? array<string|null> : (0 is 768 ? array<array{null, -1}|array{string, int<0, max>}> : array<string>)))',
365365
],
366366
[
367367
$testScope,
@@ -415,7 +415,7 @@ public function dataAssignInIf(): array
415415
$testScope,
416416
'ternaryMatches',
417417
TrinaryLogic::createYes(),
418-
'mixed',
418+
'(0 is 256 ? array<array{string, int<-1, max>}> : (0 is 512 ? array<string|null> : (0 is 768 ? array<array{null, -1}|array{string, int<0, max>}> : array<string>)))',
419419
],
420420
[
421421
$testScope,

tests/PHPStan/Analyser/data/param-out.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,8 @@ function fooDateTime(\SplFileObject $splFileObject, ?string $wouldBlock) {
302302

303303
assertType('string', $wouldBlock);
304304
}
305+
306+
function testMtch() {
307+
preg_match('#.*#', 'foo', $matches);
308+
assertType('array<string>', $matches);
309+
}

0 commit comments

Comments
 (0)