From ef34cbd32103ed395e8f68817cd41cc90640d3b4 Mon Sep 17 00:00:00 2001 From: orklah Date: Thu, 19 Aug 2021 18:49:28 +0200 Subject: [PATCH] use better solution to check for project dir paths --- .../Internal/FileManipulation/PropertyDocblockManipulator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php b/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php index 5c9fb5d5b..d692d975a 100644 --- a/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php +++ b/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php @@ -2,6 +2,7 @@ namespace Psalm\Internal\FileManipulation; use PhpParser\Node\Stmt\Property; +use Psalm\Config; use Psalm\DocComment; use Psalm\FileManipulation; use Psalm\Internal\Analyzer\ProjectAnalyzer; @@ -95,7 +96,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); }