1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Refactor the method call analyzer a little

This commit is contained in:
Matthew Brown 2019-01-12 09:13:54 -05:00
parent cfcb65aaac
commit a49b5af3e9
3 changed files with 812 additions and 730 deletions

View File

@ -932,7 +932,7 @@ class CallAnalyzer
if (IssueBuffer::accepts(
new InvalidPassByReference(
'Parameter ' . ($argument_offset + 1) . ' of ' . $method_id . ' expects a variable',
$code_location
new CodeLocation($statements_analyzer->getSource(), $arg->value)
),
$statements_analyzer->getSuppressedIssues()
)) {
@ -1103,7 +1103,7 @@ class CallAnalyzer
new MixedArgument(
'Argument ' . ($argument_offset + 1) . ' of ' . $cased_method_id
. ' cannot be mixed, expecting array',
$code_location
new CodeLocation($statements_analyzer->getSource(), $arg->value)
),
$statements_analyzer->getSuppressedIssues()
)) {
@ -1116,7 +1116,7 @@ class CallAnalyzer
new InvalidArgument(
'Argument ' . ($argument_offset + 1) . ' of ' . $cased_method_id
. ' expects array, ' . $atomic_type->getId() . ' provided',
$code_location
new CodeLocation($statements_analyzer->getSource(), $arg->value)
),
$statements_analyzer->getSuppressedIssues()
)) {

View File

@ -139,7 +139,7 @@ class FileReferenceTest extends TestCase
(new A())->foo();',
'A::foo',
['6:21:(new A())->foo()'],
['6:32:foo'],
],
];
}