--level used: defaultIt fails when I run php artisan code:analyze
$ php artisan code:analyse --paths="app/" --error-format=table
Note: Using the option --errorFormat is deprecated. Use --error-format instead.
Error formatter "" not found. Available error formatters are: checkstyle, raw, table, json, prettyJson
When downgrading to phpstan 0.10.2: it works
```
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals
This is a weird error because in PHPStan itself, there's backwards compatibility to make the old option work:
phpstan master $ bin/phpstan analyse src --errorFormat json
Note: Using the option --errorFormat is deprecated. Use --error-format instead.
336/336 [鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔] 100%
{"totals":{"errors":0,"file_errors":0},"files":[],"errors":[]}
in PHPStan they have a wierd check
if ($oldErrorFormat !== null) {
$errOutput->writeln('Note: Using the option --errorFormat is deprecated. Use --error-format instead.');
$errorFormat = $oldErrorFormat;
}
The problem is that $oldErrorFormat is empty string.
It's not weird - you either pass --error-format X or --errorFormat X. I don't know why someone would pass -errorFormat ''.
I got it: This line in OptionsResolver is potentially dangerous:
$definition = clone $this->command->getDefinition();
Because it clones deprecated options as well.
I don't.
I pass
$ php artisan code:analyse --paths="app/"
Note: Using the option --errorFormat is deprecated. Use --error-format instead.
Error formatter "" not found. Available error formatters are: checkstyle, raw, table, json, prettyJson
The problem is that the oldErrorFormat gets emptyString and not null
@catalinux Larastan does on your behalf and it shouldn't.
I'm hopefully fixing this in #121.
Facing the same issue :(
Lock PHPStan to 0.10.2 or wait until the PR is merged 馃槉
does anyone have idea about when the PR will be Merged ? @ondrejmirtes
Nuno (the maintainer) is on vacation whole August, so probably after that. Use PHPStan 0.10.2 until then.
@progalaa : the only solutions is to add phpstan/phpstan (0.10.2) dependency in your project till this merge will be made
@progalaa @catalinux @ondrejmirtes @coding-sunshine this issue has been fixed on the version v0.2.5, props to @ondrejmirtes