Skip to content

Commit

Permalink
added regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Jul 26, 2022
1 parent 5d044df commit 5c71adb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/NodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-7688.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-7689.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/has-offset-type-bug.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-5920.php');
}

/**
Expand Down
21 changes: 21 additions & 0 deletions tests/PHPStan/Analyser/data/bug-5920.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Bug5920;

use function PHPStan\Testing\assertType;

use XMLReader;

function doFoo() {
$reader = new XMLReader();
$reader->open('');
assertType('bool', $reader->read());
while ($reader->read()) {}
assertType('bool', $reader->read());
$reader->close();
$reader->open('');
assertType('bool', $reader->read());
while ($reader->read()) {}
assertType('bool', $reader->read());
$reader->close();
}

0 comments on commit 5c71adb

Please sign in to comment.