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




``` Hack
public function setType(
  string $type,
): this;
```




## Parameters




- ` string $type `




## Returns




+ ` this `