From c5bf83f9a954946182ecdf4b6fd9eee1de189249 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Wed, 8 Dec 2010 08:28:51 -0500 Subject: [PATCH] Move class constants to their logical places. --- Mustache.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Mustache.php b/Mustache.php index 4638a2a..d4bff90 100644 --- a/Mustache.php +++ b/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(?[%s])(?.+?)%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( '/(?(?<=\\n)[ \\t]*)?%s(?[%s]?)(?.+?)(?:\\2|})?%s(?:\\s*(?=\\n))?/s',