1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 01:37:23 +01:00

use better solution to check for project dir paths

This commit is contained in:
orklah 2021-08-19 18:49:28 +02:00
parent 2e7763c314
commit ef34cbd321

View File

@ -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);
}