File tree Expand file tree Collapse file tree 8 files changed +98
-0
lines changed
applied-rule-removed-node-no-diffs Expand file tree Collapse file tree 8 files changed +98
-0
lines changed Original file line number Diff line number Diff line change 1+ # This workflow runs system tests: Use the Rector application from the source
2+ # checkout to process "fixture" projects in e2e/ directory
3+ # to see if those can be processed successfully
4+ name : End to End tests with no diffs
5+
6+ on :
7+ pull_request :
8+ branches :
9+ - main
10+ push :
11+ branches :
12+ - main
13+
14+ env :
15+ # see https://github.com/composer/composer/issues/9368#issuecomment-718112361
16+ COMPOSER_ROOT_VERSION : " dev-main"
17+
18+ jobs :
19+ end_to_end :
20+ runs-on : ubuntu-latest
21+ timeout-minutes : 3
22+ strategy :
23+ fail-fast : false
24+ matrix :
25+ php_version : ['8.2']
26+ directory :
27+ - ' applied-rule-removed-node-no-diffs'
28+
29+ name : End to end test - ${{ matrix.directory }}
30+
31+ steps :
32+ - uses : actions/checkout@v4
33+
34+ - uses : shivammathur/setup-php@v2
35+ with :
36+ php-version : ${{ matrix.php_version }}
37+ coverage : none
38+
39+ # run in root rector-src
40+ - run : composer install --ansi
41+
42+ # run in e2e subdir
43+ -
44+ run : composer install --ansi
45+ working-directory : ${{ matrix.directory }}
46+
47+ # run e2e test
48+ - run : php ../e2eTestRunner.php --no-diffs
49+ working-directory : ${{ matrix.directory }}
Original file line number Diff line number Diff line change 1+ /vendor
Original file line number Diff line number Diff line change 1+ {
2+ "require" : {
3+ "php" : " ^8.1"
4+ },
5+ "minimum-stability" : " dev" ,
6+ "prefer-stable" : true
7+ }
Original file line number Diff line number Diff line change 1+ [OK] 2 files would have been changed (dry-run) by Rector
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Rector \Config \RectorConfig ;
6+ use Rector \DeadCode \Rector \ClassMethod \RemoveEmptyClassMethodRector ;
7+ use Rector \DeadCode \Rector \If_ \RemoveAlwaysTrueIfConditionRector ;
8+
9+ return static function (RectorConfig $ rectorConfig ): void {
10+ $ rectorConfig ->paths ([
11+ __DIR__ . '/src ' ,
12+ ]);
13+
14+ $ rectorConfig ->rule (RemoveEmptyClassMethodRector::class);
15+ $ rectorConfig ->rule (RemoveAlwaysTrueIfConditionRector::class);
16+ };
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ final class AlwaysTrue
4+ {
5+ public function run ()
6+ {
7+ if (1 === 1 ) {
8+ }
9+
10+ return 'no ' ;
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ final class DeadConstructor
4+ {
5+ public function __construct ()
6+ {
7+ }
8+ }
Original file line number Diff line number Diff line change 3232 $ e2eCommand .= ' -a ' . $ argv [2 ];
3333}
3434
35+ if (isset ($ argv [1 ]) && $ argv [1 ] === '--no-diffs ' ) {
36+ $ e2eCommand .= ' --no-diffs ' ;
37+ }
38+
3539$ cliOptions = 'cli-options.txt ' ;
3640if (file_exists ($ cliOptions )) {
3741 $ e2eCommand .= ' ' . trim ((string ) file_get_contents ($ cliOptions ));
You can’t perform that action at this time.
0 commit comments