Skip to content

Commit a77b2be

Browse files
committed
add fixture
1 parent fbb95aa commit a77b2be

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
)
2424
->withAttributesSets()
2525
->withComposerBased(phpunit: true)
26+
->withSets([\Rector\Set\ValueObject\SetList::TYPE_DECLARATION_DOCBLOCKS])
2627
->withPhpSets()
2728
->withPaths([
2829
__DIR__ . '/bin',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockReturnArrayFromDirectArrayInstanceRector\Fixture;
4+
5+
use PhpParser\Node;
6+
use PhpParser\Node\Stmt\Class_;
7+
use PhpParser\Node\Stmt\ClassMethod;
8+
use Rector\Rector\AbstractRector;
9+
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
10+
11+
final class MultipleNodeTypes extends AbstractRector
12+
{
13+
public function getNodeTypes(): array
14+
{
15+
return [Class_::class, ClassMethod::class];
16+
}
17+
18+
public function getRuleDefinition(): RuleDefinition
19+
{
20+
}
21+
22+
public function refactor(Node $node)
23+
{
24+
}
25+
}
26+
27+
?>
28+
-----
29+
<?php
30+
31+
namespace Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockReturnArrayFromDirectArrayInstanceRector\Fixture;
32+
33+
final class MultipleNodeTypes
34+
{
35+
/**
36+
* @return array<int, array<string, int|string>>
37+
*/
38+
private static function getExpectedAllOwners(): array
39+
{
40+
return [
41+
[
42+
'key1' => 100,
43+
'key2' => '-25.5%',
44+
],
45+
[
46+
'key3' => 'Yes',
47+
'key4' => 200,
48+
],
49+
];
50+
}
51+
}
52+
53+
?>

0 commit comments

Comments
 (0)