Skip to content

Commit 6412efb

Browse files
committed
remove deprecated StmtsAwareInterface
1 parent 28418a2 commit 6412efb

5 files changed

Lines changed: 1 addition & 42 deletions

File tree

build/build-preload.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,7 @@ private function findPhpParserFilesAndSortThem(string $vendorDir): array
355355
}
356356
}
357357

358-
$fileInfos = array_values($fileInfos);
359-
360-
$stmtsAwareInterface = new SplFileInfo(__DIR__ . '/../src/Contract/PhpParser/Node/StmtsAwareInterface.php');
361-
array_splice($fileInfos, 1, 0, [$stmtsAwareInterface]);
362-
363-
return $fileInfos;
358+
return array_values($fileInfos);
364359
}
365360

366361
/**

preload-split-package.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function isPHPStanTestPreloaded(): bool
2626
}
2727

2828
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node.php';
29-
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
3029
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';
3130
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php';
3231
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php';

preload.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function isPHPStanTestPreloaded(): bool
2626
}
2727

2828
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node.php';
29-
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
3029
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';
3130
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php';
3231
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php';

src/Contract/PhpParser/Node/StmtsAwareInterface.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Reporting/DeprecatedRulesReporter.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
use Rector\Configuration\Deprecation\Contract\DeprecatedInterface;
88
use Rector\Configuration\Option;
99
use Rector\Configuration\Parameter\SimpleParameterProvider;
10-
use Rector\Contract\PhpParser\Node\StmtsAwareInterface;
1110
use Rector\Contract\Rector\RectorInterface;
12-
use Rector\PhpParser\Enum\NodeGroup;
1311
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
1412
use Rector\PhpParser\Node\FileNode;
1513
use ReflectionMethod;
@@ -89,26 +87,12 @@ public function reportDeprecatedNodeTypes(): void
8987
continue;
9088
}
9189

92-
if (! in_array(StmtsAwareInterface::class, $rector->getNodeTypes())) {
93-
continue;
94-
}
95-
9690
// already reported, skip
9791
if (in_array($rector::class, $reportedClasses, true)) {
9892
continue;
9993
}
10094

10195
$reportedClasses[] = $rector::class;
102-
103-
$this->symfonyStyle->warning(sprintf(
104-
'Rector rule "%s" uses StmtsAwareInterface that is now deprecated.%sUse "%s::%s" instead.%sSee %s for more',
105-
$rector::class,
106-
PHP_EOL,
107-
NodeGroup::class,
108-
'STMTS_AWARE',
109-
PHP_EOL . PHP_EOL,
110-
'https://github.com/rectorphp/rector-src/pull/7679'
111-
));
11296
}
11397
}
11498

0 commit comments

Comments
 (0)