1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add better instructions for --init

This commit is contained in:
Matthew Brown 2017-02-13 00:12:56 -05:00
parent 0277ca49ba
commit 1b9f3c33a1
2 changed files with 9 additions and 25 deletions

View File

@ -121,12 +121,17 @@ if (isset($options['i'])) {
$level = (int)$args[1]; $level = (int)$args[1];
} }
if (!file_exists($args[0])) { $source_dir = $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);
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'; $template_file_name = 'assets/config_levels/' . $level . '.xml';

View File

@ -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>