for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Andi\GraphQL\Common;
use Andi\GraphQL\TypeRegistryInterface;
final class LazyTypeIterator
{
/**
* @var pure-callable(): iterable
pure-callable(): iterable
0
*/
private readonly mixed $types;
public function __construct(
callable $types,
private readonly TypeRegistryInterface $typeRegistry,
) {
$this->types = $types;
types
Andi\GraphQL\Common\LazyTypeIterator
}
public function __invoke(): iterable
foreach (\call_user_func($this->types) as $type) {
yield $this->typeRegistry->get($type);