Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Throwing exception if template directories are not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeltscher committed Apr 9, 2015
1 parent 38adaed commit 4e96b06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Templating/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ class Renderer
* @param string $fileExtension File extension for Handlebar files
* @param array $templateDirectories List of directories containing handlebars templates
* @param boolean $templateDirectoriesRecursive Whether to include sub directories of template directories
*
* @throws \InvalidArgumentException If no template directories got defined.
*/
public function __construct(
FileLocator $fileLocator,
$fileExtension,
array $templateDirectories,
$templateDirectoriesRecursive = true
) {
if (empty($templateDirectories)) {
throw new \InvalidArgumentException('No Handlebars template directories got defined in "smartive_handlebars.templating.template_directories".');
}
$this->fileLocator = $fileLocator;
if ($templateDirectoriesRecursive) {
$templateDirectories = $this->getTemplateDirectoriesRecursive($templateDirectories);
Expand Down

0 comments on commit 4e96b06

Please sign in to comment.