src/TextParser.php
protected function getTemplates($text, $findMatchingTemplate)
    {
        if ($findMatchingTemplate) {
            return $this->findTemplate($text);
        }

        $templates = [];
        foreach ($this->directoryIterator as $fileInfo) {
            if (!is_file($fileInfo->getPathname())) {
                continue;
            }

            $templates[$fileInfo->getPathname()] = file_get_contents($fileInfo->getPathname());
        }

        return $templates;
    }
protected function getTemplates($text, $findMatchingTemplate)
    {
        if ($findMatchingTemplate) {
            return $this->findTemplate($text);
        }

        $templates = [];
        foreach ($this->directoryIterator as $fileInfo) {
            if (!is_file($fileInfo->getPathname())) {
                continue;
            }

            $templates[$fileInfo->getPathname()] = file_get_contents($fileInfo->getPathname());
        }

        return $templates;
    }
protected function getTemplates ( $ text , $ findMatchingTemplate ) { if ( $ findMatchingTemplate ) { return $ this -> findTemplate ( $ text ) ; } $ templates = [ ] ; foreach ( $ this -> directoryIterator as $ fileInfo ) { if ( ! is_file ( $ fileInfo -> getPathname ( ) ) ) { continue ; } $ templates [ $ fileInfo -> getPathname ( ) ] = file_get_contents ( $ fileInfo -> getPathname ( ) ) ; } return $ templates ; }
Returns array of available template patterns or performs a similarity match (slower) to return best match template

@param string $text ; The text provided by the user for parsing
@param boolean $findMatchingTemplate ; A boolean to enable the similarity match against templates before parsing
@return array
Returns array of available template patterns or performs a similarity match ( slower ) to return best match template