Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Apr 12, 2022
2 parents ab1fd2b + a56184f commit d58a6b1
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
composer.phar
# Composer
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
# PHP Coding Standards Fixer
/.php-cs-fixer.cache
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - 2022-04-12
### Changed
- We deviate from the WordPress Coding Standards and switch to the short array syntax.

## [1.1.0] - 2022-02-17
### Changed
- Updated minimum WordPress version to `5.7`: https://codex.wordpress.org/Supported_Versions.
Expand All @@ -27,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added relative exclude pattern `^wordpress/*` for the `wordpress` folder.
- Added relative exclude pattern `^wp-content/*` for the `wp-content` folder.

[Unreleased]: https://github.com/pronamic/wp-coding-standards/compare/1.1.0...HEAD
[Unreleased]: https://github.com/pronamic/wp-coding-standards/compare/1.2.0...HEAD
[1.2.0]: https://github.com/pronamic/wp-coding-standards/compare/1.1.0...1.2.0
[1.1.0]: https://github.com/pronamic/wp-coding-standards/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/pronamic/wp-coding-standards/releases/tag/1.0.0
5 changes: 5 additions & 0 deletions PronamicWP/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@

<!-- @link https://github.com/pronamic/wp-coding-standards/tree/develop#wordpress-vip-go -->
<rule ref="WordPress-VIP-Go" />

<!-- @link https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/ -->
<rule ref="Generic.Arrays">
<exclude name="Generic.Arrays.DisallowShortArraySyntax" />
</rule>
</ruleset>
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,20 @@ Filenames should be all lowercase with hyphens as word separators. Expected test
We often use the [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading mechanism and therefore deviate from it.
### `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](https://github.com/FriendsOfPHP/PHP-CS-Fixer):
```
php-cs-fixer fix --rules @PHP54Migration ./src/
```
[![Pronamic - Work with us](https://github.com/pronamic/brand-resources/blob/main/banners/pronamic-work-with-us-leaderboard-728x90%404x.png)](https://www.pronamic.eu/contact/)
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@
"squizlabs/php_codesniffer": "^3.6",
"wp-coding-standards/wpcs": "^2.3"
},
"prefer-stable": true
"prefer-stable": true,
"scripts": {
"test": [
"vendor/bin/phpcs --standard=PronamicWP tests/test.php"
]
}
}
12 changes: 12 additions & 0 deletions tests/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Test.
*
* @package PronamicWP
*/

$test = [
'a',
'b',
'c',
];

0 comments on commit d58a6b1

Please sign in to comment.