mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 13:51:54 +01:00
add unit tests for #9401
This commit is contained in:
parent
8f98539e0a
commit
ee032d4ca9
@ -83,6 +83,28 @@ class ClassStringMapTest extends TestCase
|
||||
takesVariadic(...$arr);
|
||||
}',
|
||||
],
|
||||
'assignClassStringMapInConstruct' => [
|
||||
'code' => '<?php
|
||||
class A {
|
||||
/** @var class-string-map<T,T> */
|
||||
private array $map;
|
||||
/** @param class-string-map<T,T> $map */
|
||||
public function __construct(array $map) {
|
||||
$this->map = $map;
|
||||
}
|
||||
}',
|
||||
],
|
||||
'assignClassStringMapInMethod' => [
|
||||
'code' => '<?php
|
||||
class A {
|
||||
/** @var class-string-map<T,T> */
|
||||
private array $map = [];
|
||||
/** @param class-string-map<T,T> $map */
|
||||
public function set(array $map): void {
|
||||
$this->map = $map;
|
||||
}
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user