Facebook\HackCodegen\ICodegenFactory
Facebook\HackCodegen\ICodegenFactory
Interface for factory methods to create codegen
This is the main entrypoint into the library; most users will want to use the concrete ` HackCodegenFactory ` class.
Interface Synopsis
namespace Facebook\HackCodegen;
interface ICodegenFactory {...}
Public Methods
-
->codegenClass(string $name): CodegenClass
Create a class -
->codegenClassConstant(string $name): CodegenClassConstant
Create a class constant -
->codegenClassConstantf(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenClassConstant
Create a class constant using a %-placeholder format string for the constant name -
->codegenClassf(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenClass
Create a class, using a %-placeholder format string for the class name -
->codegenConstant(string $name): CodegenConstant
Create a top-level constant (not a class constant) -
->codegenConstantf(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenConstant
Create a top-level constant (not a class constant), using a %-placeholder format string for the constant name -
->codegenEnumMember(string $name): CodegenEnumMember
Create an enum member -
->codegenEnumMemberf(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenEnumMember
Create an enum member using a %-placeholder format string for the constant name -
->codegenFile(string $file): CodegenFile
Create a file with the specified filename/path -
->codegenFilef(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenFile
Create a file with the specified filename/path using %-placeholder format strings -
->codegenFunction(string $name): CodegenFunction
Create a top-level function (not a method) -
->codegenFunctionf(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenFunction
Create a top-level function (not a method), using a %-placeholder format string for the function name -
->codegenGeneratedFromClass(string $class): CodegenGeneratedFrom
Generate a documentation comment indicating that a particular class was used to generate a file -
->codegenGeneratedFromMethod(string $class, string $method): CodegenGeneratedFrom
Generate a documentation comment indicating that a particular method was used to generate a file -
->codegenGeneratedFromMethodWithKey(string $class, string $method, string $key): CodegenGeneratedFrom
Generate a documentation comment indicating that a particular method was used to generate a file, with additional data -
->codegenGeneratedFromScript(?string $script = NULL): CodegenGeneratedFrom
Generate a documentation comment indicating that a particular script was used to generate a file -
->codegenHackBuilder(): HackBuilder
Create aHackBuilder
; this is used to generate code, rather than declarations -
->codegenImplementsInterface(string $name): CodegenImplementsInterface
Generate a declaration that a class implements a specified interface -
->codegenImplementsInterfaces(\ Traversable<string> $names): Traversable<CodegenImplementsInterface>
Generate declarations that a class implements the specified interfaces -
->codegenMethod(string $name): CodegenMethod
Create a method -
->codegenMethodf(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenMethod
Create a method, using a %-placeholder format string for the name -
->codegenNewtype(string $name): CodegenType
Generate anewtype
declaration -
->codegenProperty(string $name): CodegenProperty
Generate a class or trait property -
->codegenPropertyf(\HH\Lib\Str\SprintfFormatString $format, \mixed ...$args): CodegenProperty
Generate a class or trait property, using a %-placehodler format string for the property name -
->codegenShape(CodegenShapeMember ...$members): CodegenShape
-
->codegenType(string $name): CodegenType
Generate atype
declaration -
->codegenTypeConstant(string $name): CodegenTypeConstant
Create a class type constant -
->codegenTypeConstantf(\HH\Lib\Str\SprintfFormatString $name, \mixed ...$args): CodegenTypeConstant
Create a class type constant using a %-placeholder format string for the name -
->codegenUsesTrait(string $name): CodegenUsesTrait
Generate a ‘use’ statement, for adding a trait into a class or another trait -
->codegenUsesTraits(\ Traversable<string> $traits): Traversable<CodegenUsesTrait>
Generate a ‘use’ statements, for adding traits into a class or another trait