From f68335c845bac2bf46e99410db81ab27f5d78193 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 29 Apr 2010 21:39:50 -0400 Subject: [PATCH] Return false instead of null in hasPragma. Added documentation for pragma methods. --- Mustache.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Mustache.php b/Mustache.php index 0d06f22..ee5dffb 100644 --- a/Mustache.php +++ b/Mustache.php @@ -98,7 +98,6 @@ class Mustache { } } - /** * Internal render function, used for recursive calls. * @@ -220,12 +219,29 @@ class Mustache { return ''; } + /** + * Check whether this Mustache has a specific pragma. + * + * @access protected + * @param string $pragma_name + * @return bool + */ protected function hasPragma($pragma_name) { if (array_key_exists($pragma_name, $this->pragmas) && $this->pragmas[$pragma_name]) { return true; + } else { + return false; } } + /** + * Return pragma options, if any. + * + * @access protected + * @param string $pragma_name + * @return mixed + * @throws MustacheException Unknown pragma + */ protected function getPragmaOptions($pragma_name) { if (!$this->hasPragma()) { throw new MustacheException('Unknown pragma: ' . $pragma_name, MustacheException::UNKNOWN_PRAGMA);