File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -406,3 +406,26 @@ public function sayHello(): void
406406 assertType ('list<stdClass> ' , $ this ->importedDaySummaryRows );
407407 }
408408}
409+
410+ class FooBugPositiveInt
411+ {
412+ /**
413+ * @var positive-int
414+ */
415+ public int $ totalExpectedRows = 1 ;
416+
417+ /** @var list<\stdClass> */
418+ public array $ importedDaySummaryRows = [];
419+
420+ public function sayHello (): void
421+ {
422+ assertType ('int<1, max> ' , $ this ->totalExpectedRows );
423+ assertType ('list<stdClass> ' , $ this ->importedDaySummaryRows );
424+ if ($ this ->totalExpectedRows !== count ($ this ->importedDaySummaryRows )) {
425+ assertType ('int<1, max> ' , $ this ->totalExpectedRows );
426+ assertType ('list<stdClass> ' , $ this ->importedDaySummaryRows );
427+ }
428+ assertType ('int<1, max> ' , $ this ->totalExpectedRows );
429+ assertType ('list<stdClass> ' , $ this ->importedDaySummaryRows );
430+ }
431+ }
You can’t perform that action at this time.
0 commit comments