1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix #1504 and ignore SoapClient errors

This commit is contained in:
Brown 2019-03-25 11:49:05 -04:00
parent 783f028f70
commit 691d71cdb4
2 changed files with 28 additions and 1 deletions

View File

@ -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

View File

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