src/generators/FileGenerator.php
protected function resolveTemplateFile(array $templates = array())
    {
        $templatePath = $this->getTemplatePath();

        $templates = array_merge($templates, $this->getDefaultTemplates());

        if (empty($templates)) {
            throw new Exception("No templates available.");
        }

        foreach ($templates as $templateFile) {
            $filePath = "$templatePath/$templateFile";

            if (is_file($filePath)) {
                return $filePath;
            }
        }

        return null;
    }
protected function resolveTemplateFile(array $templates = array())
    {
        $templatePath = $this->getTemplatePath();

        $templates = array_merge($templates, $this->getDefaultTemplates());

        if (empty($templates)) {
            throw new Exception("No templates available.");
        }

        foreach ($templates as $templateFile) {
            $filePath = "$templatePath/$templateFile";

            if (is_file($filePath)) {
                return $filePath;
            }
        }

        return null;
    }
protected function resolveTemplateFile ( array $ templates = array ( ) ) { $ templatePath = $ this -> getTemplatePath ( ) ; $ templates = array_merge ( $ templates , $ this -> getDefaultTemplates ( ) ) ; if ( empty ( $ templates ) ) { throw new Exception ( "No templates available." ) ; } foreach ( $ templates as $ templateFile ) { $ filePath = "$templatePath/$templateFile" ; if ( is_file ( $ filePath ) ) { return $ filePath ; } } return null ; }
Determines the template file to use for generating the file.

@param array $templates list of candidate templates.
@return string path to the template file or null if no template is found.
Determines the template file to use for generating the file .