Skip to content

Commit

Permalink
Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 5, 2024
1 parent 51cffd4 commit d332bf5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Expand Up @@ -140,4 +140,13 @@ public function testReadOnlyClasses(): void
]);
}

public function testBug6773(): void
{
if (PHP_VERSION_ID < 80100) {
$this->markTestSkipped('Test requires PHP 8.1.');
}

$this->analyse([__DIR__ . '/data/bug-6773.php'], []);
}

}
18 changes: 18 additions & 0 deletions tests/PHPStan/Rules/Properties/data/bug-6773.php
@@ -0,0 +1,18 @@
<?php // lint >= 8.1

namespace Bug6773;

final class Repository
{
/**
* @param array<string, string> $data
*/
public function __construct(private readonly array $data)
{
}

public function remove(string $key): void
{
unset($this->data[$key]);
}
}

0 comments on commit d332bf5

Please sign in to comment.