Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Tool | Settings | Default Value | Your value
[pdepend.coverageReport](https://github.com/EdgedesignCZ/phpqa/pull/124) | Load Clover style CodeCoverage report | `null` | Path to report produced by PHPUnit's `--coverage-clover` option
[phpmd.standard](http://phpmd.org/documentation/creating-a-ruleset.html) | Ruleset | [Edgedesign's standard](/app/phpmd.xml) | Path to ruleset. To specify [multiple rule sets](https://phpmd.org/documentation/index.html#using-multiple-rule-sets), you can use an array
[phpcpd](https://github.com/sebastianbergmann/phpcpd/blob/de9056615da6c1230f3294384055fa7d722c38fa/src/CLI/Command.php#L136) | Minimum number of lines/tokens for copy-paste detection | 5 lines, 70 tokens |
[phpstan](https://github.com/phpstan/phpstan#configuration) | Level, config file | Level 0, `%currentWorkingDirectory%/phpstan.neon` | Take a look at [phpqa config in tests/.travis](/tests/.travis/) |
[phpstan](https://github.com/phpstan/phpstan#configuration) | Level, config file, memory limit | Level 0, `%currentWorkingDirectory%/phpstan.neon`, memoryLimit: '1024M' | Take a look at [phpqa config in tests/.travis](/tests/.travis/) |
[phpunit.binary](https://github.com/EdgedesignCZ/phpqa/blob/4947416/.phpqa.yml#L40) | Phpunit binary | phpqa's phpunit | Path to phpunit executable in your project, typically [`vendor/bin/phpunit`](https://gitlab.com/costlocker/integrations/blob/master/basecamp/backend/.phpqa.yml#L2) |
[phpunit.config](https://phpunit.de/manual/current/en/organizing-tests.html#organizing-tests.xml-configuration) | PHPUnit configuration, `analyzedDirs` and `ignoredDirs` are not used, you have to specify test suites in XML file | `null` | Path to `phpunit.xml` file
[phpunit.reports](https://phpunit.de/manual/current/en/textui.html) | Report types | no report | List of reports and formats, corresponds with CLI option, e.g. `--log-junit` is `log: [junit]` in `.phpqa.yml` |
Expand Down
9 changes: 8 additions & 1 deletion src/Tools/Analyzer/Phpstan.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,21 @@ function ($relativeDir) {
$phpstanConfig = "# Configuration generated in phpqa\n" . \Nette\Neon\Neon::encode($config);
$neonFile = $this->saveDynamicConfig($phpstanConfig, 'neon');

return array(
$args = array(
'analyze',
'ansi' => '',
$this->getErrorFormatOption() => 'checkstyle',
'level' => $this->config->value('phpstan.level'),
'configuration' => $neonFile,
$this->options->getAnalyzedDirs(' '),
);

$memoryLimit = $this->config->value('phpstan.memoryLimit');
if ($memoryLimit) {
$args['memory-limit'] = $memoryLimit;
}

return $args;
}

private function getErrorFormatOption()
Expand Down