From 72007e65b439c5f915291674ea4f8614e297e669 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 12 Mar 2013 15:29:18 -0700 Subject: [PATCH] Simplify `setPartials` nested ifs. --- src/Mustache/Engine.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 62309d2..fd2fb05 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -241,14 +241,14 @@ class Mustache_Engine */ public function setPartials(array $partials = array()) { - if (isset($this->partialsLoader)) { - if (!$this->partialsLoader instanceof Mustache_Loader_MutableLoader) { - throw new Mustache_Exception_RuntimeException('Unable to set partials on an immutable Mustache Loader instance'); - } - } else { + if (!isset($this->partialsLoader)) { $this->partialsLoader = new Mustache_Loader_ArrayLoader; } + if (!$this->partialsLoader instanceof Mustache_Loader_MutableLoader) { + throw new Mustache_Exception_RuntimeException('Unable to set partials on an immutable Mustache Loader instance'); + } + $this->partialsLoader->setTemplates($partials); }