Skip to content

Commit f15b7a2

Browse files
ondrejmirtesclaude
andcommitted
Add regression test for #10749
Closes phpstan/phpstan#10749 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f63a13f commit f15b7a2

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

tests/PHPStan/Rules/Properties/TypesAssignedToPropertiesRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,4 +1066,9 @@ public function testBug10924(): void
10661066
$this->analyse([__DIR__ . '/../Methods/data/bug-10924.php'], []);
10671067
}
10681068

1069+
public function testBug10749(): void
1070+
{
1071+
$this->analyse([__DIR__ . '/data/bug-10749.php'], []);
1072+
}
1073+
10691074
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug10749;
4+
5+
use ArrayAccess;
6+
7+
/**
8+
* @template T of array<string, mixed>
9+
* @implements ArrayAccess<key-of<T>, value-of<T>>
10+
*/
11+
abstract class Base implements ArrayAccess
12+
{
13+
14+
/** @var T */
15+
protected array $data = [];
16+
17+
/**
18+
* @template K of key-of<T>
19+
* @param K|null $offset
20+
* @param T[K] $value
21+
*/
22+
public function offsetSet($offset, $value): void
23+
{
24+
$this->data[$offset] = $value;
25+
}
26+
27+
}

0 commit comments

Comments
 (0)