Skip to content
Merged
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
6 changes: 0 additions & 6 deletions src/Configuration/RectorConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Enum\Config\Defaults;
use Rector\Exception\Configuration\InvalidConfigurationException;
use Rector\NodeTypeResolver\PHPStan\Scope\Contract\NodeVisitor\ScopeResolverNodeVisitorInterface;
use Rector\Php\PhpVersionResolver\ComposerJsonPhpVersionResolver;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationToAttribute;
Expand Down Expand Up @@ -1240,11 +1239,6 @@ public function withTreatClassesAsFinal(bool $isTreatClassesAsFinal = true): sel

public function registerService(string $className, ?string $alias = null, ?string $tag = null): self
{
// BC layer since 2.2.9
if ($tag === ScopeResolverNodeVisitorInterface::class) {
$tag = DecoratingNodeVisitorInterface::class;
}

$this->registerServices[] = new RegisteredService($className, $alias, $tag);

return $this;
Expand Down
1 change: 0 additions & 1 deletion src/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
// 4. Deprecations reporter
$this->deprecatedRulesReporter->reportDeprecatedRules();
$this->deprecatedRulesReporter->reportDeprecatedSkippedRules();
$this->deprecatedRulesReporter->reportDeprecatedNodeTypes();
$this->deprecatedRulesReporter->reportDeprecatedRectorUnsupportedMethods();

$this->missConfigurationReporter->reportSkippedNeverRegisteredRules();
Expand Down

This file was deleted.

32 changes: 0 additions & 32 deletions src/PhpParser/Node/CustomNode/FileWithoutNamespace.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/PhpParser/NodeTraverser/RectorNodeTraverser.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
use Rector\Configuration\ConfigurationRuleFilter;
use Rector\Contract\Rector\RectorInterface;
use Rector\Exception\ShouldNotHappenException;
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
use Rector\PhpParser\Node\FileNode;
use Rector\VersionBonding\ComposerPackageConstraintFilter;
use Rector\VersionBonding\PhpVersionedFilter;
use Webmozart\Assert\Assert;
Expand Down Expand Up @@ -127,12 +125,6 @@ public function getVisitorsForNode(Node $node): array
/** @var RectorInterface $visitor */
foreach ($this->visitors as $visitor) {
foreach ($visitor->getNodeTypes() as $nodeType) {
// BC layer matching
if ($nodeType === FileWithoutNamespace::class && $nodeClass === FileNode::class) {
$this->visitorsPerNodeClass[$nodeClass][] = $visitor;
continue;
}

if (is_a($nodeClass, $nodeType, true)) {
$this->visitorsPerNodeClass[$nodeClass][] = $visitor;
continue 2;
Expand Down
33 changes: 0 additions & 33 deletions src/Reporting/DeprecatedRulesReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Rector\Configuration\Option;
use Rector\Configuration\Parameter\SimpleParameterProvider;
use Rector\Contract\Rector\RectorInterface;
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
use Rector\PhpParser\Node\FileNode;
use ReflectionMethod;
use Symfony\Component\Console\Style\SymfonyStyle;
Expand Down Expand Up @@ -75,36 +74,4 @@ public function reportDeprecatedRectorUnsupportedMethods(): void
}
}
}

public function reportDeprecatedNodeTypes(): void
{
// helper property to avoid reporting multiple times
static $reportedClasses = [];

foreach ($this->rectors as $rector) {
if (in_array(FileWithoutNamespace::class, $rector->getNodeTypes(), true)) {
$this->reportDeprecatedFileWithoutNamespace($rector);
continue;
}

// already reported, skip
if (in_array($rector::class, $reportedClasses, true)) {
continue;
}

$reportedClasses[] = $rector::class;
}
}

private function reportDeprecatedFileWithoutNamespace(RectorInterface $rector): void
{
$this->symfonyStyle->warning(sprintf(
'Node type "%s" is deprecated and will be removed. Use "%s" in the "%s" rule instead instead.%sSee %s for upgrade path',
FileWithoutNamespace::class,
FileNode::class,
$rector::class,
PHP_EOL . PHP_EOL,
'https://github.com/rectorphp/rector-src/blob/main/UPGRADING.md'
));
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading