|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Rector\Tests\TypeDeclarationDocblocks\Rector\Class_\AddReturnDocblockDataProviderRector\Fixture; |
| 4 | + |
| 5 | +use PHPStan\Type\ObjectType; |
| 6 | +use PHPUnit\Framework\Attributes\DataProvider; |
| 7 | +use PHPUnit\Framework\TestCase; |
| 8 | +use Rector\Tests\NodeTypeResolver\PerNodeTypeResolver\VariableTypeResolver\Source\AnotherType; |
| 9 | + |
| 10 | +final class KeepStringTypeSimple extends TestCase |
| 11 | +{ |
| 12 | + #[DataProvider('provideData')] |
| 13 | + public function testSomething() |
| 14 | + { |
| 15 | + } |
| 16 | + |
| 17 | + public static function provideData(): \Iterator |
| 18 | + { |
| 19 | + $anotherTypeObjectType = new ObjectType(AnotherType::class); |
| 20 | + yield [__DIR__ . '/Fixture/new_class.php.inc', 1, $anotherTypeObjectType]; |
| 21 | + yield [__DIR__ . '/Fixture/argument_typehint.php.inc', 1, $anotherTypeObjectType]; |
| 22 | + } |
| 23 | +} |
| 24 | + |
| 25 | +?> |
| 26 | +----- |
| 27 | +<?php |
| 28 | + |
| 29 | +namespace Rector\Tests\TypeDeclarationDocblocks\Rector\Class_\AddReturnDocblockDataProviderRector\Fixture; |
| 30 | + |
| 31 | +use PHPStan\Type\ObjectType; |
| 32 | +use PHPUnit\Framework\Attributes\DataProvider; |
| 33 | +use PHPUnit\Framework\TestCase; |
| 34 | +use Rector\Tests\NodeTypeResolver\PerNodeTypeResolver\VariableTypeResolver\Source\AnotherType; |
| 35 | + |
| 36 | +final class KeepStringTypeSimple extends TestCase |
| 37 | +{ |
| 38 | + #[DataProvider('provideData')] |
| 39 | + public function testSomething() |
| 40 | + { |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * @return \Iterator<array<int, (int | \PHPStan\Type\ObjectType | string)>> |
| 45 | + */ |
| 46 | + public static function provideData(): \Iterator |
| 47 | + { |
| 48 | + $anotherTypeObjectType = new ObjectType(AnotherType::class); |
| 49 | + yield [__DIR__ . '/Fixture/new_class.php.inc', 1, $anotherTypeObjectType]; |
| 50 | + yield [__DIR__ . '/Fixture/argument_typehint.php.inc', 1, $anotherTypeObjectType]; |
| 51 | + } |
| 52 | +} |
| 53 | + |
| 54 | +?> |
0 commit comments