@@ -27,13 +27,7 @@ final class AddAssertArrayFromClassMethodDocblockRector
2727{
2828 public function getRuleDefinition(): RuleDefinition
2929 {
30- $metadata = 'RectorPrefix202607\Webmozart\Assert\Assert';
31-
32- return new RuleDefinition(
33- 'Demo',
34- [
35- new ConfiguredCodeSample(
36- <<<'CODE_SAMPLE'
30+ return new RuleDefinition('Demo', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
3731<?php
3832
3933namespace RectorPrefix202607;
@@ -46,8 +40,7 @@ public function run()
4640}
4741\class_alias('SomeClass', 'SomeClass', \false);
4842CODE_SAMPLE
49- ,
50- <<<'CODE_SAMPLE'
43+ , <<<'CODE_SAMPLE'
5144<?php
5245
5346namespace RectorPrefix202607;
@@ -63,15 +56,7 @@ public function run()
6356}
6457\class_alias('SomeClass', 'SomeClass', \false);
6558CODE_SAMPLE
66- ,
67- []
68- ),
69- new CodeSample(
70- 'RectorPrefix202607\SomeVendor\ValueObject::class',
71- 'new RectorPrefix202607\SomeVendor\ValueObject()'
72- ),
73- ]
74- );
59+ , [AssertClassName::WEBMOZART])]);
7560 }
7661
7762 public function refactor(): void
@@ -111,8 +96,6 @@ public function refactor(): void
11196 $ this ->assertStringContainsString ('use RectorPrefix202607\Webmozart\Assert\Assert; ' , (string ) $ content );
11297 $ this ->assertStringContainsString ('use Webmozart\Assert\Assert; ' , $ codeSampleContent );
11398 $ this ->assertStringContainsString ('\Webmozart\Assert\Assert::allString($items); ' , $ codeSampleContent );
114- $ this ->assertStringContainsString ("'SomeVendor\ValueObject::class' " , (string ) $ content );
115- $ this ->assertStringContainsString ('$metadata = \'Webmozart\Assert\Assert \'; ' , (string ) $ content );
11699 $ this ->assertStringContainsString ('\RectorPrefix202607\SomeVendor\Runtime::class; ' , (string ) $ content );
117100 $ this ->assertStringNotContainsString ('namespace RectorPrefix202607; ' , $ codeSampleContent );
118101 $ this ->assertStringNotContainsString ('use RectorPrefix202607\Webmozart\Assert\Assert; ' , $ codeSampleContent );
0 commit comments