diff --git a/scoper.inc.php b/scoper.inc.php index c6d60fbae..eed8a264b 100644 --- a/scoper.inc.php +++ b/scoper.inc.php @@ -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 ); } diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 52aadcb05..1981f0300 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -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)) {