gossi\codegen\model\PhpFunction::create PHP Method

create() public static method

Creates a new PHP function
public static create ( string $name = null ) : static
$name string qualified name
return static
    public static function create($name = null)
    {
        return new static($name);
    }

Usage Example

 public function testReturnType()
 {
     $expected = "function foo(): int {\n}\n";
     $generator = new ModelGenerator(['generateReturnTypeHints' => true, 'generateDocblock' => false]);
     $method = PhpFunction::create('foo')->setType('int');
     $this->assertEquals($expected, $generator->generate($method));
 }
All Usage Examples Of gossi\codegen\model\PhpFunction::create