public function generate(GeneratorInterface $generator)
    {
        $callback = function () use ($generator) {
            $handler = Handler::create($generator);
            $handler->generate();
        };

        return $callback();
    }
public function generate(GeneratorInterface $generator)
    {
        $callback = function () use ($generator) {
            $handler = Handler::create($generator);
            $handler->generate();
        };

        return $callback();
    }
public function generate ( GeneratorInterface $ generator ) { $ callback = function ( ) use ( $ generator ) { $ handler = Handler :: create ( $ generator ) ; $ handler -> generate ( ) ; } ; return $ callback ( ) ; }
Generates a document from given configuration using given generator.

@param GeneratorInterface $generator Instance of AbstractGeneratord

@return callable
Generates a document from given configuration using given generator .