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:
parent
92d31b49ad
commit
068dc50b21
@ -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'])
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user