Facebook\HackCodegen\CodegenProperty
Facebook\HackCodegen\CodegenProperty
Generate code for a property variable
Please don’t use this class directly; instead use the function codegen_property. E.g.:
codegen_property(‘foo’) ->setProtected() ->setType(‘string’) ->setInlineComment(‘Represent the foo of the bar”) ->render();
Interface Synopsis
namespace Facebook\HackCodegen;
final class CodegenProperty implements ICodeBuilderRenderer {...}
Public Methods
->__construct(IHackCodegenConfig $config, string $name)
->appendToBuilder(HackBuilder $builder): HackBuilder
->getName(): string
->getType(): ?string
->getValue(): \mixed
->setInlineComment(string $comment): \this
->setIsStatic(bool $value = true): \this
->setType(string $type): \this
Set the type of the member var->setTypef(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): \this
->setValue<\T>(\T $value, \ IHackBuilderValueRenderer<\T> $renderer): \this
Set the initial value for the variable