1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Only crash Psalm when the faulty file is in project (#4658)

This commit is contained in:
orklah 2020-11-22 15:07:00 +01:00 committed by GitHub
parent a3217265ce
commit 97f0a78ac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@ use function str_replace;
use function strlen;
use function strrpos;
use function substr;
use function in_array;
/**
* @internal
@ -93,7 +94,13 @@ class PropertyDocblockManipulator
$file_contents = $codebase->getFileContents($file_path);
if (count($stmt->props) > 1) {
throw new \UnexpectedValueException('Cannot replace multiple inline properties in ' . $file_path);
if (in_array($file_path, $project_analyzer->getConfig()->getProjectFiles())) {
throw new \UnexpectedValueException('Cannot replace multiple inline properties in ' . $file_path);
}
$this->indentation = '';
return;
}
$prop = $stmt->props[0];