Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 61070f0

Browse files
Fixed README with namespaces
1 parent 6a9bc82 commit 61070f0

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ Hack Codegen requires:
2020
* Composer
2121

2222
## Installing Hack Codegen
23-
To install this package via composer, just add the package to require and start using it.
24-
25-
```json
26-
{
27-
"require": {
28-
"facebook/hack-codegen": "*"
29-
}
30-
}
23+
This package can be installed via composer:
24+
25+
```bash
26+
composer require facebook/hack-codegen
3127
```
3228

3329
## Usage
@@ -38,11 +34,14 @@ For example:
3834
<?hh
3935
require 'vendor/autoload.php';
4036

41-
echo codegen_file('HelloWorld.php')
37+
use Facebook\HackCodegen as codegen;
38+
39+
echo codegen\codegen_file('HelloWorld.php')
4240
->addClass(
43-
codegen_class('HelloWorld')
41+
codegen\codegen_class('HelloWorld')
4442
->addMethod(
45-
codegen_method('sayHi')
43+
codegen\codegen_method('sayHi')
44+
->setReturnType('void')
4645
->setBody('echo "hello world\n";')
4746
)
4847
)->save();

0 commit comments

Comments
 (0)