Jelajahi Sumber

Move class constants to their logical places.

Justin Hileman 15 tahun lalu
induk
melakukan
c5bf83f9a9
1 mengubah file dengan 9 tambahan dan 7 penghapusan
  1. 9 7
      Mustache.php

+ 9 - 7
Mustache.php

@@ -14,9 +14,6 @@
  */
 class Mustache {
 
-	public $_otag = '{{';
-	public $_ctag = '}}';
-
 	/**
 	 * Should this Mustache throw exceptions when it finds unexpected tags?
 	 *
@@ -85,6 +82,15 @@ class Mustache {
 	 */
 	const PRAGMA_UNESCAPED    = 'UNESCAPED';
 
+	/**
+	 * Constants used for section and tag RegEx
+	 */
+	const SECTION_TYPES = '\^#\/';
+	const TAG_TYPES = '#\^\/=!<>\\{&';
+
+	public $_otag = '{{';
+	public $_ctag = '}}';
+
 	protected $_tagRegEx;
 
 	protected $_template = '';
@@ -258,8 +264,6 @@ class Mustache {
 		return $template;
 	}
 
-	const SECTION_TYPES = '\^#\/';
-
 	protected function _prepareSectionRegEx($otag, $ctag) {
 		return sprintf(
 			'/(?:(?<=\\n)[ \\t]*)?%s(?<type>[%s])(?<tag_name>.+?)%s\\n?/s',
@@ -437,8 +441,6 @@ class Mustache {
 		return (isset($this->_throwsExceptions[$exception]) && $this->_throwsExceptions[$exception]);
 	}
 
-	const TAG_TYPES = '#\^\/=!<>\\{&';
-
 	protected function _prepareTagRegex($otag, $ctag) {
 		return sprintf(
 			'/(?<whitespace>(?<=\\n)[ \\t]*)?%s(?<type>[%s]?)(?<tag_name>.+?)(?:\\2|})?%s(?:\\s*(?=\\n))?/s',