mirror of
https://github.com/danog/psalm.git
synced 2024-12-12 09:19:40 +01:00
Merge pull request #6345 from orklah/multiple_properties
use better solution to check for project dir paths
This commit is contained in:
commit
230bdb43ad
@ -2,13 +2,13 @@
|
||||
namespace Psalm\Internal\FileManipulation;
|
||||
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use Psalm\Config;
|
||||
use Psalm\DocComment;
|
||||
use Psalm\FileManipulation;
|
||||
use Psalm\Internal\Analyzer\ProjectAnalyzer;
|
||||
|
||||
use function array_shift;
|
||||
use function count;
|
||||
use function in_array;
|
||||
use function ltrim;
|
||||
use function str_replace;
|
||||
use function strlen;
|
||||
@ -95,7 +95,8 @@ class PropertyDocblockManipulator
|
||||
$file_contents = $codebase->getFileContents($file_path);
|
||||
|
||||
if (count($stmt->props) > 1) {
|
||||
if (in_array($file_path, $project_analyzer->getConfig()->getProjectFiles())) {
|
||||
$config = Config::getInstance();
|
||||
if ($config->isInProjectDirs($file_path)) {
|
||||
throw new \UnexpectedValueException('Cannot replace multiple inline properties in ' . $file_path);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user