-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature request: Array property extending doesn't work when property has default value #2228
Comments
The new array property `extend`-ing as added in PHPCS 3.4.0 appears to have a bug which doesn't allow it to work with default values of array properties, so until this bug is fixed, the default value of the `TestDoubles` `doubles_path` property also needs to be set in the standard. For more details, see the upstream bug report: squizlabs/PHP_CodeSniffer#2228
This is an interesting use case, but not what the feature was designed to do, or how I documented it. I don't think this should be considered a bug - it just a feature that still doesn't exist despite the |
Let's call it a feature request in that case. Without having read the (not yet published as not yet released) changelog, intuitively I, at least, would expect this to work as described above. |
Closing as replaced by PHPCSStandards/PHP_CodeSniffer#15 |
PR #2154 added support for array properties being extended, however it appears that this doesn't work when an array property already has a default value set.
If we take the original example of the
Generic.PHP.ForbiddenFunctions
sniff, it all works correctly if you overrule theforbiddenFunctions
property in a standard and thenextend
it from a project-based ruleset.However, if you want to extend the default values of the
forbiddenFunctions
property:either via a standard or a project ruleset:
You end up with:
instead of the expected:
@Majkl578 Any thoughts on this ?
Related #2153
The text was updated successfully, but these errors were encountered: