Arrays/ArrayDeclarationSpacing: add new property and soft-deprecate old one #2696
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a new
allow_single_item_single_line_explicit_key_arraysproperty to theWordPress.Arrays.ArrayDeclarationSpacingsniff and soft-deprecates the oldallow_single_item_single_line_associative_arraysproperty to align the property name with the "explicit keys" terminology introduced in #2688.For now, the old property continues to work via a backward compatibility layer: if the new property has not been changed from its default value and the old property has, the old property's value is used. The plan is to remove the old property in the next major release.
This is a soft deprecation (docblock and changelog only) as suggested in #2691 (comment). We are considering adding a runtime deprecation warning in the last release before the next major.
Besides that, this PR includes a separate commit that moves an intentional parse error test to its own file.
Suggested changelog entry
Deprecated
WordPress.Arrays.ArrayDeclarationSpacing: theallow_single_item_single_line_associative_arraysproperty has been deprecated in favor ofallow_single_item_single_line_explicit_key_arrays.Additional notes
If this PR is merged:
allow_single_item_single_line_associative_arrays.Related issues/external references
Closes: #2691