diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 5763e9c57f7..51ef290d711 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -32,6 +32,7 @@ jobs: - 'e2e/applied-rule-removed-node' - 'e2e/parallel with space' - 'e2e/wildcards-path-config' + - 'e2e/wildcards-path-import-config' name: End to end test - ${{ matrix.directory }} diff --git a/e2e/wildcards-path-import-config/.gitignore b/e2e/wildcards-path-import-config/.gitignore new file mode 100644 index 00000000000..61ead86667c --- /dev/null +++ b/e2e/wildcards-path-import-config/.gitignore @@ -0,0 +1 @@ +/vendor diff --git a/e2e/wildcards-path-import-config/composer.json b/e2e/wildcards-path-import-config/composer.json new file mode 100644 index 00000000000..5468cd74606 --- /dev/null +++ b/e2e/wildcards-path-import-config/composer.json @@ -0,0 +1,7 @@ +{ + "require": { + "php": "^8.1" + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/e2e/wildcards-path-import-config/config/import_config.php b/e2e/wildcards-path-import-config/config/import_config.php new file mode 100644 index 00000000000..c87491f0931 --- /dev/null +++ b/e2e/wildcards-path-import-config/config/import_config.php @@ -0,0 +1,10 @@ +rule(RemoveEmptyClassMethodRector::class); +}; diff --git a/e2e/wildcards-path-import-config/config/import_config_another.php b/e2e/wildcards-path-import-config/config/import_config_another.php new file mode 100644 index 00000000000..284db15c501 --- /dev/null +++ b/e2e/wildcards-path-import-config/config/import_config_another.php @@ -0,0 +1,10 @@ +rule(RemoveUnreachableStatementRector::class); +}; diff --git a/e2e/wildcards-path-import-config/expected-output.diff b/e2e/wildcards-path-import-config/expected-output.diff new file mode 100644 index 00000000000..37165e6a782 --- /dev/null +++ b/e2e/wildcards-path-import-config/expected-output.diff @@ -0,0 +1,38 @@ +2 files with changes +==================== + +1) src/GotUnreachableReturn.php:4 + + ---------- begin diff ---------- +@@ @@ + public function run() + { + throw new Exception(); +- +- return 'test'; + } + } + ----------- end diff ----------- + +Applied rules: + * RemoveUnreachableStatementRector + + +2) src/DeadConstructor.php:1 + + ---------- begin diff ---------- +@@ @@ + + final class DeadConstructor + { +- public function __construct() +- { +- } + } + ----------- end diff ----------- + +Applied rules: + * RemoveEmptyClassMethodRector + + + [OK] 2 files would have changed (dry-run) by Rector \ No newline at end of file diff --git a/e2e/wildcards-path-import-config/rector.php b/e2e/wildcards-path-import-config/rector.php new file mode 100644 index 00000000000..0e35cfccaf0 --- /dev/null +++ b/e2e/wildcards-path-import-config/rector.php @@ -0,0 +1,13 @@ +paths([ + __DIR__ . '/src', + ]); + + $rectorConfig->import(__DIR__ . '/config/*'); +}; diff --git a/e2e/wildcards-path-import-config/src/DeadConstructor.php b/e2e/wildcards-path-import-config/src/DeadConstructor.php new file mode 100644 index 00000000000..03d800c4879 --- /dev/null +++ b/e2e/wildcards-path-import-config/src/DeadConstructor.php @@ -0,0 +1,8 @@ +resolveWithFnmatch($paths); + + foreach ($paths as $path) { + $this->importFile($path); + } + } + /** * @param array> $rectorClasses */