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

Fix @psalm-suppress with newline

This commit is contained in:
Brown 2019-06-03 15:02:28 -04:00
parent 99e6cd819f
commit 523ad144a2
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -79,6 +79,16 @@ class IssueSuppressionTest extends TestCase
);
}',
],
'suppressWithNewlineAfterComment' => [
'<?php
function foo() : void {
/**
* @psalm-suppress TooManyArguments
* here
*/
strlen("a", "b");
}'
],
];
}