Skip to content

Commit c5a9df5

Browse files
phpstan-botondrejmirtes
authored andcommitted
Add regression test for #13711
Closes phpstan/phpstan#13711
1 parent 65f5d94 commit c5a9df5

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ public function testBug757(): void
322322
]);
323323
}
324324

325+
public function testBug13711(): void
326+
{
327+
$this->analyse([__DIR__ . '/data/bug-13711.php'], []);
328+
}
329+
325330
public function testImplodeOnPhp74(): void
326331
{
327332
$errors = [
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug13711;
4+
5+
class Foo
6+
{
7+
/** @var array<string> */
8+
private array $array = [];
9+
10+
/** @return array<string> */
11+
public function &getList(): array
12+
{
13+
return $this->array;
14+
}
15+
16+
public function rewind(): void
17+
{
18+
reset($this->getList());
19+
}
20+
}

0 commit comments

Comments
 (0)