Skip to content

Commit f2acadd

Browse files
committed
another test
1 parent c7174a8 commit f2acadd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/PHPStan/Analyser/nsrt/list-count.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)