1.2.0
Changed
- We deviate from the WordPress Coding Standards and switch to the short array syntax.
Exclusions
Generic.Arrays.DisallowShortArraySyntax
According to the WordPress PHP Coding Standards:
Using long array syntax (
array( 1, 2, 3 )
) for declaring arrays is generally more readable than short array syntax ([ 1, 2, 3 ]
), particularly for those with vision difficulties. Additionally, it’s much more descriptive for beginners.Arrays must be declared using long array syntax.
Source: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#declaring-arrays
This change can be done using PHP Coding Standards Fixer:
php-cs-fixer fix --rules @PHP54Migration ./src/
vendor/bin/phpcbf