Skip to content

Commit aab8eed

Browse files
committed
Fix Phar-scoped issue checks
1 parent 0c2b107 commit aab8eed

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

scoper.inc.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ function ($filePath, $prefix, $contents) {
2828
function ($filePath, $prefix, $contents) {
2929
if ($filePath === 'src/Psalm/Config.php') {
3030
return str_replace(
31-
$prefix . '\Composer\Autoload\ClassLoader',
32-
'Composer\Autoload\ClassLoader',
31+
[$prefix . '\Composer\Autoload\ClassLoader', '\'Psalm\\\\Issue\\\\\''],
32+
['Composer\Autoload\ClassLoader', '\'' . $prefix . '\\\\Psalm\\\\Issue\\\\\''],
3333
$contents
3434
);
3535
}

src/Psalm/Config.php

+1
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,7 @@ public function getReportingLevelForFile($issue_type, $file_path)
14691469
return $this->issue_handlers[$issue_type]->getReportingLevelForFile($file_path);
14701470
}
14711471

1472+
// this string is replaced by scoper for Phars, so be careful
14721473
$issue_class = 'Psalm\\Issue\\' . $issue_type;
14731474

14741475
if (!class_exists($issue_class) || !is_a($issue_class, \Psalm\Issue\CodeIssue::class, true)) {

0 commit comments

Comments
 (0)