mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Fix @psalm-suppress with newline
This commit is contained in:
parent
99e6cd819f
commit
523ad144a2
@ -229,7 +229,7 @@ class StatementsAnalyzer extends SourceAnalyzer implements StatementsSource
|
||||
* @return string
|
||||
*/
|
||||
function ($line) {
|
||||
return explode(' ', trim($line))[0];
|
||||
return preg_split('/[\s]+/', $line)[0];
|
||||
},
|
||||
$comments['specials']['psalm-suppress']
|
||||
)
|
||||
|
@ -79,6 +79,16 @@ class IssueSuppressionTest extends TestCase
|
||||
);
|
||||
}',
|
||||
],
|
||||
'suppressWithNewlineAfterComment' => [
|
||||
'<?php
|
||||
function foo() : void {
|
||||
/**
|
||||
* @psalm-suppress TooManyArguments
|
||||
* here
|
||||
*/
|
||||
strlen("a", "b");
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user