Skip to content

Commit

Permalink
Merge pull request #301 from PHPCSStandards/develop
Browse files Browse the repository at this point in the history
Release PHPCSExtra 1.2.1
  • Loading branch information
jrfnl committed Dec 8, 2023
2 parents 78b2cae + 4abbe75 commit 11d387c
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 50 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ jobs:

- name: 'Composer: adjust dependencies'
run: |
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
composer remove --no-update --dev phpunit/phpunit --no-scripts --no-interaction
# Using PHPCS `master` as an early detection system for bugs upstream.
composer require --no-update squizlabs/php_codesniffer:"dev-master" --no-interaction
Expand Down Expand Up @@ -107,7 +105,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: 'latest'
coverage: none
tools: phpstan

Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,12 @@ jobs:

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

# For PHP "latest", we need to install with ignore platform reqs as not all PHPUnit 7.x dependencies allow it.
- name: Install Composer dependencies - with ignore platform
if: matrix.php == 'latest'
uses: "ramsey/composer-install@v2"
with:
composer-options: --ignore-platform-req=php+
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: >
Expand All @@ -86,10 +77,5 @@ jobs:
if: matrix.phpcs_version == 'dev-master'
run: composer lint

- name: Run the unit tests - PHP 5.4 - 8.0
if: matrix.php != 'latest'
- name: Run the unit tests
run: composer test

- name: Run the unit tests - PHP > 8.1
if: matrix.php == 'latest'
run: composer test -- --no-configuration --bootstrap=phpunit-bootstrap.php --dont-report-useless-tests
23 changes: 4 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# @link https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
#
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1', '8.2', '8.3', '8.4']
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.4']
phpcs_version: ['lowest', 'dev-master']

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

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

# For the PHP 8/"nightly", we need to install with ignore platform reqs as we're still using PHPUnit 7.
- name: Install Composer dependencies - with ignore platform
if: ${{ startsWith( matrix.php, '8' ) }}
uses: "ramsey/composer-install@v2"
with:
composer-options: --ignore-platform-req=php+
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
if: ${{ matrix.phpcs_version == 'lowest' }}
run: >
Expand All @@ -92,14 +83,9 @@ jobs:
if: matrix.phpcs_version == 'dev-master'
run: composer lint

- name: Run the unit tests - PHP 5.4 - 8.0
if: ${{ matrix.php < '8.1' }}
- name: Run the unit tests
run: composer test

- name: Run the unit tests - PHP > 8.1
if: ${{ matrix.php >= '8.1' }}
run: composer test -- --no-configuration --bootstrap=phpunit-bootstrap.php --dont-report-useless-tests

#### CODE COVERAGE STAGE ####
# N.B.: Coverage is only checked on the lowest and highest stable PHP versions
# and a low/high of each major for PHPCS.
Expand All @@ -114,8 +100,7 @@ jobs:

strategy:
matrix:
# 7.4 should be updated to 8.2 when higher PHPUnit versions can be supported.
php: ['5.4', '7.4']
php: ['5.4', '8.3']
phpcs_version: ['lowest', 'dev-master']

name: "Coverage${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses

_Nothing yet._

## [1.2.1] - 2023-12-08

### Changed

#### Other

* Composer: The minimum `PHP_CodeSniffer` requirement has been updated to `^3.8.0` (was `^3.7.2`). [#298]
* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.9` (was `^1.0.8`). [#298]

Please ensure you run `composer update phpcsstandards/phpcsextra --with-dependencies` to benefit from this.

[#298]: https://github.com/PHPCSStandards/PHPCSExtra/pull/298


## [1.2.0] - 2023-12-02

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

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

[Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD
[1.2.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.2...1.2.0
[1.1.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.0...1.1.1
Expand Down
2 changes: 1 addition & 1 deletion Modernize/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<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">
<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">

<description>A collection of sniffs to detect code modernization opportunities.</description>
</ruleset>
2 changes: 1 addition & 1 deletion NormalizedArrays/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<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">
<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">

<description>A ruleset for PHP_CodeSniffer to check arrays for normalized format.</description>
</ruleset>
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Minimum Requirements
-------------------------------------------

* PHP 5.4 or higher.
* [PHP_CodeSniffer][phpcs-gh] version **3.7.1** or higher.
* [PHPCSUtils][phpcsutils-gh] version **1.0.8** or higher.
* [PHP_CodeSniffer][phpcs-gh] version **3.8.0** or higher.
* [PHPCSUtils][phpcsutils-gh] version **1.0.9** or higher.


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

[phpcs-gh]: https://github.com/squizlabs/PHP_CodeSniffer
[phpcs-gh]: https://github.com/PHPCSStandards/PHP_CodeSniffer
[phpcsutils-gh]: https://github.com/PHPCSStandards/PHPCSUtils
[composer-installer-gh]: https://github.com/PHPCSStandards/composer-installer

[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
[php_version-config]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
2 changes: 1 addition & 1 deletion Universal/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<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">
<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">

<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>
</ruleset>
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
},
"require" : {
"php" : ">=5.4",
"squizlabs/php_codesniffer" : "^3.7.1",
"phpcsstandards/phpcsutils" : "^1.0.8"
"squizlabs/php_codesniffer" : "^3.8.0",
"phpcsstandards/phpcsutils" : "^1.0.9"
},
"require-dev" : {
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"php-parallel-lint/php-console-highlighter": "^1.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"phpcsstandards/phpcsdevtools": "^1.2.1",
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0"
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},
"extra": {
"branch-alias": {
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->

Expand Down

0 comments on commit 11d387c

Please sign in to comment.