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

Suggestion: only allow raising the memory limit #2612

Closed
jrfnl opened this issue Sep 24, 2019 · 1 comment
Closed

Suggestion: only allow raising the memory limit #2612

jrfnl opened this issue Sep 24, 2019 · 1 comment

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Sep 24, 2019

Currently when setting the memory limit, it will just be "hard" set to whatever value is passed:
$ phpcs -d memory_limit=32M /path/to/code

In most cases, the memory_limit is passed - either from the command line or the ruleset via <ini name="" value=""/> - to attempt to raise the memory limit, however, the existing memory limit is not checked, so in effect the memory_limit could currently be lowered.

Should a check be build in to only allow for raising the memory limit and to ignore (or raise a warning) about lowering the memory limit ?

@gsherwood
Copy link
Member

Should a check be build in to only allow for raising the memory limit and to ignore (or raise a warning) about lowering the memory limit ?

I don't think PHPCS should be doing this. I think it should be setting the values that are passed in and performing the run as instructed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for Release
Development

No branches or pull requests

2 participants