Skip to content

Commit be92eb7

Browse files
committed
Allow installing in PHP 8.2
1 parent b1c238d commit be92eb7

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

.github/workflows/test-php.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
strategy:
2424
matrix:
25-
php-versions: ['8.3', '8.4', '8.5']
25+
php-versions: ['8.2', '8.3', '8.4', '8.5']
2626

2727
steps:
2828
- name: Checkout code
@@ -42,7 +42,11 @@ jobs:
4242
ini-values: pcov.directory=.
4343

4444
- name: Install dependencies
45-
run: composer install ${{ matrix.php-versions == '8.5' && '--ignore-platform-reqs' || '' }}
45+
run: |
46+
if [ "${{ matrix.php-versions }}" == "8.2" ]; then
47+
composer require --dev phpunit/phpunit:^11 --no-update
48+
fi
49+
composer install ${{ matrix.php-versions == '8.5' && '--ignore-platform-reqs' || '' }}
4650
4751
- name: Validate composer.json
4852
run: |
@@ -54,11 +58,17 @@ jobs:
5458
continue-on-error: ${{ vars.CI_LINT_IGNORE_FAILURE == '1' }}
5559

5660
- name: Run tests
57-
run: composer test-coverage
61+
run: |
62+
if [ "${{ matrix.php-versions }}" != "8.2" ]; then
63+
composer test-coverage
64+
else
65+
composer test
66+
fi
5867
continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }}
5968

6069
- name: Upload coverage report as an artifact
6170
uses: actions/upload-artifact@v5
71+
if: ${{ matrix.php-versions != '8.2' }}
6272
with:
6373
name: ${{github.job}}-code-coverage-report-${{ matrix.php-versions }}
6474
path: .logs
@@ -67,7 +77,7 @@ jobs:
6777

6878
- name: Upload test results to Codecov
6979
uses: codecov/test-results-action@v1
70-
if: ${{ env.CODECOV_TOKEN != '' }}
80+
if: ${{ env.CODECOV_TOKEN != '' && matrix.php-versions != '8.2' }}
7181
with:
7282
files: .logs/junit.xml
7383
fail_ci_if_error: true
@@ -76,7 +86,7 @@ jobs:
7686

7787
- name: Upload coverage report to Codecov
7888
uses: codecov/codecov-action@v5
79-
if: ${{ env.CODECOV_TOKEN != '' }}
89+
if: ${{ env.CODECOV_TOKEN != '' && matrix.php-versions != '8.2' }}
8090
with:
8191
files: .logs/cobertura.xml
8292
fail_ci_if_error: true

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"source": "https://github.com/drevops/phpcs-standard"
1818
},
1919
"require": {
20-
"php": ">=8.3",
20+
"php": ">=8.2",
2121
"dealerdirect/phpcodesniffer-composer-installer": "^1",
2222
"squizlabs/php_codesniffer": "^3.10"
2323
},

src/DrevOps/Sniffs/NamingConventions/LocalVariableSnakeCaseSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class LocalVariableSnakeCaseSniff extends AbstractSnakeCaseSniff {
1717
/**
1818
* Error code for non-snake_case variables.
1919
*/
20-
public const string CODE_VARIABLE_NOT_SNAKE_CASE = 'NotSnakeCase';
20+
public const CODE_VARIABLE_NOT_SNAKE_CASE = 'NotSnakeCase';
2121

2222
/**
2323
* {@inheritdoc}

src/DrevOps/Sniffs/NamingConventions/ParameterSnakeCaseSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class ParameterSnakeCaseSniff extends AbstractSnakeCaseSniff {
1818
/**
1919
* Error code for non-snake_case parameters.
2020
*/
21-
public const string CODE_PARAMETER_NOT_SNAKE_CASE = 'NotSnakeCase';
21+
public const CODE_PARAMETER_NOT_SNAKE_CASE = 'NotSnakeCase';
2222

2323
/**
2424
* {@inheritdoc}

0 commit comments

Comments
 (0)