1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Fix Phar-scoped issue checks

This commit is contained in:
Matthew Brown 2020-02-17 19:06:37 -05:00
parent 0c2b10709e
commit aab8eed219
2 changed files with 3 additions and 2 deletions

View File

@ -28,8 +28,8 @@ return [
function ($filePath, $prefix, $contents) {
if ($filePath === 'src/Psalm/Config.php') {
return str_replace(
$prefix . '\Composer\Autoload\ClassLoader',
'Composer\Autoload\ClassLoader',
[$prefix . '\Composer\Autoload\ClassLoader', '\'Psalm\\\\Issue\\\\\''],
['Composer\Autoload\ClassLoader', '\'' . $prefix . '\\\\Psalm\\\\Issue\\\\\''],
$contents
);
}

View File

@ -1469,6 +1469,7 @@ class Config
return $this->issue_handlers[$issue_type]->getReportingLevelForFile($file_path);
}
// this string is replaced by scoper for Phars, so be careful
$issue_class = 'Psalm\\Issue\\' . $issue_type;
if (!class_exists($issue_class) || !is_a($issue_class, \Psalm\Issue\CodeIssue::class, true)) {