Skip to content

Commit c1ca2ac

Browse files
committed
Add regression test for #11317
Closes phpstan/phpstan#11317
1 parent a87845f commit c1ca2ac

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

tests/PHPStan/Rules/Functions/CallToFunctionStatementWithoutSideEffectsRuleTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ public function testFirstClassCallables(): void
119119
]);
120120
}
121121

122+
public function testBug11317(): void
123+
{
124+
$this->analyse([__DIR__ . '/data/bug-11317.php'], [
125+
[
126+
'Call to function array_map() on a separate line has no effect.',
127+
12,
128+
],
129+
]);
130+
}
131+
122132
public function testBug11101(): void
123133
{
124134
$this->analyse([__DIR__ . '/data/bug-11101.php'], [
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug11317;
4+
5+
class HelloWorld
6+
{
7+
/**
8+
* @param array<int> $a
9+
*/
10+
public function sayHello(array $a): void
11+
{
12+
array_map(function ($i) {
13+
return $i;
14+
}, $a);
15+
}
16+
}

0 commit comments

Comments
 (0)