---
layout: docs
title: codegenUsesTrait
id: interface.Facebook.HackCodegen.ICodegenFactory.codegenUsesTrait
docid: interface.Facebook.HackCodegen.ICodegenFactory.codegenUsesTrait
permalink: /docs/reference/interface.Facebook.HackCodegen.ICodegenFactory.codegenUsesTrait/
---
# Facebook\\HackCodegen\\ICodegenFactory::codegenUsesTrait()




Generate a 'use' statement, for adding a trait into a class or another
trait




``` Hack
public function codegenUsesTrait(
  string $name,
): Facebook\HackCodegen\CodegenUsesTrait;
```




## Parameters




+ ` string $name `




## Returns




* [` Facebook\HackCodegen\CodegenUsesTrait `](<class.Facebook.HackCodegen.CodegenUsesTrait.md>)