1 2 3 4 5 6 7 8 9 10 11 12 13
<?php namespace {{ namespace }}; if (!\function_exists('{{ namespace }}\{{ function }}')) { function {{ function }}(object $handle): \Generator { try { while (($chunk = $handle->next()) !== null) { yield $chunk; } } finally { $handle->close(); } } }