Преглед изворни кода

Return false instead of null in hasPragma. Added documentation for pragma methods.

Justin Hileman пре 15 година
родитељ
комит
f68335c845
1 измењених фајлова са 17 додато и 1 уклоњено
  1. 17 1
      Mustache.php

+ 17 - 1
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);