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
7 changes: 1 addition & 6 deletions build/build-preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,7 @@ private function findPhpParserFilesAndSortThem(string $vendorDir): array
}
}

$fileInfos = array_values($fileInfos);

$stmtsAwareInterface = new SplFileInfo(__DIR__ . '/../src/Contract/PhpParser/Node/StmtsAwareInterface.php');
array_splice($fileInfos, 1, 0, [$stmtsAwareInterface]);

return $fileInfos;
return array_values($fileInfos);
}

/**
Expand Down
17 changes: 0 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,6 @@
"patches": {
"illuminate/container": [
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/illuminate-container-container-php.patch"
],
"nikic/php-parser": [
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-expr-closure-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-finally-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-function-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-do-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-catch-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-trycatch-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-for-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-classmethod-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-else-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-while-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-foreach-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-if-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-case-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-elseif-php.patch",
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-namespace-php.patch"
]
},
"composer-exit-on-patch-failure": true,
Expand Down
1 change: 0 additions & 1 deletion preload-split-package.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function isPHPStanTestPreloaded(): bool
}

require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node.php';
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php';
require_once __DIR__ . '/../../../vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php';
Expand Down
1 change: 0 additions & 1 deletion preload.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function isPHPStanTestPreloaded(): bool
}

require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node.php';
require_once __DIR__ . '/src/Contract/PhpParser/Node/StmtsAwareInterface.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php';
require_once __DIR__ . '/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php';
Expand Down
18 changes: 0 additions & 18 deletions src/Contract/PhpParser/Node/StmtsAwareInterface.php

This file was deleted.

3 changes: 1 addition & 2 deletions src/PhpParser/Node/CustomNode/FileWithoutNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Rector\PhpParser\Node\CustomNode;

use Override;
use Rector\Contract\PhpParser\Node\StmtsAwareInterface;
use Rector\PhpParser\Node\FileNode;

/**
Expand All @@ -14,7 +13,7 @@
*
* Inspired by https://github.com/phpstan/phpstan-src/commit/ed81c3ad0b9877e6122c79b4afda9d10f3994092
*/
final class FileWithoutNamespace extends FileNode implements StmtsAwareInterface
final class FileWithoutNamespace extends FileNode
{
#[Override]
public function getType(): string
Expand Down
16 changes: 0 additions & 16 deletions src/Reporting/DeprecatedRulesReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Rector\Configuration\Deprecation\Contract\DeprecatedInterface;
use Rector\Configuration\Option;
use Rector\Configuration\Parameter\SimpleParameterProvider;
use Rector\Contract\PhpParser\Node\StmtsAwareInterface;
use Rector\Contract\Rector\RectorInterface;
use Rector\PhpParser\Enum\NodeGroup;
use Rector\PhpParser\Node\CustomNode\FileWithoutNamespace;
use Rector\PhpParser\Node\FileNode;
use ReflectionMethod;
Expand Down Expand Up @@ -89,26 +87,12 @@ public function reportDeprecatedNodeTypes(): void
continue;
}

if (! in_array(StmtsAwareInterface::class, $rector->getNodeTypes())) {
continue;
}

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

$reportedClasses[] = $rector::class;

$this->symfonyStyle->warning(sprintf(
'Rector rule "%s" uses StmtsAwareInterface that is now deprecated.%sUse "%s::%s" instead.%sSee %s for more',
$rector::class,
PHP_EOL,
NodeGroup::class,
'STMTS_AWARE',
PHP_EOL . PHP_EOL,
'https://github.com/rectorphp/rector-src/pull/7679'
));
}
}

Expand Down
Loading