Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Nov 14, 2017
1 parent 8614374 commit 58ef9bb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions docs/_docs/classes/codegen-class-base.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ Generics

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

A class can be marked as generic by calling `setGenericsDecl()`, which takes a `Map`.

The keys for this map are the type name, and the values are an optional `as`
constraint - use `null` for no contraint.

For constraints other than `as`, also leave the value as null, but put the name
and the constraints together in the key, eg `Map { 'T as Foo super Bar' => null }`;
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.

Constants
---------
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/classes/codegen-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Attributes

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

FIXMEs
------
Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/hack-builder/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Switch Statements
<?hh
$builder
->startSwitch('$var')
->addCase('foo')
->addCase('foo', HackBuilderValues::export())
/* do stuff */
->breakCase()
->addCase('bar')
->addCase('bar', HackBuilderValues::export())
/* do stuff */
->returnCase('$x', HackBuilderValues::literal())
->addDefault()
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/overview/partially-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ $file = $factory
->setPseudomainHeader(
$factory
->codegenHackBuilder()
->beginManualSection('mykey')
->startManualSection('mykey')
->addLine('require_once(\'vendor/autoload.php\');')
->endManualSection()
->getCode()
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/overview/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function make_script(): void {
->setReturnType('void')
->setBody(
$cg->codegenHackBuilder()
->beginManualSection('greeting')
->startManualSection('greeting')
->addAssignment(
'$greeting',
"Hello, world!",
Expand Down

0 comments on commit 58ef9bb

Please sign in to comment.