Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve level parameter of PhpStan task #612

Closed
wants to merge 0 commits into from
Closed

Improve level parameter of PhpStan task #612

wants to merge 0 commits into from

Conversation

prilka
Copy link
Contributor

@prilka prilka commented Mar 23, 2019

Q A
Branch master
Bug fix? yes
New feature? yes/no
BC breaks? no
Deprecations? no
Documented? no
Fixed tickets #593

This PR allows the two new values NULL and "max" for the level parameter of the PhpStan task. NULL will omit the --level command line option, which is useful for projects with a phpstan.neon config file.

src/Task/PhpStan.php Outdated Show resolved Hide resolved
@veewee
Copy link
Contributor

veewee commented Mar 24, 2019

Thanks for the PR, I've added a small remark.

* @param string $argument
* @param mixed $value
*/
public function addOptionalMixedArgument(string $argument, $value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veewee I think there is no need to add this new function? Can't we just use addOptionalArgument()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it can't.
The addOptionalArgument() method does not add the argument on e.g. value 0.
In this case 0 is a valid value, so we have to use a null check to make sure it falls back to the phsptan configuration file or phpstan default value instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants