mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Made compact's return array key type more specific (#3209)
This commit is contained in:
parent
1b752d06ab
commit
16fa208a60
@ -1147,7 +1147,7 @@ return [
|
||||
'commonmark\render\latex' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int', 'width='=>'int'],
|
||||
'commonmark\render\man' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int', 'width='=>'int'],
|
||||
'commonmark\render\xml' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int'],
|
||||
'compact' => ['array', 'var_name'=>'string|array', '...var_names='=>'string|array'],
|
||||
'compact' => ['array<string, mixed>', 'var_name'=>'string|array', '...var_names='=>'string|array'],
|
||||
'COMPersistHelper::__construct' => ['void', 'com_object'=>'object'],
|
||||
'COMPersistHelper::GetCurFile' => ['string'],
|
||||
'COMPersistHelper::GetMaxStreamSize' => ['int'],
|
||||
|
@ -238,6 +238,9 @@ class FunctionCallTest extends TestCase
|
||||
],
|
||||
'compact' => [
|
||||
'<?php
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
function test(): array {
|
||||
return compact(["val"]);
|
||||
}',
|
||||
@ -1173,6 +1176,9 @@ class FunctionCallTest extends TestCase
|
||||
],
|
||||
'compactDefinedVariable' => [
|
||||
'<?php
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
function foo(int $a, string $b, bool $c) : array {
|
||||
return compact("a", "b", "c");
|
||||
}',
|
||||
@ -1647,6 +1653,9 @@ class FunctionCallTest extends TestCase
|
||||
],
|
||||
'compactUndefinedVariable' => [
|
||||
'<?php
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
function foo() : array {
|
||||
return compact("a", "b", "c");
|
||||
}',
|
||||
|
Loading…
Reference in New Issue
Block a user