src/TemplateFactory.php
public static function getPhpEngineForDirectory(Directory $directory, array $globals = [])
    {
        $template = new Template(new FilesystemLoader($directory), $globals);
        $template->addEngine(new PhpEngine());

        static::addDefaultUtils($template);

        return $template;
    }
public static function getPhpEngineForDirectory(Directory $directory, array $globals = [])
    {
        $template = new Template(new FilesystemLoader($directory), $globals);
        $template->addEngine(new PhpEngine());

        static::addDefaultUtils($template);

        return $template;
    }
@param Directory $directory
@param array $globals

@return Template