Skip to content

Commit 18b2361

Browse files
committed
Changelog and readme updates for PHPCSExtra 1.0.2
1 parent 39ac431 commit 18b2361

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses
1414

1515
_Nothing yet._
1616

17+
## [1.0.2] - 2023-01-10
18+
19+
### Changed
20+
21+
#### Universal
22+
23+
* `Universal.CodeAnalysis.ConstructorDestructorReturn`: the sniff will now respect a potentially set [`php_version` configuration option][php_version-config] and only report on PHP4-style constructors when the `php_version` is below `'80000'`. Thanks [@anomiex] for reporting! [#207], [#208]
24+
25+
[#207]: https://github.com/PHPCSStandards/PHPCSExtra/issues/207
26+
[#208]: https://github.com/PHPCSStandards/PHPCSExtra/pull/208
27+
1728

1829
## [1.0.1] - 2023-01-05
1930

@@ -221,7 +232,6 @@ The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which pote
221232

222233
[php-manual-dirname]: https://www.php.net/function.dirname
223234
[php-rfc-negative_array_index]: https://wiki.php.net/rfc/negative_array_index
224-
[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
225235
[ESLint "no lonely if"]: https://eslint.org/docs/rules/no-lonely-if
226236
[PHPCSUtils 1.0.0-alpha4]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0-alpha4
227237

@@ -385,8 +395,10 @@ This initial alpha release contains the following sniffs:
385395
Individual sub-types can be allowed by excluding specific error codes.
386396

387397
[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer
398+
[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
388399

389400
[Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD
401+
[1.0.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.1...1.0.2
390402
[1.0.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0...1.0.1
391403
[1.0.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-rc1...1.0.0
392404
[1.0.0-RC1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0-alpha3...1.0.0-rc1

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ The sniff will make a distinction between keys which will be duplicate in all PH
177177
If a [`php_version` configuration option][php_version-config] has been passed to PHPCS using either `--config-set` or `--runtime-set`, it will be respected by the sniff and only report duplicate keys for the configured PHP version.
178178

179179
[php-rfc-negative_array_index]: https://wiki.php.net/rfc/negative_array_index
180-
[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
181180

182181
#### `Universal.Arrays.MixedArrayKeyTypes` :books:
183182

@@ -218,6 +217,9 @@ Require a consistent modifier keyword order for class declarations.
218217
* Disallows return type declarations on constructor/destructor methods - error code: `ReturnTypeFound`, auto-fixable.
219218
* Discourages constructor/destructor methods returning a value - error code: `ReturnValueFound`.
220219

220+
If a [`php_version` configuration option][php_version-config] has been passed to PHPCS using either `--config-set` or `--runtime-set`, it will be respected by the sniff.
221+
In effect, this means that the sniff will only report on PHP4-style constructors if the configured PHP version is less than 8.0.
222+
221223
#### `Universal.CodeAnalysis.ForeachUniqueAssignment` :wrench: :books:
222224

223225
Detects `foreach` control structures which use the same variable for both the key as well as the value assignment as this will lead to unexpected - and most likely unintended - behaviour.
@@ -478,3 +480,5 @@ This code is released under the GNU Lesser General Public License (LGPLv3). For
478480
[phpcs-gh]: https://github.com/squizlabs/PHP_CodeSniffer
479481
[phpcsutils-gh]: https://github.com/PHPCSStandards/PHPCSUtils
480482
[composer-installer-gh]: https://github.com/PHPCSStandards/composer-installer
483+
484+
[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version

0 commit comments

Comments
 (0)