Facebook\HackCodegen\CodegenClass
Facebook\HackCodegen\CodegenClass
Generate code for a class
To construct an instance, use ` ICodegenFactory::codegenClass() `.
1
2
3
4
5
$factory->codegenClass('Foo')
->setExtends('bar')
->setIsFinal()
->addMethod(codegen_method('foobar'))
->render();
Interface Synopsis
namespace Facebook\HackCodegen;
final class CodegenClass extends CodegenClassish {...}
Public Methods
->addConstructorWrapperFunc(?Traversable<string> $params = NULL): \this
Add a factory function to wrap instantiations of to the class->addDeclComment(string $comment): \this
Add a comment before the class->getExtends(): ?string
Get the name of the parent class, ornull
if there is none->setConstructor(CodegenConstructor $constructor): \this
->setExtends(string $name): \this
Set the parent class of the generated class->setExtendsf(\HH\Lib\Str\SprintfFormatString $name, \mixed ...$args): \this
Set the parent class of the generated class, using a %-placeholder format string->setIsAbstract(bool $value = true): \this
->setIsFinal(bool $value = true): \this