mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #2104 - only treat @method returns as separate if attached to method name
This commit is contained in:
parent
b7f79b547e
commit
b61d0c6dcd
@ -913,10 +913,12 @@ class CommentAnalyzer
|
||||
array_shift($doc_line_parts);
|
||||
}
|
||||
|
||||
if (count($doc_line_parts) > 1) {
|
||||
$docblock_lines[] = '@return ' . array_shift($doc_line_parts);
|
||||
|
||||
$method_entry = implode(' ', $doc_line_parts);
|
||||
}
|
||||
}
|
||||
|
||||
$method_entry = trim(preg_replace('/\/\/.*/', '', $method_entry));
|
||||
|
||||
|
@ -641,6 +641,18 @@ class MagicMethodAnnotationTest extends TestCase
|
||||
class B extends A {}',
|
||||
'error_message' => 'ImplementedParamTypeMismatch - src/somefile.php:11:21',
|
||||
],
|
||||
'parseBadMethodAnnotation' => [
|
||||
'<?php
|
||||
/**
|
||||
* @method aaa
|
||||
*/
|
||||
class AAA {
|
||||
function __call() {
|
||||
echo $b."\n";
|
||||
}
|
||||
}',
|
||||
'error_message' => 'InvalidDocblock',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user