mirror of
https://github.com/danog/psalm.git
synced 2024-11-29 20:28:59 +01:00
Add better instructions for --init
This commit is contained in:
parent
0277ca49ba
commit
1b9f3c33a1
13
bin/psalm
13
bin/psalm
@ -121,12 +121,17 @@ if (isset($options['i'])) {
|
||||
$level = (int)$args[1];
|
||||
}
|
||||
|
||||
if (!file_exists($args[0])) {
|
||||
$bad_dir_path = getcwd() . DIRECTORY_SEPARATOR . $args[0];
|
||||
die('The given path ' . $bad_dir_path . ' does not appear to be a directory' . PHP_EOL);
|
||||
$source_dir = $args[0];
|
||||
}
|
||||
|
||||
if (!is_dir($source_dir)) {
|
||||
$bad_dir_path = getcwd() . DIRECTORY_SEPARATOR . $source_dir;
|
||||
|
||||
if (!isset($args[0])) {
|
||||
die('Please specify a directory - the default, "src", was not found in this project.' . PHP_EOL);
|
||||
}
|
||||
|
||||
$source_dir = $args[0];
|
||||
die('The given path "' . $bad_dir_path . '" does not appear to be a directory' . PHP_EOL);
|
||||
}
|
||||
|
||||
$template_file_name = 'assets/config_levels/' . $level . '.xml';
|
||||
|
@ -1,21 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<psalm
|
||||
name="Example Psalm config with recommended defaults"
|
||||
stopOnFirstError="false"
|
||||
useDocblockTypes="true"
|
||||
totallyTyped="false"
|
||||
>
|
||||
<projectFiles>
|
||||
<directory name="src" />
|
||||
</projectFiles>
|
||||
|
||||
<issueHandlers>
|
||||
<InvalidDocblock errorLevel="info" />
|
||||
<MissingClosureReturnType errorLevel="suppress" />
|
||||
<MissingPropertyType errorLevel="info" />
|
||||
<MissingReturnType errorLevel="info" />
|
||||
<DeprecatedMethod errorLevel="info" />
|
||||
<PossiblyUndefinedVariable errorLevel="info" />
|
||||
<FailedTypeResolution errorLevel="info" />
|
||||
</issueHandlers>
|
||||
</psalm>
|
Loading…
Reference in New Issue
Block a user