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

Commit 58ef9bb

Browse files
committed
update docs
1 parent 8614374 commit 58ef9bb

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

docs/_docs/classes/codegen-class-base.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,7 @@ Generics
3131

3232
This API is likely to be changed in a future release of Hack Codegen.
3333

34-
A class can be marked as generic by calling `setGenericsDecl()`, which takes a `Map`.
35-
36-
The keys for this map are the type name, and the values are an optional `as`
37-
constraint - use `null` for no contraint.
38-
39-
For constraints other than `as`, also leave the value as null, but put the name
40-
and the constraints together in the key, eg `Map { 'T as Foo super Bar' => null }`;
34+
A class can be marked as generic by calling `addGenerics()`, which takes a `Traversable`. Alternatively, you can separately call `addGeneric()` or `addGenericf()` for each generic.
4135

4236
Constants
4337
---------

docs/_docs/classes/codegen-function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Attributes
3232

3333
To make a function memoized (adding the `<<__Memoize>>` attribute), call
3434
`->setIsMemoized(bool $value = true)`; for other attributes, call
35-
`->setUserAttribute(string $name, ?string $value)`.
35+
`->addUserAttribute(string $name, ?string $value)`.
3636

3737
FIXMEs
3838
------

docs/_docs/hack-builder/blocks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ Switch Statements
4444
<?hh
4545
$builder
4646
->startSwitch('$var')
47-
->addCase('foo')
47+
->addCase('foo', HackBuilderValues::export())
4848
/* do stuff */
4949
->breakCase()
50-
->addCase('bar')
50+
->addCase('bar', HackBuilderValues::export())
5151
/* do stuff */
5252
->returnCase('$x', HackBuilderValues::literal())
5353
->addDefault()

docs/_docs/overview/partially-generated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $file = $factory
8181
->setPseudomainHeader(
8282
$factory
8383
->codegenHackBuilder()
84-
->beginManualSection('mykey')
84+
->startManualSection('mykey')
8585
->addLine('require_once(\'vendor/autoload.php\');')
8686
->endManualSection()
8787
->getCode()

docs/_docs/overview/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function make_script(): void {
5959
->setReturnType('void')
6060
->setBody(
6161
$cg->codegenHackBuilder()
62-
->beginManualSection('greeting')
62+
->startManualSection('greeting')
6363
->addAssignment(
6464
'$greeting',
6565
"Hello, world!",

0 commit comments

Comments
 (0)