Skip to content

Commit 8d0f11f

Browse files
committed
Merge remote-tracking branch 'origin/2.1.x' into patch-generator_type_missing
2 parents d80d711 + 2dc57b3 commit 8d0f11f

File tree

812 files changed

+32736
-4565
lines changed

Some content is hidden

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

812 files changed

+32736
-4565
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'Downgrade code'
2+
description: 'Downgrade code'
3+
inputs:
4+
php-version:
5+
description: 'Original PHP version'
6+
required: true
7+
runs:
8+
using: "composite"
9+
steps:
10+
11+
- name: "Change to simple-downgrade PHP version"
12+
if: inputs.php-version == '7.4' || inputs.php-version == '8.0' || inputs.php-version == '8.1'
13+
uses: "shivammathur/setup-php@v2"
14+
with:
15+
coverage: "none"
16+
php-version: "8.4"
17+
18+
- name: "Transform source code"
19+
if: inputs.php-version == '7.4' || inputs.php-version == '8.0' || inputs.php-version == '8.1'
20+
shell: bash
21+
run: |
22+
composer install --no-interaction --no-progress --working-dir=compiler
23+
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ inputs.php-version }}
24+
composer dump
25+
26+
- name: "Re-store PHP version"
27+
if: inputs.php-version == '7.4' || inputs.php-version == '8.0' || inputs.php-version == '8.1'
28+
uses: "shivammathur/setup-php@v2"
29+
with:
30+
coverage: "none"
31+
php-version: "${{ inputs.php-version }}"
32+
ini-file: development
33+
extensions: ds,mbstring

.github/workflows/apiref.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ jobs:
3737
coverage: "none"
3838
php-version: "8.2"
3939

40-
- name: "Install dependencies"
41-
run: "composer install --no-interaction --no-progress"
40+
- uses: "ramsey/composer-install@v3"
4241

4342
- name: "Install ApiGen dependencies"
44-
working-directory: "apigen"
45-
run: "composer install --no-interaction --no-progress"
43+
uses: "ramsey/composer-install@v3"
44+
with:
45+
working-directory: "apigen"
4646

4747
- name: "Run ApiGen"
4848
run: "apigen/vendor/bin/apigen -c apigen/apigen.neon --output docs -- src vendor/nikic/php-parser vendor/ondrejmirtes/better-reflection vendor/phpstan/phpdoc-parser"

.github/workflows/backward-compatibility.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ jobs:
3434
coverage: "none"
3535
php-version: "8.2"
3636

37-
- name: "Install dependencies"
38-
run: "composer install --no-dev --no-interaction --no-progress"
37+
- uses: "ramsey/composer-install@v3"
3938

4039
- name: "Install BackwardCompatibilityCheck"
4140
run: |

.github/workflows/build-issue-bot.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
uses: "shivammathur/setup-php@v2"
4141
with:
4242
coverage: "none"
43-
php-version: "8.3"
43+
php-version: "8.5"
4444

45-
- name: "Install dependencies"
46-
run: "composer install --no-interaction --no-progress"
45+
- uses: "ramsey/composer-install@v3"
4746

48-
- name: "Install Issue Bot dependencies"
49-
working-directory: "issue-bot"
50-
run: "composer install --no-interaction --no-progress"
47+
- name: "Install issue-bot dependencies"
48+
uses: "ramsey/composer-install@v3"
49+
with:
50+
working-directory: "issue-bot"
5151

5252
- name: "Tests"
5353
working-directory: "issue-bot"

.github/workflows/changelog-generator.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ jobs:
3535
coverage: "none"
3636
php-version: "8.2"
3737

38-
- name: "Install dependencies"
39-
run: "composer install --no-interaction --no-progress"
38+
- uses: "ramsey/composer-install@v3"
4039

4140
- name: "Install Changelog Generator dependencies"
42-
working-directory: "changelog-generator"
43-
run: "composer install --no-interaction --no-progress"
41+
uses: "ramsey/composer-install@v3"
42+
with:
43+
working-directory: "changelog-generator"
4444

4545
- name: "PHPStan"
4646
working-directory: "changelog-generator"

.github/workflows/e2e-tests.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ jobs:
285285
- script: |
286286
cd e2e/bug-10483
287287
../../bin/phpstan
288+
- script: |
289+
cd e2e/stub-files-errors
290+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan")
291+
echo "$OUTPUT"
292+
../bashunit -a contains 'Method StubFiles\Foo::doFoo() has no return type specified.' "$OUTPUT"
293+
OUTPUT=$(../bashunit -a exit_code "1" "../../bin/phpstan")
294+
echo "$OUTPUT"
295+
../bashunit -a contains 'Method StubFiles\Foo::doFoo() has no return type specified.' "$OUTPUT"
288296
289297
steps:
290298
- name: "Checkout"
@@ -298,8 +306,7 @@ jobs:
298306
extensions: mbstring
299307
ini-values: memory_limit=256M
300308

301-
- name: "Install dependencies"
302-
run: "composer install --no-interaction --no-progress"
309+
- uses: "ramsey/composer-install@v3"
303310

304311
- name: "Patch PHPStan"
305312
run: "patch src/Analyser/Error.php < e2e/PHPStanErrorPatch.patch"
@@ -411,8 +418,7 @@ jobs:
411418
tools: ${{ matrix.tools }}
412419
extensions: ${{ matrix.extensions }}
413420

414-
- name: "Install dependencies"
415-
run: "composer install --no-interaction --no-progress"
421+
- uses: "ramsey/composer-install@v3"
416422

417423
- name: "Install bashunit"
418424
run: "curl -s https://bashunit.typeddevs.com/install.sh | bash -s e2e/ 0.22.0"

.github/workflows/issue-bot.yml

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: "ubuntu-latest"
2929

3030
outputs:
31-
matrix: ${{ steps.download-data.outputs.matrix }}
31+
matrix: ${{ steps.shards.outputs.shards }}
3232

3333
steps:
3434
- name: "Checkout"
@@ -38,11 +38,12 @@ jobs:
3838
uses: "shivammathur/setup-php@v2"
3939
with:
4040
coverage: "none"
41-
php-version: "8.3"
41+
php-version: "8.5"
4242

43-
- name: "Install Issue Bot dependencies"
44-
working-directory: "issue-bot"
45-
run: "composer install --no-interaction --no-progress"
43+
- name: "Install issue-bot dependencies"
44+
uses: "ramsey/composer-install@v3"
45+
with:
46+
working-directory: "issue-bot"
4647

4748
- name: "Cache downloads"
4849
uses: actions/cache@v4
@@ -54,11 +55,15 @@ jobs:
5455
5556
- name: "Download data"
5657
working-directory: "issue-bot"
57-
id: download-data
5858
env:
5959
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
60-
run: echo "matrix=$(./console.php download)" >> $GITHUB_OUTPUT
60+
run: ./console.php download > matrix.json
6161

62+
- name: "Output shards"
63+
id: shards
64+
working-directory: "issue-bot"
65+
run: |
66+
echo "shards=$(jq -c '{include: [range(length) | {shard: .}]}' matrix.json)" >> $GITHUB_OUTPUT
6267
6368
- uses: actions/upload-artifact@v4
6469
with:
@@ -70,6 +75,11 @@ jobs:
7075
name: issue-cache
7176
path: issue-bot/tmp/issueCache.tmp
7277

78+
- uses: actions/upload-artifact@v4
79+
with:
80+
name: matrix
81+
path: issue-bot/matrix.json
82+
7383
analyse:
7484
name: "Analyse"
7585
needs: download
@@ -88,14 +98,16 @@ jobs:
8898
uses: "shivammathur/setup-php@v2"
8999
with:
90100
coverage: "none"
91-
php-version: "8.3"
101+
php-version: "8.5"
92102

93-
- name: "Install dependencies"
94-
run: "composer install --no-interaction --no-progress --no-dev"
103+
- uses: "ramsey/composer-install@v3"
104+
with:
105+
composer-options: "--no-dev"
95106

96-
- name: "Install Issue Bot dependencies"
97-
working-directory: "issue-bot"
98-
run: "composer install --no-interaction --no-progress"
107+
- name: "Install issue-bot dependencies"
108+
uses: "ramsey/composer-install@v3"
109+
with:
110+
working-directory: "issue-bot"
99111

100112
- uses: Wandalen/wretry.action@v3.8.0
101113
with:
@@ -106,15 +118,32 @@ jobs:
106118
attempt_limit: 5
107119
attempt_delay: 1000
108120

121+
- uses: Wandalen/wretry.action@v3.8.0
122+
with:
123+
action: actions/download-artifact@v4
124+
with: |
125+
name: matrix
126+
path: issue-bot
127+
attempt_limit: 5
128+
attempt_delay: 1000
129+
130+
- name: "Extract shard"
131+
working-directory: "issue-bot"
132+
id: chunk
133+
run: |
134+
echo "phpVersion=$(jq -r '.[${{ matrix.shard }}].phpVersion' matrix.json)" >> "$GITHUB_OUTPUT"
135+
echo "playgroundExamples=$(jq -r '.[${{ matrix.shard }}].playgroundExamples' matrix.json)" >> "$GITHUB_OUTPUT"
136+
echo "chunkNumber=$(jq -r '.[${{ matrix.shard }}].chunkNumber' matrix.json)" >> "$GITHUB_OUTPUT"
137+
109138
- name: "Run PHPStan"
110139
working-directory: "issue-bot"
111140
timeout-minutes: 5
112-
run: ./console.php run ${{ matrix.phpVersion }} ${{ matrix.playgroundExamples }}
141+
run: ./console.php run ${{ steps.chunk.outputs.phpVersion }} ${{ steps.chunk.outputs.playgroundExamples }}
113142

114143
- uses: actions/upload-artifact@v4
115144
with:
116-
name: results-${{ matrix.phpVersion }}-${{ matrix.chunkNumber }}
117-
path: issue-bot/tmp/results-${{ matrix.phpVersion }}-*.tmp
145+
name: results-${{ steps.chunk.outputs.phpVersion }}-${{ steps.chunk.outputs.chunkNumber }}
146+
path: issue-bot/tmp/results-${{ steps.chunk.outputs.phpVersion }}-*.tmp
118147

119148
evaluate:
120149
name: "Evaluate results"
@@ -130,11 +159,12 @@ jobs:
130159
uses: "shivammathur/setup-php@v2"
131160
with:
132161
coverage: "none"
133-
php-version: "8.3"
162+
php-version: "8.5"
134163

135-
- name: "Install Issue Bot dependencies"
136-
working-directory: "issue-bot"
137-
run: "composer install --no-interaction --no-progress"
164+
- name: "Install issue-bot dependencies"
165+
uses: "ramsey/composer-install@v3"
166+
with:
167+
working-directory: "issue-bot"
138168

139169
- uses: actions/download-artifact@v4
140170
with:

.github/workflows/lint.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,11 @@ jobs:
4444
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
4545
run: "composer require --dev phpunit/phpunit:^9.6 sebastian/diff:^4.0 --update-with-dependencies --ignore-platform-reqs"
4646

47-
- name: "Install dependencies"
48-
run: "composer install --no-interaction --no-progress"
47+
- uses: "ramsey/composer-install@v3"
4948

50-
- name: "Transform source code"
51-
if: matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
52-
run: |
53-
composer install --no-interaction --no-progress --working-dir=compiler
54-
./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
55-
composer dump
49+
- uses: ./.github/actions/downgrade-code
50+
with:
51+
php-version: "${{ matrix.php-version }}"
5652

5753
- name: "Validate Composer"
5854
run: "composer validate"
@@ -86,12 +82,12 @@ jobs:
8682
- name: "Validate Composer"
8783
run: "composer validate"
8884

89-
- name: "Install dependencies"
90-
run: "composer install --no-interaction --no-progress"
85+
- uses: "ramsey/composer-install@v3"
9186

9287
- name: "Install build-cs dependencies"
93-
working-directory: "build-cs"
94-
run: "composer install --no-interaction --no-progress"
88+
uses: "ramsey/composer-install@v3"
89+
with:
90+
working-directory: "build-cs"
9591

9692
- name: "Lint"
9793
run: "make lint"
@@ -113,10 +109,9 @@ jobs:
113109
uses: "shivammathur/setup-php@v2"
114110
with:
115111
coverage: "none"
116-
php-version: "8.3"
112+
php-version: "8.5"
117113

118-
- name: "Install dependencies"
119-
run: "composer install --no-interaction --no-progress"
114+
- uses: "ramsey/composer-install@v3"
120115

121116
- name: "Composer Dependency Analyser"
122117
run: "make composer-dependency-analyser"
@@ -135,10 +130,9 @@ jobs:
135130
uses: "shivammathur/setup-php@v2"
136131
with:
137132
coverage: "none"
138-
php-version: "8.4"
133+
php-version: "8.5"
139134

140-
- name: "Install dependencies"
141-
run: "composer install --no-interaction --no-progress"
135+
- uses: "ramsey/composer-install@v3"
142136

143137
- name: "Name Collision Detector"
144138
run: "make name-collision"

.github/workflows/phar.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ jobs:
3838
php-version: "8.2"
3939
extensions: mbstring, intl
4040

41-
- name: "Install dependencies"
42-
run: "composer install --no-interaction --no-progress"
41+
- uses: "ramsey/composer-install@v3"
4342

4443
# only sebastian/diff ^4 supports PHP 7.4 so we need that in the PHAR
4544
- name: "Downgrade PHPUnit"
4645
run: "composer require --dev phpunit/phpunit:^9.6 sebastian/diff:^4.0 --update-with-dependencies --ignore-platform-reqs"
4746

4847
- name: "Install compiler dependencies"
49-
run: "composer install --no-interaction --no-progress --working-dir=compiler"
48+
uses: "ramsey/composer-install@v3"
49+
with:
50+
working-directory: "compiler"
5051

5152
- name: "Compiler tests"
5253
working-directory: "compiler"
@@ -64,12 +65,13 @@ jobs:
6465
run: "composer dump"
6566

6667
- name: "Install Box dependencies"
67-
working-directory: "compiler/box"
68-
run: "composer install"
68+
uses: "ramsey/composer-install@v3"
69+
with:
70+
working-directory: "compiler/box"
6971

7072
- name: "Compile PHAR"
7173
working-directory: "compiler/build"
72-
run: "php ../box/vendor/bin/box compile --no-parallel"
74+
run: "php ../box/vendor/bin/box compile --no-parallel --sort-compiled-files"
7375

7476
- uses: actions/upload-artifact@v4
7577
with:
@@ -86,14 +88,13 @@ jobs:
8688
- name: "Set autoloader suffix"
8789
run: "composer config autoloader-suffix PHPStanChecksum"
8890

89-
- name: "Composer dump"
90-
run: "composer install --no-interaction --no-progress"
91+
- uses: "ramsey/composer-install@v3"
9192
env:
9293
COMPOSER_ROOT_VERSION: "2.1.x-dev"
9394

9495
- name: "Compile PHAR for checksum"
9596
working-directory: "compiler/build"
96-
run: "php ../box/vendor/bin/box compile --no-parallel"
97+
run: "php ../box/vendor/bin/box compile --no-parallel --sort-compiled-files"
9798
env:
9899
PHAR_CHECKSUM: "1"
99100
COMPOSER_ROOT_VERSION: "2.1.x-dev"
@@ -250,12 +251,12 @@ jobs:
250251
coverage: "none"
251252
php-version: "8.2"
252253

253-
- name: "Install dependencies"
254-
run: "composer install --no-interaction --no-progress"
254+
- uses: "ramsey/composer-install@v3"
255255

256256
- name: "Install Box dependencies"
257-
working-directory: "compiler/box"
258-
run: "composer install"
257+
uses: "ramsey/composer-install@v3"
258+
with:
259+
working-directory: "compiler/box"
259260

260261
- name: "Extract old phpstan.phar"
261262
run: "php compiler/box/vendor/bin/box extract phar-file-checksum-base/phpstan.phar phar-old"

0 commit comments

Comments
 (0)