From 289f63c2582b8644d712a17412d573e0612b577b Mon Sep 17 00:00:00 2001 From: Nathanael Noblet Date: Tue, 1 Nov 2016 13:44:13 -0600 Subject: [PATCH] Allow construction without constructor arguments Since we can dynamically add templates and its possible to not need to construct the loader without any initial templates. I've added the default argument to the constructor for simpler instantiation IE new Twig_Loader_Array();. This helps us on a project where we've extended the loader, and have no initial templates but need to add constructor parameters for no real reason. --- lib/Twig/Loader/Array.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Twig/Loader/Array.php b/lib/Twig/Loader/Array.php index 4e9ddd2f8..c0f31d353 100644 --- a/lib/Twig/Loader/Array.php +++ b/lib/Twig/Loader/Array.php @@ -30,7 +30,7 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf * * @param array $templates An array of templates (keys are the names, and values are the source code) */ - public function __construct(array $templates) + public function __construct(array $templates = array()) { $this->templates = $templates; }