// test: Generator with single type param resolves item type in foreach
// feature: completion
// Adapted from phpactor generics/generator_2.test
// expect: intValue(
---
<?php
class IntWrapper {
public function intValue(): int {}
}
class Foobar {
/**
* @return \Generator<IntWrapper>
*/
public function gen(): \Generator
{
}
}
$foo = new Foobar();
foreach ($foo->gen() as $bar) {
$bar-><>
}