- Issue created by @mondrake
- First commit to issue fork.
- Assigned to ankitv18
- Issue was unassigned.
- Status changed to Needs review
5 months ago 11:34am 23 June 2024 - ๐ฎ๐ณIndia ankitv18
Added a typehint for dataProviders as array and \Generator wherever yield is used as return.
- Status changed to Needs work
5 months ago 4:46pm 23 June 2024 - Status changed to Needs review
5 months ago 5:15pm 23 June 2024 - ๐ฎ๐ณIndia ankitv18
sorry it was my bad, Now pipelines are green, hence moving into review.
- Status changed to Needs work
5 months ago 11:21pm 23 June 2024 - ๐ฆ๐บAustralia mstrelan
Added a typehint for dataProviders as array and \Generator wherever yield is used as return.
The issue summary suggests that generators should have the
iterable
typehint. So either we should update the issue summary or change\Generator
toiterable
.Also found a few missing:
- All tests that extend
\Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase
have aproviderSource
method - \Drupal\Tests\layout_builder\Unit\SectionTest::providerTestGetThirdPartySettings
- All tests that extend
- ๐ฎ๐ณIndia ankitv18
I think I have all missing return types for the @dataProviders.
@mstrelan for iterable or generator should be as a typehint , I'll left this for a discussion.
And Isn't the all iterable is a generator? So bit confused here as most of the place \Generator is mentioned the comment block of the provider method.cc: @xjm @mondrake @mustgrave
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
I think itโs more accurate to typehint
\Generator
whereyield is used
.iterable
is an alias forarray|\Traversable
which means itโs the most generic typehint possible. See https://www.php.net/manual/en/language.types.iterable.php - ๐ฎ๐ณIndia ankitv18
Yes, All iterable's is a generator.
With the @mondrake comment#11 I'm moving this issue into review.
as per @mstrelan comment#9 summary needs to be updated. - Status changed to Needs review
5 months ago 6:56am 24 June 2024 - Status changed to Needs work
5 months ago 3:12pm 28 June 2024 - ๐บ๐ธUnited States smustgrave
If summary needs to be updated then it should be NW
- ๐ฌ๐งUnited Kingdom longwave UK
Given #11 maybe all data providers should be
iterable
? It makes no difference for the purposes of the test whether it returns an array or uses a generator, and iterable allows us to use either and swap between them freely. - First commit to issue fork.