Skip to content

Commit 11d387c

Browse files
authored
Merge pull request #301 from PHPCSStandards/develop
Release PHPCSExtra 1.2.1
2 parents 78b2cae + 4abbe75 commit 11d387c

File tree

10 files changed

+34
-50
lines changed

10 files changed

+34
-50
lines changed

.github/workflows/basics.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ jobs:
4242

4343
- name: 'Composer: adjust dependencies'
4444
run: |
45-
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
46-
composer remove --no-update --dev phpunit/phpunit --no-scripts --no-interaction
4745
# Using PHPCS `master` as an early detection system for bugs upstream.
4846
composer require --no-update squizlabs/php_codesniffer:"dev-master" --no-interaction
4947
@@ -107,7 +105,7 @@ jobs:
107105
- name: Install PHP
108106
uses: shivammathur/setup-php@v2
109107
with:
110-
php-version: '7.4'
108+
php-version: 'latest'
111109
coverage: none
112110
tools: phpstan
113111

.github/workflows/quicktest.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,12 @@ jobs:
6161

6262
# Install dependencies and handle caching in one go.
6363
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
64-
- name: Install Composer dependencies - normal
65-
if: matrix.php != 'latest'
64+
- name: Install Composer dependencies
6665
uses: "ramsey/composer-install@v2"
6766
with:
6867
# Bust the cache at least once a month - output format: YYYY-MM.
6968
custom-cache-suffix: $(date -u "+%Y-%m")
7069

71-
# For PHP "latest", we need to install with ignore platform reqs as not all PHPUnit 7.x dependencies allow it.
72-
- name: Install Composer dependencies - with ignore platform
73-
if: matrix.php == 'latest'
74-
uses: "ramsey/composer-install@v2"
75-
with:
76-
composer-options: --ignore-platform-req=php+
77-
custom-cache-suffix: $(date -u "+%Y-%m")
78-
7970
- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
8071
if: ${{ matrix.phpcs_version == 'lowest' }}
8172
run: >
@@ -86,10 +77,5 @@ jobs:
8677
if: matrix.phpcs_version == 'dev-master'
8778
run: composer lint
8879

89-
- name: Run the unit tests - PHP 5.4 - 8.0
90-
if: matrix.php != 'latest'
80+
- name: Run the unit tests
9181
run: composer test
92-
93-
- name: Run the unit tests - PHP > 8.1
94-
if: matrix.php == 'latest'
95-
run: composer test -- --no-configuration --bootstrap=phpunit-bootstrap.php --dont-report-useless-tests

.github/workflows/test.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# @link https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
3333
#
3434
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
35-
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1', '8.2', '8.3', '8.4']
35+
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.4']
3636
phpcs_version: ['lowest', 'dev-master']
3737

3838
name: "Test${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
@@ -67,21 +67,12 @@ jobs:
6767

6868
# Install dependencies and handle caching in one go.
6969
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
70-
- name: Install Composer dependencies - normal
71-
if: ${{ startsWith( matrix.php, '8' ) == false }}
70+
- name: Install Composer dependencies
7271
uses: "ramsey/composer-install@v2"
7372
with:
7473
# Bust the cache at least once a month - output format: YYYY-MM.
7574
custom-cache-suffix: $(date -u "+%Y-%m")
7675

77-
# For the PHP 8/"nightly", we need to install with ignore platform reqs as we're still using PHPUnit 7.
78-
- name: Install Composer dependencies - with ignore platform
79-
if: ${{ startsWith( matrix.php, '8' ) }}
80-
uses: "ramsey/composer-install@v2"
81-
with:
82-
composer-options: --ignore-platform-req=php+
83-
custom-cache-suffix: $(date -u "+%Y-%m")
84-
8576
- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
8677
if: ${{ matrix.phpcs_version == 'lowest' }}
8778
run: >
@@ -92,14 +83,9 @@ jobs:
9283
if: matrix.phpcs_version == 'dev-master'
9384
run: composer lint
9485

95-
- name: Run the unit tests - PHP 5.4 - 8.0
96-
if: ${{ matrix.php < '8.1' }}
86+
- name: Run the unit tests
9787
run: composer test
9888

99-
- name: Run the unit tests - PHP > 8.1
100-
if: ${{ matrix.php >= '8.1' }}
101-
run: composer test -- --no-configuration --bootstrap=phpunit-bootstrap.php --dont-report-useless-tests
102-
10389
#### CODE COVERAGE STAGE ####
10490
# N.B.: Coverage is only checked on the lowest and highest stable PHP versions
10591
# and a low/high of each major for PHPCS.
@@ -114,8 +100,7 @@ jobs:
114100

115101
strategy:
116102
matrix:
117-
# 7.4 should be updated to 8.2 when higher PHPUnit versions can be supported.
118-
php: ['5.4', '7.4']
103+
php: ['5.4', '8.3']
119104
phpcs_version: ['lowest', 'dev-master']
120105

121106
name: "Coverage${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"

CHANGELOG.md

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

1515
_Nothing yet._
1616

17+
## [1.2.1] - 2023-12-08
18+
19+
### Changed
20+
21+
#### Other
22+
23+
* Composer: The minimum `PHP_CodeSniffer` requirement has been updated to `^3.8.0` (was `^3.7.2`). [#298]
24+
* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.9` (was `^1.0.8`). [#298]
25+
26+
Please ensure you run `composer update phpcsstandards/phpcsextra --with-dependencies` to benefit from this.
27+
28+
[#298]: https://github.com/PHPCSStandards/PHPCSExtra/pull/298
29+
30+
1731
## [1.2.0] - 2023-12-02
1832

1933
### Added
@@ -550,9 +564,10 @@ This initial alpha release contains the following sniffs:
550564
Individual sub-types can be allowed by excluding specific error codes.
551565

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

555569
[Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD
570+
[1.2.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.2.0...1.2.1
556571
[1.2.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.2...1.2.0
557572
[1.1.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.1...1.1.2
558573
[1.1.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.0...1.1.1

Modernize/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Modernize" namespace="PHPCSExtra\Modernize" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Modernize" namespace="PHPCSExtra\Modernize" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
33

44
<description>A collection of sniffs to detect code modernization opportunities.</description>
55
</ruleset>

NormalizedArrays/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="NormalizedArrays" namespace="PHPCSExtra\NormalizedArrays" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="NormalizedArrays" namespace="PHPCSExtra\NormalizedArrays" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
33

44
<description>A ruleset for PHP_CodeSniffer to check arrays for normalized format.</description>
55
</ruleset>

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Minimum Requirements
4646
-------------------------------------------
4747

4848
* PHP 5.4 or higher.
49-
* [PHP_CodeSniffer][phpcs-gh] version **3.7.1** or higher.
50-
* [PHPCSUtils][phpcsutils-gh] version **1.0.8** or higher.
49+
* [PHP_CodeSniffer][phpcs-gh] version **3.8.0** or higher.
50+
* [PHPCSUtils][phpcsutils-gh] version **1.0.9** or higher.
5151

5252

5353
Installation
@@ -566,8 +566,8 @@ This code is released under the [GNU Lesser General Public License (LGPLv3)](LIC
566566
[gha-qa-results]: https://github.com/PHPCSStandards/PHPCSExtra/actions/workflows/basics.yml
567567
[gha-test-results]: https://github.com/PHPCSStandards/PHPCSExtra/actions/workflows/test.yml
568568

569-
[phpcs-gh]: https://github.com/squizlabs/PHP_CodeSniffer
569+
[phpcs-gh]: https://github.com/PHPCSStandards/PHP_CodeSniffer
570570
[phpcsutils-gh]: https://github.com/PHPCSStandards/PHPCSUtils
571571
[composer-installer-gh]: https://github.com/PHPCSStandards/composer-installer
572572

573-
[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
573+
[php_version-config]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version

Universal/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Universal" namespace="PHPCSExtra\Universal" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Universal" namespace="PHPCSExtra\Universal" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
33

44
<description>A collection of universal sniffs. This standard is not designed to be used to check code. Include individual sniffs from this standard in a custom ruleset instead.</description>
55
</ruleset>

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
},
2323
"require" : {
2424
"php" : ">=5.4",
25-
"squizlabs/php_codesniffer" : "^3.7.1",
26-
"phpcsstandards/phpcsutils" : "^1.0.8"
25+
"squizlabs/php_codesniffer" : "^3.8.0",
26+
"phpcsstandards/phpcsutils" : "^1.0.9"
2727
},
2828
"require-dev" : {
2929
"php-parallel-lint/php-parallel-lint": "^1.3.2",
3030
"php-parallel-lint/php-console-highlighter": "^1.0",
3131
"phpcsstandards/phpcsdevcs": "^1.1.6",
3232
"phpcsstandards/phpcsdevtools": "^1.2.1",
33-
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0"
33+
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
3434
},
3535
"extra": {
3636
"branch-alias": {

phpcs.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!--
66
#############################################################################
77
COMMAND LINE ARGUMENTS
8-
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
8+
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
99
#############################################################################
1010
-->
1111

0 commit comments

Comments
 (0)