1
0
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:
still-dreaming-1 2020-04-21 18:18:11 -06:00 committed by GitHub
parent 1b752d06ab
commit 16fa208a60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

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

View File

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