Skip to content

Commit 4c0104b

Browse files
committed
Merge remote-tracking branch 'upstream/4.x' into issue-1286/polyfill-tokenizer-const-as-int
2 parents 4e2f826 + c4adbbc commit 4c0104b

File tree

93 files changed

+2640
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2640
-236
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ To run the tests specific to the use of `PHP_CODESNIFFER_CBF === true`:
399399

400400
### Writing End-to-End Tests
401401

402-
Bash-based end-to-end tests can be written using the [Bashunit](https://bashunit.typeddevs.com/) test tooling.
402+
Bash-based end-to-end tests can be written using the [Bashunit](https://bashunit.typeddevs.com/) test tooling using version 0.26.0 or higher.
403403

404404
To install bashunit, follow the [installation guide](https://bashunit.typeddevs.com/installation).
405405

.github/workflows/build-phar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
matrix:
4747
# Deliberately missing PHP 8.0 as that PHAR is build and used in the test workflow.
48-
php: ['7.2', '7.3', '7.4', '8.1', '8.2', '8.3', '8.4', 'nightly']
48+
php: ['7.2', '7.3', '7.4', '8.1', '8.2', '8.3', '8.4', '8.5', 'nightly']
4949

5050
name: "Build Phar on PHP: ${{ matrix.php }}"
5151

.github/workflows/end-to-end-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ jobs:
2727

2828
strategy:
2929
matrix:
30-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
30+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', 'nightly']
3131

3232
# yamllint disable-line rule:line-length
3333
name: "E2E PHP: ${{ matrix.php }}"
3434

35-
continue-on-error: ${{ matrix.php == '8.5' }}
35+
continue-on-error: ${{ matrix.php == 'nightly' }}
3636

3737
steps:
3838
- name: Prepare git to leave line endings alone
3939
run: git config --global core.autocrlf input
4040

4141
- name: Checkout code
42-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
42+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4343

4444
- name: Install PHP
4545
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5

.github/workflows/happy-new-year.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: "echo current year: ${{ steps.year.outputs.NEW_YEAR }} - previous year: ${{ steps.year.outputs.PREVIOUS_YEAR }}"
5050

5151
- name: Checkout code
52-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
52+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5353
with:
5454
ref: ${{ steps.branches.outputs.BASE }}
5555

@@ -73,7 +73,7 @@ jobs:
7373
run: exit 1
7474

7575
- name: Create pull request
76-
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
76+
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
7777
with:
7878
base: ${{ steps.branches.outputs.BASE }}
7979
branch: ${{ steps.branches.outputs.PR_BRANCH }}

.github/workflows/label-new-prs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
steps:
3939
# Checkout is needed to use the `use_local_config` option.
4040
- name: Checkout code
41-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4242

4343
- name: Verify changes to the labeling logic
4444
uses: srvaroa/labeler@0a20eccb8c94a1ee0bed5f16859aece1c45c3e55 # v1.13.0

.github/workflows/quicktest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: git config --global core.autocrlf input
3939

4040
- name: Checkout code
41-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
4242

4343
- name: Install PHP
4444
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5

.github/workflows/reusable-build-phar.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
steps:
3535
- name: Checkout code
36-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
36+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3737

3838
- name: Setup PHP
3939
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
@@ -56,7 +56,7 @@ jobs:
5656
5757
- name: Upload the PHPCS phar
5858
if: ${{ inputs.uploadArtifacts == true }}
59-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
59+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6060
with:
6161
name: phpcs-phar
6262
path: ./phpcs.phar
@@ -65,7 +65,7 @@ jobs:
6565

6666
- name: Upload the PHPCBF phar
6767
if: ${{ inputs.uploadArtifacts == true }}
68-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
68+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6969
with:
7070
name: phpcbf-phar
7171
path: ./phpcbf.phar

.github/workflows/test-requirements-check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
steps:
5353
- name: Checkout code
54-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
54+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5555

5656
- name: Install PHP
5757
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
@@ -93,7 +93,7 @@ jobs:
9393

9494
steps:
9595
- name: Checkout code
96-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
96+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
9797

9898
- name: Install PHP
9999
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
@@ -126,7 +126,7 @@ jobs:
126126

127127
steps:
128128
- name: Checkout code
129-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
129+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
130130

131131
- name: Install PHP
132132
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
@@ -193,7 +193,7 @@ jobs:
193193

194194
steps:
195195
- name: Checkout code
196-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
196+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
197197

198198
- name: Install PHP
199199
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
@@ -206,7 +206,7 @@ jobs:
206206
fail-fast: true
207207

208208
- name: Download the phar
209-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
209+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
210210
with:
211211
name: ${{ matrix.cmd }}-phar
212212

.github/workflows/test.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ jobs:
5454
# code conditions.
5555
matrix:
5656
os: ['ubuntu-latest', 'windows-latest']
57-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
57+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
5858
custom_ini: [false]
5959

6060
include:
6161
# Skip test runs on builds which are also run in the coverage job.
6262
- php: '7.2'
6363
skip_tests: true
64-
- php: '8.4'
64+
- php: '8.5'
6565
skip_tests: true
6666

6767
# Run a couple of builds with custom extensions to allow for testing ini handling within PHPCS.
@@ -88,27 +88,24 @@ jobs:
8888
- php: '7.4'
8989
os: 'ubuntu-latest'
9090
custom_ini: true
91-
- php: '8.3'
92-
os: 'ubuntu-latest'
93-
custom_ini: true
94-
- php: '8.0'
91+
- php: '8.1'
9592
os: 'ubuntu-latest'
9693
custom_ini: true
97-
- php: '8.2'
94+
- php: '8.3'
9895
os: 'ubuntu-latest'
9996
custom_ini: true
10097

10198
# yamllint disable-line rule:line-length
10299
name: "PHP: ${{ matrix.php }} ${{ matrix.custom_ini && ' with custom ini settings' || '' }}${{ matrix.libxml_minor && format( ' with libxml {0}', matrix.libxml_minor ) || '' }} (${{ matrix.os == 'ubuntu-latest' && 'Linux' || 'Win' }})"
103100

104-
continue-on-error: ${{ matrix.php == '8.5' }}
101+
continue-on-error: ${{ matrix.php == '8.6' }}
105102

106103
steps:
107104
- name: Prepare git to leave line endings alone
108105
run: git config --global core.autocrlf input
109106

110107
- name: Checkout code
111-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
108+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
112109

113110
- name: "libxml2: find the latest relevant tag"
114111
if: ${{ matrix.libxml_minor }}
@@ -204,7 +201,7 @@ jobs:
204201
- name: Install Composer dependencies
205202
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # 3.1.1
206203
with:
207-
composer-options: ${{ matrix.php == '8.5' && '--ignore-platform-req=php+' || '' }}
204+
composer-options: ${{ matrix.php == '8.6' && '--ignore-platform-req=php+' || '' }}
208205
custom-cache-suffix: $(date -u "+%Y-%m")
209206

210207
- name: Grab PHPUnit version
@@ -236,14 +233,14 @@ jobs:
236233
run: php "vendor/bin/phpunit" -c ${{ steps.phpunit_config.outputs.FILE }} --no-coverage
237234

238235
# Do one test run against the complete test suite in CBF mode to ensure all tests can run in CBF mode.
239-
- name: 'PHPUnit: run the full test suite without code coverage in CBF mode (PHP 8.3 only)'
240-
if: ${{ matrix.php == '8.3' }}
236+
- name: 'PHPUnit: run the full test suite without code coverage in CBF mode (PHP 8.4 only)'
237+
if: ${{ matrix.php == '8.4' }}
241238
run: php "vendor/bin/phpunit" -c ${{ steps.phpunit_config.outputs.FILE }} --exclude-group nothing --no-coverage
242239
env:
243240
PHP_CODESNIFFER_CBF: '1'
244241

245242
- name: 'PHPUnit: run select tests in CBF mode'
246-
if: ${{ matrix.skip_tests != true && matrix.php != '8.3' }}
243+
if: ${{ matrix.skip_tests != true && matrix.php != '8.4' }}
247244
run: >
248245
php "vendor/bin/phpunit" -c ${{ steps.phpunit_config.outputs.FILE }} --no-coverage
249246
--group CBF --exclude-group nothing
@@ -258,7 +255,7 @@ jobs:
258255

259256
- name: Download the PHPCS phar
260257
if: ${{ matrix.custom_ini == false }}
261-
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
258+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
262259
with:
263260
name: phpcs-phar
264261

@@ -275,22 +272,22 @@ jobs:
275272
strategy:
276273
matrix:
277274
os: ['ubuntu-latest', 'windows-latest']
278-
# Note: we can only run code coverage builds against PHP 7.2 and PHP 8.4 or higher:
275+
# Note: we can only run code coverage builds against PHP 7.2 and PHP 8.5 or higher:
279276
# - PHP 7.2 will work as it uses PHPUnit 8, which doesn't use PHP Parser yet.
280277
# - As of PHPUnit 9.3 (PHP 7.3+), PHPUnit started using PHP Parser for code coverage, and PHP Parser
281278
# also polyfills tokens, but to different (integer) values.
282279
# - Additionally, PHP Parser will block PHPUnit from running with a fatal error if it detects
283280
# non-integer values for polyfilled tokens.... _sigh_.
284281
# - So, aside from PHP 7.2, we can only run code coverage on the last PHP version (or higher)
285282
# which added a new token, which is polyfilled by both.
286-
# At the time of writing, this means PHP 8.4 or higher.
287-
php: ['7.2', '8.4']
283+
# At the time of writing, this means PHP 8.5 or higher.
284+
php: ['7.2', '8.5']
288285
custom_ini: [false]
289286

290287
include:
291288
# Also run one coverage build with custom ini settings for testing the DisallowShortOpenTag sniff.
292289
# Also run with a disabled extension for testing the handling of unsettable ini settings by PHPCS.
293-
- php: '8.4'
290+
- php: '8.5'
294291
os: 'ubuntu-latest'
295292
custom_ini: true
296293
extensions: ':mysqli' # Run with mysqli disabled.
@@ -303,7 +300,7 @@ jobs:
303300
run: git config --global core.autocrlf input
304301

305302
- name: Checkout code
306-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
303+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
307304

308305
- name: Setup ini config
309306
if: ${{ matrix.custom_ini == true && matrix.os != 'windows-latest' }}
@@ -393,7 +390,7 @@ jobs:
393390
394391
- name: "Upload coverage results to Coveralls (normal run)"
395392
if: ${{ success() }}
396-
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
393+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
397394
with:
398395
format: clover
399396
file: build/logs/clover.xml
@@ -402,7 +399,7 @@ jobs:
402399

403400
- name: "Upload coverage results to Coveralls (CBF run)"
404401
if: ${{ matrix.os != 'windows-latest' && success() }}
405-
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
402+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
406403
with:
407404
format: clover
408405
file: build/logs/clover-cbf.xml
@@ -418,6 +415,6 @@ jobs:
418415

419416
steps:
420417
- name: Coveralls Finished
421-
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.6
418+
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
422419
with:
423420
parallel-finished: true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Validate Cronjob
2+
3+
on:
4+
# Run this workflow every Monday at 6:00 (to make sure the broken link check runs regularly).
5+
schedule:
6+
- cron: '0 6 * * 1'
7+
8+
# Cancels all previous workflow runs for the same branch that have not yet completed.
9+
concurrency:
10+
# The concurrency group contains the workflow name and the branch name.
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
markdownlint:
16+
name: 'Lint Markdown'
17+
# Don't run the cronjob in this workflow on forks.
18+
if: ${{ github.event.repository.fork == false }}
19+
20+
uses: PHPCSStandards/.github/.github/workflows/reusable-markdownlint.yml@main
21+
22+
remark:
23+
name: 'QA Markdown'
24+
# Don't run the cronjob in this workflow on forks.
25+
if: ${{ github.event.repository.fork == false }}
26+
27+
uses: PHPCSStandards/.github/.github/workflows/reusable-remark.yml@main

0 commit comments

Comments
 (0)