factory() public static method

Static method to instantiate the interface generator object and return itself to facilitate chaining methods together.
public static factory ( string $name, string $parent = null ) : InterfaceGenerator
$name string
$parent string
return InterfaceGenerator
Example #1
0
 public function testRender()
 {
     $i = InterfaceGenerator::factory('TestInterface');
     $i->setNamespace(new NamespaceGenerator('Test\\Space'))->setParent('TestParent')->setDocblock(new DocblockGenerator('This is a test desc.'))->addMethod(new MethodGenerator('testMethod'));
     $code = (string) $i;
     $code = $i->render(true);
     ob_start();
     $i->render();
     $output = ob_get_clean();
     $this->assertContains('interface TestInterface', $output);
     $this->assertContains('interface TestInterface', $code);
 }