Skip to content

Commit 442a6a9

Browse files
committed
build: completely drop phpcs version 3.x.
It's too much work to make it work with phpcs 3.x with so many differences.
1 parent ce9e673 commit 442a6a9

File tree

3 files changed

+2
-43
lines changed

3 files changed

+2
-43
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,7 @@ jobs:
6363
#
6464
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
6565
php: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
66-
phpcs_version: ["lowest", "stable", "4.x-dev"]
67-
68-
exclude:
69-
- php: "8.3"
70-
phpcs_version: "lowest"
71-
72-
include:
73-
# Add some builds with variations of the dependency versions.
74-
- php: "8.4"
75-
phpcs_version: "stable"
76-
77-
# Test against dev versions of all dependencies with select PHP versions for early detection of issues.
78-
- php: "7.2"
79-
phpcs_version: "dev-master"
80-
- php: "7.2"
81-
phpcs_version: "4.x-dev"
82-
- php: "7.4"
83-
phpcs_version: "4.x-dev"
84-
- php: "8.2"
85-
phpcs_version: "4.x-dev"
66+
phpcs_version: ["4.x-dev"]
8667

8768
name: "Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
8869

@@ -108,14 +89,6 @@ jobs:
10889
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
10990
coverage: none
11091

111-
- name: "Composer: set PHPCS version for tests (dev)"
112-
if: ${{ contains( matrix.phpcs_version, 'dev') }}
113-
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction
114-
115-
- name: "Composer: use lock file when necessary"
116-
if: ${{ matrix.phpcs_version == 'lowest' }}
117-
run: composer config --unset lock
118-
11992
# Install dependencies and handle caching in one go.
12093
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
12194
- name: Install Composer dependencies
@@ -124,10 +97,6 @@ jobs:
12497
# Bust the cache at least once a month - output format: YYYY-MM.
12598
custom-cache-suffix: $(date -u "+%Y-%m")
12699

127-
- name: "Composer: set PHPCS version for tests (lowest)"
128-
if: ${{ matrix.phpcs_version == 'lowest' }}
129-
run: composer update squizlabs/php_codesniffer --prefer-lowest --no-scripts --no-interaction
130-
131100
- name: Composer info
132101
run: composer info
133102

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"require": {
2020
"php": ">=7.2",
21-
"squizlabs/php_codesniffer": "^3.13||^4.0@dev",
21+
"squizlabs/php_codesniffer": "^4.0@dev",
2222
"dealerdirect/phpcodesniffer-composer-installer": "^1.1"
2323
},
2424
"require-dev": {

phpunit-bootstrap.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,3 @@
3737

3838
exit(1);
3939
}
40-
41-
// Alias the PHPCS 3.x test case to the PHPCS 4.x name.
42-
if (class_exists('PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest') === true
43-
&& class_exists('PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase') === false
44-
) {
45-
class_alias(
46-
'PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest',
47-
'PHP_CodeSniffer\Tests\Standards\AbstractSniffTestCase'
48-
);
49-
}

0 commit comments

Comments
 (0)