1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Fix #792 - allow docblock array form of variadic arg

This commit is contained in:
Matthew Brown 2018-06-08 21:18:49 -04:00
parent 92d31b49ad
commit 068dc50b21
2 changed files with 15 additions and 5 deletions

View File

@ -309,10 +309,16 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
if ($signature_type) {
if (!TypeChecker::isContainedBy(
$codebase,
$param_type,
$signature_type
)
$codebase,
$param_type,
$signature_type,
false,
false,
$has_scalar_match,
$type_coerced,
$type_coerced_from_mixed
)
&& !$type_coerced_from_mixed
) {
if ($project_checker->alter_code
&& isset($project_checker->getIssuesToFix()['MismatchingDocblockParamType'])

View File

@ -885,6 +885,11 @@ class AnnotationTest extends TestCase
$f = foo();
if ($f) {}'
],
'spreadOperatorArrayAnnotation' => [
'<?php
/** @param string[] $s */
function foo(string ...$s) : void {}',
],
];
}
@ -1066,7 +1071,6 @@ class AnnotationTest extends TestCase
}',
'error_message' => 'MismatchingDocblockReturnType',
],
'noStringParamType' => [
'<?php
function fooFoo($a): void {