in src/HackBuilder.hack [321:337]
public function startForeachLoop(
string $traversable,
?string $key,
string $value,
): this {
$this->assertIsVariable($key !== null ? $key : '$_');
$this->assertIsVariable($value);
return $this
->addWithSuggestedLineBreaksf(
'foreach (%s as%s%s%s)',
$traversable,
self::DELIMITER,
$key !== null ? \sprintf('%s => ', $key) : '',
$value,
)
->openBrace();
}