Skip to content

1.2.0

Compare
Choose a tag to compare
@remcotolsma remcotolsma released this 12 Apr 09:38
· 45 commits to main since this release

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