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




Strictly equivalent to calling closeBrace, which unindent and newline,
but for readability, you should use this with startIfBlock




``` Hack
public function endIfBlock(): this;
```




## Returns




- ` this `