---
layout: docs
title: getCode
id: class.Facebook.HackCodegen.BaseCodeBuilder.getCode
docid: class.Facebook.HackCodegen.BaseCodeBuilder.getCode
permalink: /docs/reference/class.Facebook.HackCodegen.BaseCodeBuilder.getCode/
---
# Facebook\\HackCodegen\\BaseCodeBuilder::getCode()




Get all the code that has been appended to the buffer




``` Hack
final public function getCode(): string;
```




This may only be called once.




## Returns




+ ` string `