Closed Kanti closed 6 years ago
Thanks, I will look into this.
Having the same issue. I would ignore the phpcs warnings in the older versions with "show_warnings: false" and I was scratching my head why "warning_severity: 0" is still reporting warnings.
I have the same issue. I now changed the following in the PHPCS task:
if ($config['warning_severity'] !== null) {
$arguments->add(sprintf('--warning-severity=%s', $config['warning_severity']));
}
I can make a pull request if this is a good solution.
@jyrkidn, The suggested solution seems OK. However, I would prefer to create a new method \GrumPHP\Collection\ProcessArgumentsCollection::addOptionalIntegerArgument()
which performs the null check and adds the argument if it is not null.
Feel free to create a PR.
Pull request created, hope it is done correctly.
If I set warning_severity to 0 in my grumphp.yml than the argument --warning-severity is not given to the phpcs command.
Or with this Config:
Result: Error: The option "warning_severity" with value "0" is expected to be of type "null" or "int", but is of type "string".
Steps to reproduce: