Skip to content

Commit f677acc

Browse files
committed
Added regression test
1 parent a0cd5cd commit f677acc

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/PHPStan/Rules/Variables/ParameterOutExecutionEndTypeRuleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,9 @@ public function testBug11363(): void
5858
$this->analyse([__DIR__ . '/data/bug-11363.php'], []);
5959
}
6060

61+
public function testBug12330(): void
62+
{
63+
$this->analyse([__DIR__ . '/data/bug-12330.php'], []);
64+
}
65+
6166
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Bug12330;
4+
5+
/**
6+
* @param array{items: list<array<string, mixed>>} $options
7+
* @param-out array{items: list<array<string, mixed>>} $options
8+
*/
9+
function alterItems(array &$options): void
10+
{
11+
foreach ($options['items'] as $i => $item) {
12+
$options['items'][$i]['options']['title'] = $item['name'];
13+
}
14+
}
15+
16+
/**
17+
* @param array{items: array<int, array<string, mixed>>} $options
18+
* @param-out array{items: array<int, array<string, mixed>>} $options
19+
*/
20+
function alterItems(array &$options): void
21+
{
22+
foreach ($options['items'] as $i => $item) {
23+
$options['items'][$i]['options']['title'] = $item['name'];
24+
}
25+
}

0 commit comments

Comments
 (0)