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




``` Hack
public function addConstant(
  Facebook\HackCodegen\CodegenClassConstant $const,
): this;
```




## Parameters




* [` Facebook\HackCodegen\CodegenClassConstant `](<class.Facebook.HackCodegen.CodegenClassConstant.md>)`` $const ``




## Returns




- ` this `