Skip to content
Permalink
Browse files

Fix #1802 - ensure directory exists before moving file

  • Loading branch information...
muglug committed Jun 18, 2019
1 parent 1061319 commit 1bdd444ce68d3ea97ae63b248ee07a2cdde53aa5
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/Psalm/Internal/Analyzer/ProjectAnalyzer.php
@@ -761,6 +761,12 @@ function (FileManipulation $a, FileManipulation $b) {
$potential_file_path = $this->config->getPotentialComposerFilePathForClassLike($destination);
if ($potential_file_path && !file_exists($potential_file_path)) {
$containing_dir = dirname($potential_file_path);
if (!file_exists($containing_dir)) {
mkdir($containing_dir, 0777, true);
}
rename($source_class_storage->location->file_path, $potential_file_path);
}
}

0 comments on commit 1bdd444

Please sign in to comment.
You can’t perform that action at this time.