Skip to content

Commit 29c92d3

Browse files
committed
wip
1 parent 9eaeb6c commit 29c92d3

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Tempest\Upgrade\Tempest2;
4+
5+
use PhpParser\Node;
6+
use Rector\Rector\AbstractRector;
7+
8+
final class MigrationRector extends AbstractRector
9+
{
10+
public function getNodeTypes(): array
11+
{
12+
return [
13+
Node\Stmt\Class_::class,
14+
];
15+
}
16+
17+
public function refactor(Node $node): ?int
18+
{
19+
if (! $node instanceof Node\Stmt\Class_) {
20+
return null;
21+
}
22+
23+
$implements = $node->implements;
24+
ld($implements);
25+
// if (! in_array('', $implements)) {
26+
27+
// }
28+
29+
ld($implements);
30+
}
31+
}

packages/upgrade/src/tempest2.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
use Rector\Renaming\Rector\Name\RenameClassRector;
55
use Rector\Renaming\Rector\PropertyFetch\RenamePropertyRector;
66
use Rector\Renaming\ValueObject\RenameProperty;
7+
use Tempest\Upgrade\Tempest2\MigrationRector;
78
use Tempest\Upgrade\Tempest2\RemoveIdImportRector;
89

910
return static function (RectorConfig $config) : void {
1011
$config->importNames();
1112
$config->importShortClasses();
1213

14+
$config->rule(MigrationRector::class);
15+
1316
$config->ruleWithConfiguration(RenameClassRector::class, [
1417
'Tempest\Database\Id' => 'Tempest\Database\PrimaryKey',
1518
'Tempest\CommandBus\AsyncCommand' => 'Tempest\CommandBus\Async',

0 commit comments

Comments
 (0)