diff --git a/packages/PHPUnit/src/Rector/ArrayToYieldDataProviderRector.php b/packages/PHPUnit/src/Rector/ArrayToYieldDataProviderRector.php index b75cbb127ca..2efb2145eb9 100644 --- a/packages/PHPUnit/src/Rector/ArrayToYieldDataProviderRector.php +++ b/packages/PHPUnit/src/Rector/ArrayToYieldDataProviderRector.php @@ -11,7 +11,6 @@ use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Expression; use PhpParser\Node\Stmt\Return_; -use Rector\Node\Attribute; use Rector\NodeTypeResolver\PhpDoc\NodeAnalyzer\DocBlockAnalyzer; use Rector\Rector\AbstractPHPUnitRector; use Rector\RectorDefinition\CodeSample; diff --git a/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Correct/correct.php.inc b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Correct/correct.php.inc new file mode 100644 index 00000000000..881ef53b257 --- /dev/null +++ b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Correct/correct.php.inc @@ -0,0 +1,20 @@ +someChildValueObject = new SomeChildOfValueObject('value'); + + $someChildValueObject = new SomeChildOfValueObject(); + } +} diff --git a/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Correct/correct2.php.inc b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Correct/correct2.php.inc new file mode 100644 index 00000000000..f063f11b613 --- /dev/null +++ b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Correct/correct2.php.inc @@ -0,0 +1,14 @@ +doTestFileMatchesExpectedContent($wrong, $fixed); + } + + public function provideWrongToFixedFiles(): Iterator + { + yield [__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc']; + yield [__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc']; + yield [__DIR__ . '/Wrong/wrong3.php.inc', __DIR__ . '/Correct/correct3.php.inc']; + } + + protected function provideConfig(): string + { + return __DIR__ . '/config.yml'; + } +} diff --git a/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Wrong/wrong.php.inc b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Wrong/wrong.php.inc new file mode 100644 index 00000000000..103e128778e --- /dev/null +++ b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Wrong/wrong.php.inc @@ -0,0 +1,20 @@ +someChildValueObject = new SomeChildOfValueObject('value'); + + $someChildValueObject = new SomeChildOfValueObject(); + } +} diff --git a/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Wrong/wrong2.php.inc b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Wrong/wrong2.php.inc new file mode 100644 index 00000000000..9c9eeae4e9d --- /dev/null +++ b/tests/Rector/DomainDrivenDesign/ValueObjectRemoverDocBlockRector/Wrong/wrong2.php.inc @@ -0,0 +1,14 @@ +