Skip to content

Commit c2bc8f9

Browse files
committed
misc
1 parent 7edb410 commit c2bc8f9

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

rector.php

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,18 @@
44

55
use Rector\Config\RectorConfig;
66
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
7-
use Rector\Set\ValueObject\SetList;
8-
9-
return static function (RectorConfig $rectorConfig): void {
10-
$rectorConfig->importNames();
11-
12-
$rectorConfig->paths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/rules', __DIR__ . '/rules-tests']);
13-
14-
$rectorConfig->skip([
15-
// for tests
16-
'*/Source/*',
177

8+
return RectorConfig::configure()
9+
->withImportNames()
10+
->withPaths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/rules', __DIR__ . '/rules-tests'])
11+
->withSkip([
1812
StringClassNameToClassConstantRector::class => [__DIR__ . '/src/DocFactory.php'],
19-
]);
20-
21-
$rectorConfig->sets([
22-
SetList::INSTANCEOF,
23-
SetList::NAMING,
24-
SetList::TYPE_DECLARATION,
25-
SetList::DEAD_CODE,
26-
SetList::CODE_QUALITY,
27-
SetList::CODING_STYLE,
28-
]);
29-
};
13+
])
14+
->withPreparedSets(
15+
instanceOf: true,
16+
naming: true,
17+
typeDeclarations: true,
18+
deadCode: true,
19+
codeQuality: true,
20+
codingStyle: true,
21+
);

rules/Rector/Class_/PromisesToAssertsRector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use PhpParser\Node\Expr\PropertyFetch;
1313
use PhpParser\Node\Expr\Variable;
1414
use PhpParser\Node\Stmt\Class_;
15-
use PHPStan\Node\ClassMethod;
1615
use Rector\PhpSpecToPHPUnit\Enum\PhpSpecMethodName;
1716
use Rector\PhpSpecToPHPUnit\Enum\PHPUnitMethodName;
1817
use Rector\PhpSpecToPHPUnit\Enum\ProphecyPromisesToPHPUnitAssertMap;
@@ -159,7 +158,7 @@ public function refactor(Node $node): Node|null
159158
}
160159

161160
// it's a local method call, skip
162-
if ($class->getMethod($methodName) instanceof ClassMethod) {
161+
if ($class->getMethod($methodName) instanceof Node\Stmt\ClassMethod) {
163162
return null;
164163
}
165164

0 commit comments

Comments
 (0)