Skip to content

Commit

Permalink
phpstan - refine generated configuration file
Browse files Browse the repository at this point in the history
It could overwrite existing phpstan.neon in CLI mode
  • Loading branch information
zdenekdrahos committed Dec 22, 2016
1 parent b9b6793 commit 710bffe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/nbproject/
/vendor/
/build/
phpstan.neon
phpstan-phpqa.neon
5 changes: 3 additions & 2 deletions src/CodeAnalysisTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,11 @@ function ($relativeDir) {
$createAbsolutePaths($this->options->ignore->phpstan())
);

$neonFile = $this->options->isSavedToFiles ?
$this->options->rawFile('phpstan.neon') : (getcwd() . '/phpstan.neon');
$neonDir = $this->options->isSavedToFiles ? $this->options->rawFile('') : getcwd();
$neonFile = "{$neonDir}/phpstan-phpqa.neon";
file_put_contents(
$neonFile,
"# Configuration generated in phpqa\n" .
\Nette\Neon\Neon::encode(['parameters' => $params])
);

Expand Down

0 comments on commit 710bffe

Please sign in to comment.