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




``` Hack
public function useNamespace(
  string $ns,
  ?string $as = NULL,
): this;
```




## Parameters




* ` string $ns `
* ` ?string $as = NULL `




## Returns




- ` this `