mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Only crash Psalm when the faulty file is in project (#4658)
This commit is contained in:
parent
ecb201a312
commit
2b19795f29
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user