diff --git a/src/Psalm/Internal/Analyzer/MethodAnalyzer.php b/src/Psalm/Internal/Analyzer/MethodAnalyzer.php index 4da88b16f..ebe4b4b7e 100644 --- a/src/Psalm/Internal/Analyzer/MethodAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/MethodAnalyzer.php @@ -857,6 +857,7 @@ class MethodAnalyzer extends FunctionLikeAnalyzer && $guide_param->type && !$guide_param->type->hasMixed() && !$guide_param->type->from_docblock + && ($cased_guide_method_id !== 'SoapClient::__soapCall' || $implemeneter_param_type) && ( !$implemeneter_param_type || ( @@ -872,7 +873,7 @@ class MethodAnalyzer extends FunctionLikeAnalyzer if (IssueBuffer::accepts( new MethodSignatureMismatch( 'Argument ' . ($i + 1) . ' of ' . $cased_implementer_method_id . ' has wrong type \'' . - $implementer_method_storage->params[$i]->type . '\', expecting \'' . + $implemeneter_param_type . '\', expecting \'' . $guide_param->type . '\' as defined by ' . $cased_guide_method_id, $implementer_method_storage->params[$i]->location diff --git a/tests/MethodSignatureTest.php b/tests/MethodSignatureTest.php index ede572064..3e10cffed 100644 --- a/tests/MethodSignatureTest.php +++ b/tests/MethodSignatureTest.php @@ -41,6 +41,32 @@ class MethodSignatureTest extends TestCase ) { return $_GET["foo"]; } + } + + class B extends SoapClient + { + public function __soapCall( + $function_name, + $arguments, + $options = [], + $input_headers = [], + &$output_headers = [] + ) { + return $_GET["foo"]; + } + } + + class C extends SoapClient + { + public function __soapCall( + string $function_name, + $arguments, + $options = [], + $input_headers = [], + &$output_headers = [] + ) { + return $_GET["foo"]; + } }' );