From ef34cbd32103ed395e8f68817cd41cc90640d3b4 Mon Sep 17 00:00:00 2001 From: orklah Date: Thu, 19 Aug 2021 18:49:28 +0200 Subject: [PATCH 1/2] 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); } From d416d46900a743fc378ebb5092805d6243c964a6 Mon Sep 17 00:00:00 2001 From: orklah Date: Thu, 19 Aug 2021 19:36:01 +0200 Subject: [PATCH 2/2] fix CS --- .../Internal/FileManipulation/PropertyDocblockManipulator.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php b/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php index d692d975a..d29fa818f 100644 --- a/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php +++ b/src/Psalm/Internal/FileManipulation/PropertyDocblockManipulator.php @@ -9,7 +9,6 @@ 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;