src/TextParser.php
protected function createTemplatesDirIterator($templatesDir)
    {
        if (empty($templatesDir) || !is_dir($templatesDir)) {
            throw new \Exception('Invalid templates directory provided');
        }

        $this->directoryIterator = new DirectoryIterator(rtrim($templatesDir, '/'));
    }
protected function createTemplatesDirIterator($templatesDir)
    {
        if (empty($templatesDir) || !is_dir($templatesDir)) {
            throw new \Exception('Invalid templates directory provided');
        }

        $this->directoryIterator = new DirectoryIterator(rtrim($templatesDir, '/'));
    }
Sets the class property $templatesDirectoryPath

@param string $templatesDir ; The path to the template files directory
@throws \Exception