Make WordPress Core

#60609 closed enhancement (wontfix)

Coding Standards: Convert all instances of array() => [] in PHP files

Reported by: itschristiandale's profile itschristiandale Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: coding-standards Cc:

Description

While browsing the codebase, I noticed some inconsistencies.
Some files used array() while others used []

This change aims at fixing that.

Change History (2)

This ticket was mentioned in PR #6162 on WordPress/wordpress-develop by @itschristiandale.


10 months ago
#1

While browsing the codebase, I noticed some inconsistencies. Some files used array() while others used []

This change aims at fixing that.

Trac ticket: https://core.trac.wordpress.org/ticket/60609

#2 @swissspidy
10 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
  • Version trunk deleted

Thanks for taking the time to open this ticket and PR!

Please note that the WordPress PHP coding standards explicitly disallow short array syntax in favor of the more readable array() syntax.

See https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/ and https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#declaring-arrays

As such, I am afraid your change is not something we will implement.

If you believe there is now information that warrants a new proposal to change the coding standards for array syntax, I recommend reading up on those two links and especially the first proposal for that.

Note: See TracTickets for help on using tickets.