1
0
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:
Paweł Tomulik 2023-02-26 17:13:16 +01:00
parent 8f98539e0a
commit ee032d4ca9
No known key found for this signature in database
GPG Key ID: 383742B6D85FF3D5

View File

@ -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;
}
}',
],
];
}