Skip to content

Conversation

@rodrigoprimo
Copy link
Collaborator

@rodrigoprimo rodrigoprimo commented Feb 6, 2026

Description

Adds a new allow_single_item_single_line_explicit_key_arrays property to the WordPress.Arrays.ArrayDeclarationSpacing sniff and soft-deprecates the old allow_single_item_single_line_associative_arrays property 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: the allow_single_item_single_line_associative_arrays property has been deprecated in favor of allow_single_item_single_line_explicit_key_arrays.

Additional notes

If this PR is merged:

Related issues/external references

Closes: #2691

…ld one

Add `allow_single_item_single_line_explicit_key_arrays` property to
replace `allow_single_item_single_line_associative_arrays`, aligning
the property name with the "explicit keys" terminology from PR 2688.

The old property is soft-deprecated (docblock only) and continues to
work via a backward compatibility layer: if the new property has not
been changed from its default and the old property has, the old
property's value is used.

Closes: 2691
@rodrigoprimo rodrigoprimo force-pushed the array-declaration-spacing-new-property branch from c02099d to a0b04f6 Compare February 6, 2026 15:11
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.

Arrays/ArrayDeclarationSpacing: how to deprecate the allow_single_item_single_line_associative_arrays property?

1 participant