diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 38ca9036..266ed64c 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -147,35 +147,3 @@ parameters: message: "#^Call to an undefined method PHPStan\\\\Type\\\\Type\\:\\:getValue\\(\\)\\.$#" count: 1 path: src/Drupal9/Rector/Deprecation/ExtensionPathRector.php - - - - message: """ - #^Fetching deprecated class constant REMOVE_NODE of class PhpParser\\\\NodeTraverser\\: - Use NodeVisitor\\:\\:REMOVE_NODE instead\\.$# - """ - count: 1 - path: src/Drupal9/Rector/Deprecation/PassRector.php - - - - message: """ - #^Class DrupalRector\\\\Set\\\\Drupal10SetList implements deprecated interface Rector\\\\Set\\\\Contract\\\\SetListInterface\\: - This interface needs a reflection to load and uses constant links\\. Now we changed to services provider architecture that can be used and registerd easily\\. Use$# - """ - count: 1 - path: src/Set/Drupal10SetList.php - - - - message: """ - #^Class DrupalRector\\\\Set\\\\Drupal8SetList implements deprecated interface Rector\\\\Set\\\\Contract\\\\SetListInterface\\: - This interface needs a reflection to load and uses constant links\\. Now we changed to services provider architecture that can be used and registerd easily\\. Use$# - """ - count: 1 - path: src/Set/Drupal8SetList.php - - - - message: """ - #^Class DrupalRector\\\\Set\\\\Drupal9SetList implements deprecated interface Rector\\\\Set\\\\Contract\\\\SetListInterface\\: - This interface needs a reflection to load and uses constant links\\. Now we changed to services provider architecture that can be used and registerd easily\\. Use$# - """ - count: 1 - path: src/Set/Drupal9SetList.php diff --git a/src/Drupal8/Rector/Deprecation/DBRector.php b/src/Drupal8/Rector/Deprecation/DBRector.php index 4963b5f7..d4c6df70 100644 --- a/src/Drupal8/Rector/Deprecation/DBRector.php +++ b/src/Drupal8/Rector/Deprecation/DBRector.php @@ -56,7 +56,7 @@ class DBRector extends AbstractRector implements ConfigurableRectorInterface protected $optionsArgumentPosition; /** - * @var \DrupalRector\Drupal8\Rector\ValueObject\DBConfiguration[] + * @var DBConfiguration[] */ private array $configuration; diff --git a/src/Drupal8/Rector/Deprecation/DrupalServiceRenameRector.php b/src/Drupal8/Rector/Deprecation/DrupalServiceRenameRector.php index 43726353..61b17330 100644 --- a/src/Drupal8/Rector/Deprecation/DrupalServiceRenameRector.php +++ b/src/Drupal8/Rector/Deprecation/DrupalServiceRenameRector.php @@ -14,7 +14,7 @@ class DrupalServiceRenameRector extends AbstractRector implements ConfigurableRectorInterface { /** - * @var \DrupalRector\Drupal8\Rector\ValueObject\DrupalServiceRenameConfiguration[] + * @var DrupalServiceRenameConfiguration[] */ protected array $staticArgumentRenameConfigs = []; diff --git a/src/Drupal8/Rector/Deprecation/EntityLoadRector.php b/src/Drupal8/Rector/Deprecation/EntityLoadRector.php index 7c3bb7fa..66b5e5b5 100644 --- a/src/Drupal8/Rector/Deprecation/EntityLoadRector.php +++ b/src/Drupal8/Rector/Deprecation/EntityLoadRector.php @@ -27,7 +27,7 @@ final class EntityLoadRector extends AbstractRector implements ConfigurableRectorInterface { /** - * @var \DrupalRector\Drupal8\Rector\ValueObject\EntityLoadConfiguration[] + * @var EntityLoadConfiguration[] */ protected array $entityTypes; diff --git a/src/Drupal9/Rector/Deprecation/ExtensionPathRector.php b/src/Drupal9/Rector/Deprecation/ExtensionPathRector.php index e0d9ca33..a8043d94 100644 --- a/src/Drupal9/Rector/Deprecation/ExtensionPathRector.php +++ b/src/Drupal9/Rector/Deprecation/ExtensionPathRector.php @@ -15,7 +15,7 @@ class ExtensionPathRector extends AbstractRector implements ConfigurableRectorInterface { /** - * @var \DrupalRector\Drupal9\Rector\ValueObject\ExtensionPathConfiguration[] + * @var ExtensionPathConfiguration[] */ private array $configuration; diff --git a/src/Drupal9/Rector/Deprecation/PassRector.php b/src/Drupal9/Rector/Deprecation/PassRector.php index 60b68900..8e48d29a 100644 --- a/src/Drupal9/Rector/Deprecation/PassRector.php +++ b/src/Drupal9/Rector/Deprecation/PassRector.php @@ -7,6 +7,7 @@ use DrupalRector\Utility\GetDeclaringSourceTrait; use PhpParser\Node; use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; @@ -51,7 +52,12 @@ public function refactor(Node $node) } if ($this->getDeclaringSource($node->expr) === 'Drupal\KernelTests\AssertLegacyTrait') { - return NodeTraverser::REMOVE_NODE; + if (defined('\PhpParser\NodeVisitor::REMOVE_NODE')) { + return NodeVisitor::REMOVE_NODE; + } else { + /* @phpstan-ignore-next-line */ + return NodeTraverser::REMOVE_NODE; + } } return $node; diff --git a/src/Drupal9/Rector/Deprecation/UiHelperTraitDrupalPostFormRector.php b/src/Drupal9/Rector/Deprecation/UiHelperTraitDrupalPostFormRector.php index 208f4ebf..9a3462ee 100644 --- a/src/Drupal9/Rector/Deprecation/UiHelperTraitDrupalPostFormRector.php +++ b/src/Drupal9/Rector/Deprecation/UiHelperTraitDrupalPostFormRector.php @@ -48,7 +48,7 @@ public function getNodeTypes(): array * * @throws ShouldNotHappenException * - * @return array + * @return array */ private function safeArgDestructure(Node\Expr\MethodCall $node): array { diff --git a/src/Rector/AbstractDrupalCoreRector.php b/src/Rector/AbstractDrupalCoreRector.php index 89ac7c5b..8edfb174 100644 --- a/src/Rector/AbstractDrupalCoreRector.php +++ b/src/Rector/AbstractDrupalCoreRector.php @@ -16,7 +16,7 @@ abstract class AbstractDrupalCoreRector extends AbstractRector implements ConfigurableRectorInterface { /** - * @var array|\DrupalRector\Contract\VersionedConfigurationInterface[] + * @var array|VersionedConfigurationInterface[] */ protected array $configuration = []; diff --git a/src/Set/Drupal10SetList.php b/src/Set/Drupal10SetList.php index 724dd993..c0829218 100644 --- a/src/Set/Drupal10SetList.php +++ b/src/Set/Drupal10SetList.php @@ -4,9 +4,7 @@ namespace DrupalRector\Set; -use Rector\Set\Contract\SetListInterface; - -final class Drupal10SetList implements SetListInterface +final class Drupal10SetList { public const DRUPAL_10 = __DIR__.'/../../config/drupal-10/drupal-10-all-deprecations.php'; public const DRUPAL_100 = __DIR__.'/../../config/drupal-10/drupal-10.0-deprecations.php'; diff --git a/src/Set/Drupal8SetList.php b/src/Set/Drupal8SetList.php index 17ced2b9..810190b7 100644 --- a/src/Set/Drupal8SetList.php +++ b/src/Set/Drupal8SetList.php @@ -4,9 +4,7 @@ namespace DrupalRector\Set; -use Rector\Set\Contract\SetListInterface; - -final class Drupal8SetList implements SetListInterface +final class Drupal8SetList { public const DRUPAL_8 = __DIR__.'/../../config/drupal-8/drupal-8-all-deprecations.php'; public const DRUPAL_80 = __DIR__.'/../../config/drupal-8/drupal-8.0-deprecations.php'; diff --git a/src/Set/Drupal9SetList.php b/src/Set/Drupal9SetList.php index 1141640f..b6397ec9 100644 --- a/src/Set/Drupal9SetList.php +++ b/src/Set/Drupal9SetList.php @@ -4,9 +4,7 @@ namespace DrupalRector\Set; -use Rector\Set\Contract\SetListInterface; - -final class Drupal9SetList implements SetListInterface +final class Drupal9SetList { public const DRUPAL_9 = __DIR__.'/../../config/drupal-9/drupal-9-all-deprecations.php'; public const DRUPAL_90 = __DIR__.'/../../config/drupal-9/drupal-9.0-deprecations.php';