Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/remove deprecations #314

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/Drupal8/Rector/Deprecation/DBRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DBRector extends AbstractRector implements ConfigurableRectorInterface
protected $optionsArgumentPosition;

/**
* @var \DrupalRector\Drupal8\Rector\ValueObject\DBConfiguration[]
* @var DBConfiguration[]
*/
private array $configuration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class DrupalServiceRenameRector extends AbstractRector implements ConfigurableRectorInterface
{
/**
* @var \DrupalRector\Drupal8\Rector\ValueObject\DrupalServiceRenameConfiguration[]
* @var DrupalServiceRenameConfiguration[]
*/
protected array $staticArgumentRenameConfigs = [];

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal8/Rector/Deprecation/EntityLoadRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
final class EntityLoadRector extends AbstractRector implements ConfigurableRectorInterface
{
/**
* @var \DrupalRector\Drupal8\Rector\ValueObject\EntityLoadConfiguration[]
* @var EntityLoadConfiguration[]
*/
protected array $entityTypes;

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal9/Rector/Deprecation/ExtensionPathRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class ExtensionPathRector extends AbstractRector implements ConfigurableRectorInterface
{
/**
* @var \DrupalRector\Drupal9\Rector\ValueObject\ExtensionPathConfiguration[]
* @var ExtensionPathConfiguration[]
*/
private array $configuration;

Expand Down
8 changes: 7 additions & 1 deletion src/Drupal9/Rector/Deprecation/PassRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getNodeTypes(): array
*
* @throws ShouldNotHappenException
*
* @return array<int, ?\PhpParser\Node\Arg>
* @return array<int, ?Node\Arg>
*/
private function safeArgDestructure(Node\Expr\MethodCall $node): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Rector/AbstractDrupalCoreRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
abstract class AbstractDrupalCoreRector extends AbstractRector implements ConfigurableRectorInterface
{
/**
* @var array|\DrupalRector\Contract\VersionedConfigurationInterface[]
* @var array|VersionedConfigurationInterface[]
*/
protected array $configuration = [];

Expand Down
4 changes: 1 addition & 3 deletions src/Set/Drupal10SetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 1 addition & 3 deletions src/Set/Drupal8SetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 1 addition & 3 deletions src/Set/Drupal9SetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading