Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Sep 12, 2025

Another obvious case to add iterable types are data providers and static data, like these:

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;

final class SomeTest extends TestCase
{
+   /**
+    * @param string[] $names
+    */
    #[DataProvider('provideData')]
    public function test(array $names): void
    {
    }

    public static function provideData()
    {
        yield [['Tom', 'John']];
    }
}

@TomasVotruba TomasVotruba changed the title tv array test from dataprovider [type-declaration-docblocks] Add AddParamArrayDocblockFromDataProviderRector Sep 12, 2025
@TomasVotruba TomasVotruba force-pushed the tv-array-test-from-dataprovider branch from 7371b58 to 7be1910 Compare September 12, 2025 13:44
@TomasVotruba TomasVotruba enabled auto-merge (squash) September 12, 2025 13:44
@TomasVotruba TomasVotruba merged commit 1514b5e into main Sep 12, 2025
49 checks passed
@TomasVotruba TomasVotruba deleted the tv-array-test-from-dataprovider branch September 12, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants