File tree Expand file tree Collapse file tree 6 files changed +45
-1
lines changed
Expand file tree Collapse file tree 6 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 1818 - php-version : 8.2
1919 phing_tasks : " phpunitfast"
2020 - php-version : 8.3
21- phing_tasks : " phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console"
21+ phing_tasks : " phpunitfast phpcs-console php-cs-fixer-dryrun phpstan-console rector-console "
2222
2323 steps :
2424 - name : Setup PHP
2727 php-version : ${{ matrix.php-version }}
2828 extensions : intl, xsl
2929
30+ - name : Cache rector data
31+ uses : actions/cache@v4
32+ with :
33+ path : .rector
34+ key : " php-${{ matrix.php-version }}-rector-${{ github.sha }}"
35+ restore-keys : " php-${{ matrix.php-version }}-rector-"
36+
3037 - name : Checkout
3138 uses : actions/checkout@v4
3239
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ composer.lock
33.php_cs_cache
44.phpstan_cache
55tests /.phpunit.result.cache
6+ .rector
Original file line number Diff line number Diff line change 3838 <phingcall target =" phpmd" />
3939 <phingcall target =" pdepend" />
4040 <phingcall target =" phpstan-checkstyle" />
41+ <phingcall target =" rector-console" />
4142 </target >
4243
4344 <!-- Report rule violations with PHPMD (mess detector) -->
8283 <arg line =" --configuration=${ srcdir } /tests/phpstan.neon --memory-limit=2G analyse" />
8384 </exec >
8485 </target >
86+
87+ <!-- Rector -->
88+ <target name =" rector-console" >
89+ <exec executable =" ${ srcdir } /vendor/bin/rector" escape =" false" passthru =" true" checkreturn =" true" >
90+ <arg line =" --config=${ srcdir } /tests/rector.php --dry-run" />
91+ </exec >
92+ </target >
93+ <target name =" rector" >
94+ <exec executable =" ${ srcdir } /vendor/bin/rector" escape =" false" passthru =" true" checkreturn =" true" >
95+ <arg line =" --config=${ srcdir } /tests/rector.php" />
96+ </exec >
97+ </target >
8598
8699 <!-- php-cs-fixer (first task applies fixes, second task simply checks if they are needed) -->
87100 <target name =" php-cs-fixer" >
Original file line number Diff line number Diff line change 3333 "phpstan/phpstan" : " 1.12.7" ,
3434 "phpunit/phpunit" : " 10.5.36" ,
3535 "phing/phing" : " 3.0" ,
36+ "rector/rector" : " ^1.2" ,
3637 "squizlabs/php_codesniffer" : " 3.10.3"
3738 }
3839}
Original file line number Diff line number Diff line change 55 <file >.</file >
66 <exclude-pattern >*/config/*</exclude-pattern >
77 <exclude-pattern >*.php-cs-fixer.*</exclude-pattern >
8+ <exclude-pattern >*rector.*</exclude-pattern >
89 <arg name =" extensions" value =" php" />
910 <!-- We only use PEAR to ensure complete comments at this time -->
1011 <rule ref =" PEAR.Commenting" >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Rector \Caching \ValueObject \Storage \FileCacheStorage ;
6+ use Rector \Config \RectorConfig ;
7+ use Rector \PHPUnit \Set \PHPUnitSetList ;
8+
9+ return RectorConfig::configure ()
10+ ->withCache (
11+ cacheClass: FileCacheStorage::class,
12+ cacheDirectory: __DIR__ . '/../.rector '
13+ )->withPaths ([
14+ __DIR__ . '/../src ' ,
15+ ])
16+ ->withSets ([
17+ PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES ,
18+ ])
19+ ->withTypeCoverageLevel (0 )
20+ ->withDeadCodeLevel (6 )
21+ ->withCodeQualityLevel (18 );
You can’t perform that action at this time.
0 commit comments