Skip to content

Commit a110e2f

Browse files
authored
[ci] merge jobs, add finalise check, bump to PHP 8.3 (#358)
* [ci] merge jobs * misc * bump to PHP 8.3
1 parent 7640420 commit a110e2f

File tree

44 files changed

+153
-240
lines changed

Some content is hidden

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

44 files changed

+153
-240
lines changed

.github/workflows/code_analysis.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,41 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
actions:
19-
-
20-
name: 'Active Classes'
21-
run: vendor/bin/class-leak check config src rules
2219
-
2320
name: "Validate docs"
2421
run: vendor/bin/rule-doc-generator validate src rules
2522

23+
-
24+
name: 'Active Classes'
25+
run: vendor/bin/class-leak check config src rules --ansi --skip-suffix "Rector" --skip-type "\Rector\Set\Contract\SetProviderInterface"
26+
27+
-
28+
name: "Finalize Classes"
29+
run: vendor/bin/swiss-knife finalize config src tests rules rules-tests --ansi
30+
31+
-
32+
name: 'Composer Validate'
33+
run: composer validate
34+
35+
-
36+
name: 'PHPStan'
37+
run: vendor/bin/phpstan
38+
39+
-
40+
name: 'Tests'
41+
run: vendor/bin/phpunit
42+
2643
name: ${{ matrix.actions.name }}
2744
runs-on: ubuntu-latest
28-
timeout-minutes: 10
45+
timeout-minutes: 3
2946

3047
steps:
3148
- uses: actions/checkout@v4
3249

3350
-
3451
uses: shivammathur/setup-php@v2
3552
with:
36-
php-version: 8.2
53+
php-version: 8.3
3754
coverage: none
3855

3956
- uses: "ramsey/composer-install@v2"

.github/workflows/code_analysis_reusable.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/rector.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# github action that checks code with Rector
2+
name: Rector
3+
4+
on:
5+
pull_request: null
6+
7+
env:
8+
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
9+
COMPOSER_ROOT_VERSION: "dev-main"
10+
11+
jobs:
12+
rector:
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.head.repo.full_name == 'rectorphp/rector-downgrade-php'
15+
steps:
16+
-
17+
if: github.event.pull_request.head.repo.full_name == github.repository
18+
uses: actions/checkout@v4
19+
with:
20+
# Must be used to trigger workflow after push
21+
token: ${{ secrets.ACCESS_TOKEN }}
22+
23+
-
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: 8.3
27+
coverage: none
28+
29+
- uses: "ramsey/composer-install@v2"
30+
31+
- run: vendor/bin/rector --ansi
32+
33+
-
34+
# commit only to core contributors who have repository access
35+
uses: stefanzweifel/git-auto-commit-action@v4
36+
with:
37+
commit_message: '[rector] Rector fixes'
38+
commit_author: 'GitHub Action <actions@github.com>'
39+
commit_user_email: 'action@github.com'

.github/workflows/tests.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@
44
"license": "MIT",
55
"description": "Rector downgrade PHP rules",
66
"require": {
7-
"php": ">=8.2"
7+
"php": ">=8.3"
88
},
99
"require-dev": {
10-
"phpstan/extension-installer": "^1.3",
11-
"phpstan/phpstan": "^2.1.32",
10+
"phpstan/extension-installer": "^1.4",
11+
"phpstan/phpstan": "^2.1.33",
1212
"phpstan/phpstan-webmozart-assert": "^2.0",
1313
"phpunit/phpunit": "^11.5",
14+
"rector/jack": "^0.5.1",
1415
"rector/rector-src": "dev-main",
16+
"rector/swiss-knife": "^2.3",
1517
"rector/type-perfect": "^2.1",
16-
"symplify/easy-coding-standard": "^12.3",
18+
"symplify/easy-coding-standard": "^13.0",
1719
"symplify/phpstan-extensions": "^12.0",
1820
"symplify/phpstan-rules": "^14.9",
1921
"symplify/rule-doc-generator": "^12.2",
2022
"symplify/vendor-patches": "^11.5",
21-
"tomasvotruba/class-leak": "^1.0",
22-
"tracy/tracy": "^2.10"
23+
"tomasvotruba/class-leak": "^2.1",
24+
"tomasvotruba/unused-public": "^2.2",
25+
"tracy/tracy": "^2.11"
2326
},
2427
"autoload": {
2528
"psr-4": {

rector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
return RectorConfig::configure()
1212
->withImportNames(removeUnusedImports: true)
13-
->withPhpSets(php82: true)
13+
->withPhpSets()
1414
->withComposerBased(phpunit: true)
1515
->withPreparedSets(
1616
deadCode: true,
1717
codeQuality: true,
1818
codingStyle: true,
1919
typeDeclarations: true,
20+
typeDeclarationDocblocks: true,
2021
privatization: true,
2122
naming: true,
2223
earlyReturn: true,

rules-tests/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector/Source/ParentNullableString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Rector\Tests\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector\Source;
66

7-
class ParentNullableString
7+
final class ParentNullableString
88
{
99
public function load(string $value = null)
1010
{

rules-tests/DowngradePhp72/Rector/FunctionLike/DowngradeObjectTypeDeclarationRector/Source/AnotherClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Rector\Tests\DowngradePhp72\Rector\FunctionLike\DowngradeObjectTypeDeclarationRector\Source;
55

66

7-
class AnotherClass
7+
final class AnotherClass
88
{
99

1010
}

rules-tests/DowngradePhp74/Rector/ArrowFunction/ArrowFunctionToAnonymousFunctionRector/Source/Foo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
namespace Rector\Tests\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector\Source;
66

7-
class Foo {
7+
final class Foo {
88
public $bar = 1;
99
}

rules-tests/DowngradePhp74/Rector/Property/DowngradeTypedPropertyRector/Source/AnotherClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Rector\Tests\DowngradePhp74\Rector\Property\DowngradeTypedPropertyRector\Source;
44

5-
class AnotherClass
5+
final class AnotherClass
66
{
77

88
}

0 commit comments

Comments
 (0)