You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Config: show user friendly error message when ini change failed
Inspired by discussion 415.
Previously, when a PHP ini option which cannot be changed at runtime was passed to PHPCS, it would be silently ignored (by PHP, PHPCS would still try to handle it, but would not report that PHP did not change the value).
This commit changes that behaviour by adding a new "ERROR: Ini option %s cannot be set at runtime" error to alert the end-user to the fact that they are passing a PHP ini option which PHPCS cannot change.
The new error will be thrown both when the user passes the invalid ini setting via the command line, as well as when it is passed via a custom ruleset.
The behaviour when trying to change an ini setting which _doesn't exist_ (typo, extension not available) is unchanged. In that case, the ini directive will still be silently ignored.
Includes unit tests to safeguard the new behaviour.
Closes 416
Also note: when this error occurs due to an invalid setting being passed via a ruleset, the error will be thrown directly and not collected via the `MessageCollector`. This is due to the error coming from the `Config` class.
Once the `MessageCollector` would be implemented in the `Config` class, this can potentially be changed.
0 commit comments