Skip to content

Commit

Permalink
phpstan - add parameter for current working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenekdrahos committed Dec 22, 2016
1 parent 9ae3332 commit 8bca09d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/CodeAnalysisTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,11 @@ function ($relativeDir) {
file_put_contents(
$neonFile,
"# Configuration generated in phpqa\n" .
\Nette\Neon\Neon::encode(['parameters' => $params])
str_replace(
'%currentWorkingDir%',
getcwd(),
\Nette\Neon\Neon::encode(['parameters' => $params])
)
);

return array(
Expand Down
6 changes: 2 additions & 4 deletions tests/.travis/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Required config for analyzing root directory (RobotLoader. throws Nette\InvalidStateException: Ambiguous class)
# phpqa --report --output cli --tools phpstan --analyzedDirs ./ --ignoredDirs=vendor
#
# %rootDir% == vendor/phpstan/phpstan/

parameters:
bootstrap: %rootDir%/../../../vendor/autoload.php
bootstrap: %currentWorkingDir%/vendor/autoload.php
autoload_directories:
- %rootDir%/../../../tests
- %currentWorkingDir%/tests
ignoreErrors:
- '#Call to an undefined method Edge\\QA\\CodeAnalysisTasks::[a-zA-Z0-9_]+\(\)#'
- '#Call to an undefined method Prophecy\\Prophecy\\ObjectProphecy::[a-zA-Z0-9_]+\(\)#'
Expand Down

0 comments on commit 8bca09d

Please sign in to comment.