addMethod(codegen_method('IBar')) * * Notes: * - It can extend one or more other interfaces. * - It can have constants and methods. You don't need to mark your methods as * abstract; that will be done for you. * - Interfaces cannot use traits. */ final class CodegenInterface extends CodegenClassBase { use CodegenClassWithInterfaces; protected function buildDeclaration(HackBuilder $builder): void { $builder->add('interface '.$this->name); $this->renderInterfaceList($builder, 'extends'); } protected function appendBodyToBuilder(HackBuilder $builder): void { $this->buildConsts($builder); $this->buildMethods($builder); } } function codegen_interface(string $name): CodegenInterface { return new CodegenInterface($name); }