From 792217a481c0a0eb8936117f0f53faa555d210da Mon Sep 17 00:00:00 2001 From: bjorn Date: Tue, 21 Nov 2023 10:22:57 +0100 Subject: [PATCH] Move classes to Drupal version scopes namespace --- config/drupal-8/drupal-8.8-deprecations.php | 2 +- phpstan-baseline.neon | 8 ++++---- .../FunctionalTestDefaultThemePropertyRector.php | 2 +- .../FunctionalTestDefaultThemePropertyRectorTest.php | 3 ++- .../config/configured_rule.php | 2 +- .../fixture/extends.php.inc | 4 ++-- .../fixture/some_class.php.inc | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) rename src/{Rector/Class_ => Drupal8/Rector/Deprecation}/FunctionalTestDefaultThemePropertyRector.php (98%) rename tests/src/{Rector/Class_ => Drupal8/Rector/Deprecation}/FunctionalTestDefaultThemePropertyRector/FunctionalTestDefaultThemePropertyRectorTest.php (77%) rename tests/src/{Rector/Class_ => Drupal8/Rector/Deprecation}/FunctionalTestDefaultThemePropertyRector/config/configured_rule.php (52%) rename tests/src/{Rector/Class_ => Drupal8/Rector/Deprecation}/FunctionalTestDefaultThemePropertyRector/fixture/extends.php.inc (72%) rename tests/src/{Rector/Class_ => Drupal8/Rector/Deprecation}/FunctionalTestDefaultThemePropertyRector/fixture/some_class.php.inc (67%) diff --git a/config/drupal-8/drupal-8.8-deprecations.php b/config/drupal-8/drupal-8.8-deprecations.php index 7a9a0886..40360618 100644 --- a/config/drupal-8/drupal-8.8-deprecations.php +++ b/config/drupal-8/drupal-8.8-deprecations.php @@ -4,8 +4,8 @@ use DrupalRector\Drupal8\Rector\Deprecation\DrupalServiceRenameRector; use DrupalRector\Drupal8\Rector\Deprecation\FileDefaultSchemeRector; +use DrupalRector\Drupal8\Rector\Deprecation\FunctionalTestDefaultThemePropertyRector; use DrupalRector\Drupal8\Rector\ValueObject\DrupalServiceRenameConfiguration; -use DrupalRector\Rector\Class_\FunctionalTestDefaultThemePropertyRector; use DrupalRector\Rector\Deprecation\FunctionToServiceRector; use DrupalRector\Rector\Deprecation\MethodToMethodWithCheckRector; use DrupalRector\Rector\ValueObject\FunctionToServiceConfiguration; diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index dbc6ad60..1ef10e01 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -101,11 +101,11 @@ parameters: path: src/Drupal8/Rector/Deprecation/EntityManagerRector.php - - message: "#^Call to an undefined method PHPStan\\\\Type\\\\Type\\:\\:getValue\\(\\)\\.$#" + message: "#^Doing instanceof PHPStan\\\\Type\\\\ObjectType is error\\-prone and deprecated\\. Use Type\\:\\:isObject\\(\\) or Type\\:\\:getObjectClassNames\\(\\) instead\\.$#" count: 1 - path: src/Drupal9/Rector/Deprecation/ExtensionPathRector.php + path: src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector.php - - message: "#^Doing instanceof PHPStan\\\\Type\\\\ObjectType is error\\-prone and deprecated\\. Use Type\\:\\:isObject\\(\\) or Type\\:\\:getObjectClassNames\\(\\) instead\\.$#" + message: "#^Call to an undefined method PHPStan\\\\Type\\\\Type\\:\\:getValue\\(\\)\\.$#" count: 1 - path: src/Rector/Class_/FunctionalTestDefaultThemePropertyRector.php + path: src/Drupal9/Rector/Deprecation/ExtensionPathRector.php diff --git a/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector.php b/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector.php similarity index 98% rename from src/Rector/Class_/FunctionalTestDefaultThemePropertyRector.php rename to src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector.php index 05e0529c..26d7820e 100644 --- a/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector.php +++ b/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace DrupalRector\Rector\Class_; +namespace DrupalRector\Drupal8\Rector\Deprecation; use Drupal\Tests\BrowserTestBase; use PhpParser\Builder\Property; diff --git a/tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/FunctionalTestDefaultThemePropertyRectorTest.php b/tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/FunctionalTestDefaultThemePropertyRectorTest.php similarity index 77% rename from tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/FunctionalTestDefaultThemePropertyRectorTest.php rename to tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/FunctionalTestDefaultThemePropertyRectorTest.php index 9f661893..0bf8cea9 100644 --- a/tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/FunctionalTestDefaultThemePropertyRectorTest.php +++ b/tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/FunctionalTestDefaultThemePropertyRectorTest.php @@ -2,8 +2,9 @@ declare(strict_types=1); -namespace DrupalRector\Tests\Rector\Class_\FunctionalTestDefaultThemePropertyRector; +namespace DrupalRector\Tests\Drupal8\Rector\Deprecation\FunctionalTestDefaultThemePropertyRector; +use DrupalRector\Tests\Rector\Class_\FunctionalTestDefaultThemePropertyRector\Iterator; use Rector\Testing\PHPUnit\AbstractRectorTestCase; final class FunctionalTestDefaultThemePropertyRectorTest extends AbstractRectorTestCase diff --git a/tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/config/configured_rule.php b/tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/config/configured_rule.php similarity index 52% rename from tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/config/configured_rule.php rename to tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/config/configured_rule.php index 71c51320..fe548ec0 100644 --- a/tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/config/configured_rule.php +++ b/tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/config/configured_rule.php @@ -5,5 +5,5 @@ use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { - $rectorConfig->rule(\DrupalRector\Rector\Class_\FunctionalTestDefaultThemePropertyRector::class); + $rectorConfig->rule(\DrupalRector\Drupal8\Rector\Deprecation\FunctionalTestDefaultThemePropertyRector::class); }; diff --git a/tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/fixture/extends.php.inc b/tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/fixture/extends.php.inc similarity index 72% rename from tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/fixture/extends.php.inc rename to tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/fixture/extends.php.inc index 2f0f910e..961ba4e3 100644 --- a/tests/src/Rector/Class_/FunctionalTestDefaultThemePropertyRector/fixture/extends.php.inc +++ b/tests/src/Drupal8/Rector/Deprecation/FunctionalTestDefaultThemePropertyRector/fixture/extends.php.inc @@ -1,6 +1,6 @@