Skip to content

Commit

Permalink
Only create vendor dir in config if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Nov 18, 2020
1 parent 6e39c24 commit f3cde30
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/Psalm/Config/Creator.php
Expand Up @@ -60,11 +60,19 @@ public static function getContents(
self::TEMPLATE
);

$template = str_replace(
'<directory name="vendor" />',
'<directory name="' . $vendor_dir . '" />',
$template
);
if (is_dir($current_dir . DIRECTORY_SEPARATOR . $vendor_dir)) {
$template = str_replace(
'<directory name="vendor" />',
'<directory name="' . $vendor_dir . '" />',
$template
);
} else {
$template = str_replace(
'<directory name="vendor" />',
'',
$template
);
}

$template = str_replace(
'errorLevel="1"',
Expand Down

0 comments on commit f3cde30

Please sign in to comment.