gossi\codegen\model\PhpInterface::fromFile PHP Method

fromFile() public static method

Creates a PHP interface from file
public static fromFile ( string $filename ) : PhpInterface
$filename string
return PhpInterface
    public static function fromFile($filename)
    {
        $interface = new PhpInterface();
        $parser = new FileParser($filename);
        $parser->addVisitor(new InterfaceParserVisitor($interface));
        $parser->addVisitor(new MethodParserVisitor($interface));
        $parser->addVisitor(new ConstantParserVisitor($interface));
        $parser->parse();
        return $interface;
    }

Usage Example

 public function testMyCollectionInterface()
 {
     $interface = PhpInterface::fromFile(__DIR__ . '/../fixtures/MyCollectionInterface.php');
     $interface->hasInterface('phootwork\\collection\\Collection');
 }
All Usage Examples Of gossi\codegen\model\PhpInterface::fromFile