File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -10424,6 +10424,11 @@ public function dataBug2997(): array
1042410424 return $ this ->gatherAssertTypes (__DIR__ . '/data/bug-2997.php ' );
1042510425 }
1042610426
10427+ public function dataBug1657 (): array
10428+ {
10429+ return $ this ->gatherAssertTypes (__DIR__ . '/data/bug-1657.php ' );
10430+ }
10431+
1042710432 /**
1042810433 * @param string $file
1042910434 * @return array<string, mixed[]>
@@ -10609,6 +10614,7 @@ private function gatherAssertTypes(string $file): array
1060910614 * @dataProvider dataBug4099
1061010615 * @dataProvider dataBug3760
1061110616 * @dataProvider dataBug2997
10617+ * @dataProvider dataBug1657
1061210618 * @param string $assertType
1061310619 * @param string $file
1061410620 * @param mixed ...$args
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bug1657 ;
4+
5+ use function PHPStan \Analyser \assertType ;
6+
7+ /**
8+ * @param string|int $value
9+ */
10+ function foo ($ value )
11+ {
12+ assertType ('int|string ' , $ value );
13+ try {
14+ assert (is_string ($ value ));
15+ assertType ('string ' , $ value );
16+
17+ } catch (\Throwable $ e ) {
18+ $ value = 'A ' ;
19+ assertType ('\'A \'' , $ value );
20+ }
21+
22+ assertType ('string ' , $ value );
23+ };
You can’t perform that action at this time.
0 commit comments