Skip to content

Commit f604fa9

Browse files
authored
Bump to PHP 8.3 (#605)
* bump to PHP 8.3 * bump deps * add rector run
1 parent 4fa695b commit f604fa9

File tree

43 files changed

+152
-293
lines changed

Some content is hidden

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

43 files changed

+152
-293
lines changed

.github/workflows/code_analysis.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ jobs:
2424
name: 'Finalise classes'
2525
run: vendor/bin/swiss-knife finalize-classes src rules tests
2626

27+
-
28+
name: 'Composer Validate'
29+
run: composer validate
30+
31+
-
32+
name: 'PHPStan'
33+
run: vendor/bin/phpstan
34+
35+
-
36+
name: 'Tests'
37+
run: vendor/bin/phpunit
38+
2739
name: ${{ matrix.actions.name }}
2840
runs-on: ubuntu-latest
2941
timeout-minutes: 10
@@ -34,7 +46,7 @@ jobs:
3446
-
3547
uses: shivammathur/setup-php@v2
3648
with:
37-
php-version: 8.2
49+
php-version: 8.3
3850
coverage: none
3951

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

.github/workflows/code_analysis_reuslabe.yaml

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

.github/workflows/rector.yaml.yml

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-phpunit'
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 & 29 deletions
This file was deleted.

.github/workflows/typos.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
19-
2018
- name: "Check for typos"
2119
uses: "crate-ci/typos@v1.40.0"
2220
with:

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
"license": "MIT",
55
"description": "Rector upgrades rules for PHPUnit",
66
"require": {
7-
"php": ">=8.2"
7+
"php": ">=8.3"
88
},
99
"require-dev": {
10-
"phpecs/phpecs": "^2.2",
10+
"symplify/easy-coding-standard": "^13.0",
1111
"phpstan/extension-installer": "^1.4",
1212
"phpstan/phpstan": "^2.1.31",
1313
"phpstan/phpstan-deprecation-rules": "^2.0",
1414
"phpstan/phpstan-webmozart-assert": "^2.0",
15-
"phpunit/phpunit": "^11.5",
16-
"rector/jack": "^0.4.0",
15+
"phpunit/phpunit": "^11.5|^12.0",
16+
"rector/jack": "^0.5",
1717
"rector/rector-src": "dev-main",
18-
"rector/swiss-knife": "^1.0",
18+
"rector/swiss-knife": "^2.0",
1919
"rector/type-perfect": "^2.1",
2020
"symplify/phpstan-extensions": "^12.0",
2121
"symplify/phpstan-rules": "^14.9",
22-
"symplify/vendor-patches": "^11.5",
23-
"tomasvotruba/class-leak": "^1.2",
22+
"symplify/vendor-patches": "^11.0",
23+
"tomasvotruba/class-leak": "^2.1",
2424
"tracy/tracy": "^2.11"
2525
},
2626
"autoload": {

rules/AnnotationsToAttributes/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
*/
3131
final class DataProviderAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface
3232
{
33-
/**
34-
* @var string
35-
*/
36-
private const DATA_PROVIDER_CLASS = 'PHPUnit\Framework\Attributes\DataProvider';
33+
private const string DATA_PROVIDER_CLASS = 'PHPUnit\Framework\Attributes\DataProvider';
3734

3835
public function __construct(
3936
private readonly TestsNodeAnalyzer $testsNodeAnalyzer,

rules/AnnotationsToAttributes/Rector/ClassMethod/DependsAnnotationWithValueToAttributeRector.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@
2727
*/
2828
final class DependsAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface
2929
{
30-
/**
31-
* @var string
32-
*/
33-
private const DEPENDS_ATTRIBUTE = 'PHPUnit\Framework\Attributes\Depends';
30+
private const string DEPENDS_ATTRIBUTE = 'PHPUnit\Framework\Attributes\Depends';
3431

3532
public function __construct(
3633
private readonly TestsNodeAnalyzer $testsNodeAnalyzer,

rules/AnnotationsToAttributes/Rector/ClassMethod/TestWithAnnotationToAttributeRector.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
*/
3131
final class TestWithAnnotationToAttributeRector extends AbstractRector implements MinPhpVersionInterface
3232
{
33-
/**
34-
* @var string
35-
*/
36-
private const TEST_WITH_ATTRIBUTE = 'PHPUnit\Framework\Attributes\TestWith';
33+
private const string TEST_WITH_ATTRIBUTE = 'PHPUnit\Framework\Attributes\TestWith';
3734

3835
public function __construct(
3936
private readonly TestsNodeAnalyzer $testsNodeAnalyzer,

rules/AnnotationsToAttributes/Rector/Class_/CoversAnnotationWithValueToAttributeRector.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,13 @@
2828
*/
2929
final class CoversAnnotationWithValueToAttributeRector extends AbstractRector implements MinPhpVersionInterface
3030
{
31-
/**
32-
* @var string
33-
*/
34-
private const COVERS_FUNCTION_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversFunction';
31+
private const string COVERS_FUNCTION_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversFunction';
3532

36-
/**
37-
* @var string
38-
*/
39-
private const COVERTS_CLASS_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversClass';
33+
private const string COVERTS_CLASS_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversClass';
4034

41-
/**
42-
* @var string
43-
*/
44-
private const COVERTS_TRAIT_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversTrait';
35+
private const string COVERTS_TRAIT_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversTrait';
4536

46-
/**
47-
* @var string
48-
*/
49-
private const COVERS_METHOD_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversMethod';
37+
private const string COVERS_METHOD_ATTRIBUTE = 'PHPUnit\Framework\Attributes\CoversMethod';
5038

5139
public function __construct(
5240
private readonly PhpDocTagRemover $phpDocTagRemover,

0 commit comments

Comments
 (0)