mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Make --init use vendor-dir from composer.json (#2313)
This commit is contained in:
parent
5217156068
commit
e79a0cc8f0
@ -25,7 +25,8 @@ class Creator
|
||||
public static function getContents(
|
||||
string $current_dir,
|
||||
string $suggested_dir = null,
|
||||
int $level = 3
|
||||
int $level = 3,
|
||||
string $vendor_dir = 'vendor'
|
||||
) : string {
|
||||
$replacements = [];
|
||||
|
||||
@ -82,6 +83,12 @@ class Creator
|
||||
$template
|
||||
);
|
||||
|
||||
$template = str_replace(
|
||||
'<directory name="vendor" />',
|
||||
'<directory name="' . $vendor_dir . '" />',
|
||||
$template
|
||||
);
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
|
@ -247,8 +247,10 @@ if (isset($options['i'])) {
|
||||
$source_dir = $args[0];
|
||||
}
|
||||
|
||||
$vendor_dir = getVendorDir($current_dir);
|
||||
|
||||
try {
|
||||
$template_contents = Psalm\Config\Creator::getContents($current_dir, $source_dir, $level);
|
||||
$template_contents = Psalm\Config\Creator::getContents($current_dir, $source_dir, $level, $vendor_dir);
|
||||
} catch (Psalm\Exception\ConfigCreationException $e) {
|
||||
die($e->getMessage() . PHP_EOL);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user