diff --git a/config.xsd b/config.xsd index 3739c9ab0..d87a36de4 100644 --- a/config.xsd +++ b/config.xsd @@ -104,6 +104,7 @@ + diff --git a/src/Psalm/Checker/Statements/Expression/CallChecker.php b/src/Psalm/Checker/Statements/Expression/CallChecker.php index df8523de2..cc0ecb6e8 100644 --- a/src/Psalm/Checker/Statements/Expression/CallChecker.php +++ b/src/Psalm/Checker/Statements/Expression/CallChecker.php @@ -21,6 +21,7 @@ use Psalm\Issue\ForbiddenCode; use Psalm\Issue\ImplicitToStringCast; use Psalm\Issue\InvalidArgument; use Psalm\Issue\InvalidFunctionCall; +use Psalm\Issue\InvalidMethodCall; use Psalm\Issue\InvalidScalarArgument; use Psalm\Issue\InvalidScope; use Psalm\Issue\MixedArgument; @@ -674,7 +675,7 @@ class CallChecker case 'Psalm\\Type\\Atomic\\TString': case 'Psalm\\Type\\Atomic\\TNumericString': if (IssueBuffer::accepts( - new InvalidArgument( + new InvalidMethodCall( 'Cannot call method ' . $stmt->name . ' on ' . $class_type . ' variable ' . $var_id, new CodeLocation($statements_checker->getSource(), $stmt) ), diff --git a/src/Psalm/Issue/InvalidMethodCall.php b/src/Psalm/Issue/InvalidMethodCall.php new file mode 100644 index 000000000..fe696147c --- /dev/null +++ b/src/Psalm/Issue/InvalidMethodCall.php @@ -0,0 +1,6 @@ +