From 11ad87ae2d4a5db52fa5831ca1921784145600ed Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 16 Jul 2015 16:24:02 +0800 Subject: [PATCH 01/12] Lazily evaluate blocks pragmas. The specific example in the docs page about what does not work, is exactly what we need to make this useful. Fixes #264 --- src/Mustache/Compiler.php | 21 +++++++----- .../Test/Functional/InheritanceTest.php | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index e25bd8c..bf5f808 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -233,9 +233,10 @@ class Mustache_Compiler } const BLOCK_VAR = ' - $value = $this->resolveValue($context->findInBlock(%s), $context, $indent); - if ($value && !is_array($value) && !is_object($value)) { - $buffer .= $value; + $blockFunction = $context->findInBlock(%s); + if (is_callable($blockFunction)) { + $boundFunction = $blockFunction->bindTo($this, $this); + $boundFunction($context, $buffer); } else { %s } @@ -258,13 +259,15 @@ class Mustache_Compiler { $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes, 2)); + return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes)); } const BLOCK_ARG = ' // %s block_arg - $value = $this->section%s($context, \'\', true); - $newContext[%s] = %s$value; + $blockFunction = function(& $context, & $buffer, $indent=\'\') { + %s + }; + $newContext[%s] = $blockFunction; '; /** @@ -282,10 +285,10 @@ class Mustache_Compiler */ private function blockArg($nodes, $id, $start, $end, $otag, $ctag, $level) { - $key = $this->section($nodes, $id, array(), $start, $end, $otag, $ctag, $level, true); - $id = var_export($id, true); + $id = var_export($id, true); + $code = $this->walk($nodes, 1); - return sprintf($this->prepare(self::BLOCK_ARG, $level), $id, $key, $id, $this->flushIndent()); + return sprintf($this->prepare(self::BLOCK_ARG, 1), $id, $code, $id); } const SECTION_CALL = ' diff --git a/test/Mustache/Test/Functional/InheritanceTest.php b/test/Mustache/Test/Functional/InheritanceTest.php index 122ed31..b2e178d 100644 --- a/test/Mustache/Test/Functional/InheritanceTest.php +++ b/test/Mustache/Test/Functional/InheritanceTest.php @@ -433,6 +433,40 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas $this->assertEquals('default content', $tpl->render($data)); } + public function testInheritanceWithLazyEvaluation() + { + $partials = array( + 'parent' => '{{#items}}{{$value}}ignored{{/value}}{{/items}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{{{/value}}{{/parent}}' + ); + + $data = array('items' => array(1, 2, 3)); + + $this->assertEquals('<1><2><3>', $tpl->render($data)); + } + + public function testInheritanceWithLazyEvaluationWhitespaceIgnored() + { + $partials = array( + 'parent' => '{{#items}}{{$value}}\n\nignored\n\n{{/value}}{{/items}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{{{/value}}\n\n{{/parent}}' + ); + + $data = array('items' => array(1, 2, 3)); + + $this->assertEquals('<1><2><3>', $tpl->render($data)); + } + /** * @dataProvider getIllegalInheritanceExamples * @expectedException Mustache_Exception_SyntaxException From 1e63ba5fd9f17983bcf8c6ebed64c570eb827333 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Fri, 17 Jul 2015 14:55:02 +0800 Subject: [PATCH 02/12] Add block functions to the template, so they can be evaluated lazily. Fixes #264 --- src/Mustache/Compiler.php | 48 +++++++++++++++---- .../Test/Functional/InheritanceTest.php | 17 +++++++ 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index bf5f808..334fd55 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -19,6 +19,7 @@ class Mustache_Compiler private $pragmas; private $defaultPragmas = array(); private $sections; + private $blocks; private $source; private $indentNextLine; private $customEscape; @@ -43,6 +44,7 @@ class Mustache_Compiler { $this->pragmas = $this->defaultPragmas; $this->sections = array(); + $this->blocks = array(); $this->source = $source; $this->indentNextLine = true; $this->customEscape = $customEscape; @@ -195,6 +197,7 @@ class Mustache_Compiler return $buffer; } %s + %s }'; const KLASS_NO_LAMBDAS = 'walk($tree); $sections = implode("\n", $this->sections); - $klass = empty($this->sections) ? self::KLASS_NO_LAMBDAS : self::KLASS; + $blocks = implode("\n", $this->blocks); + $klass = empty($this->sections) && empty($this->blocks) ? self::KLASS_NO_LAMBDAS : self::KLASS; $callable = $this->strictCallables ? $this->prepare(self::STRICT_CALLABLE) : ''; - return sprintf($this->prepare($klass, 0, false, true), $name, $callable, $code, $sections); + return sprintf($this->prepare($klass, 0, false, true), $name, $callable, $code, $sections, $blocks); } const BLOCK_VAR = ' $blockFunction = $context->findInBlock(%s); if (is_callable($blockFunction)) { - $boundFunction = $blockFunction->bindTo($this, $this); - $boundFunction($context, $buffer); + $buffer .= call_user_func($blockFunction, $context); } else { %s } @@ -259,15 +262,12 @@ class Mustache_Compiler { $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes)); + return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes, $level)); } const BLOCK_ARG = ' // %s block_arg - $blockFunction = function(& $context, & $buffer, $indent=\'\') { - %s - }; - $newContext[%s] = $blockFunction; + $newContext[%s] = array($this, \'block%s\'); '; /** @@ -285,10 +285,38 @@ class Mustache_Compiler */ private function blockArg($nodes, $id, $start, $end, $otag, $ctag, $level) { + $key = $this->block($nodes); + $keystr = var_export($key, true); $id = var_export($id, true); + + return sprintf($this->prepare(self::BLOCK_ARG, 1), $keystr, $id, $key); + } + + const BLOCK_FUNCTION = 'public function block%s($context) { + $indent = $buffer = \'\'; + + %s + + return $buffer; + }'; + + /** + * Generate Mustache Template inheritance block function PHP source. + * + * @param array $nodes Array of child tokens + * + * @return string key of new block function + */ + private function block($nodes) + { $code = $this->walk($nodes, 1); - return sprintf($this->prepare(self::BLOCK_ARG, 1), $id, $code, $id); + $key = ucfirst(md5($code)); + + if (!isset($this->blocks[$key])) { + $this->blocks[$key] = sprintf($this->prepare(self::BLOCK_FUNCTION, 1), $key, $code); + } + return $key; } const SECTION_CALL = ' diff --git a/test/Mustache/Test/Functional/InheritanceTest.php b/test/Mustache/Test/Functional/InheritanceTest.php index b2e178d..598e798 100644 --- a/test/Mustache/Test/Functional/InheritanceTest.php +++ b/test/Mustache/Test/Functional/InheritanceTest.php @@ -467,6 +467,23 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas $this->assertEquals('<1><2><3>', $tpl->render($data)); } + public function testInheritanceWithLazyEvaluationAndSections() + { + $partials = array( + 'parent' => '{{#items}}{{$value}}\n\nignored {{.}} {{#more}} there is more {{/more}}\n\n{{/value}}{{/items}}', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + '{{{{#more}} there is less {{/more}}{{/value}}\n\n{{/parent}}' + ); + + $data = array('items' => array(1, 2, 3), 'more' => 'stuff'); + + $this->assertEquals('<1> there is less <2> there is less <3> there is less ', $tpl->render($data)); + } + /** * @dataProvider getIllegalInheritanceExamples * @expectedException Mustache_Exception_SyntaxException From d8da5f1d9940fd06d90d8537693c78704489b4ec Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 18 Jul 2015 01:12:21 -0700 Subject: [PATCH 03/12] Clean up compiled PHP coding style. --- src/Mustache/Compiler.php | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index 334fd55..076501e 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -240,8 +240,7 @@ class Mustache_Compiler $blockFunction = $context->findInBlock(%s); if (is_callable($blockFunction)) { $buffer .= call_user_func($blockFunction, $context); - } else { - %s + } else {%s } '; @@ -265,10 +264,7 @@ class Mustache_Compiler return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes, $level)); } - const BLOCK_ARG = ' - // %s block_arg - $newContext[%s] = array($this, \'block%s\'); - '; + const BLOCK_ARG = '$newContext[%s] = array($this, \'block%s\');'; /** * Generate Mustache Template inheritance block argument PHP source. @@ -289,33 +285,34 @@ class Mustache_Compiler $keystr = var_export($key, true); $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_ARG, 1), $keystr, $id, $key); + return sprintf($this->prepare(self::BLOCK_ARG, 1), $id, $key); } - const BLOCK_FUNCTION = 'public function block%s($context) { - $indent = $buffer = \'\'; - - %s + const BLOCK_FUNCTION = ' + public function block%s($context) + { + $indent = $buffer = \'\';%s return $buffer; - }'; + } + '; /** * Generate Mustache Template inheritance block function PHP source. * - * @param array $nodes Array of child tokens + * @param array $nodes Array of child tokens * * @return string key of new block function */ private function block($nodes) { - $code = $this->walk($nodes, 1); - + $code = $this->walk($nodes, 0); $key = ucfirst(md5($code)); if (!isset($this->blocks[$key])) { - $this->blocks[$key] = sprintf($this->prepare(self::BLOCK_FUNCTION, 1), $key, $code); + $this->blocks[$key] = sprintf($this->prepare(self::BLOCK_FUNCTION, 0), $key, $code); } + return $key; } @@ -349,7 +346,8 @@ class Mustache_Compiler } return $buffer; - }'; + } + '; /** * Generate Mustache Template section PHP source. @@ -399,7 +397,8 @@ class Mustache_Compiler $value = $context->%s(%s);%s if (empty($value)) { %s - }'; + } + '; /** * Generate Mustache Template inverted section PHP source. From 27a8bf0b698e6cc2eec71cf02261b5001210888a Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 18 Jul 2015 07:23:23 -0700 Subject: [PATCH 04/12] Update to latest php-cs-fixer config. Update to corresponding style-ci config options. Fix a few code style issues in the process. --- .php_cs | 15 +++++++++++++-- .styleci.yml | 5 ++++- bin/create_example.php | 13 +++---------- test/Mustache/Test/EngineTest.php | 4 ++-- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.php_cs b/.php_cs index 8ea84c3..d924712 100644 --- a/.php_cs +++ b/.php_cs @@ -6,10 +6,21 @@ use Symfony\CS\FixerInterface; $config = Config::create() // use symfony level and extra fixers: ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) - ->fixers(array('align_double_arrow', '-concat_without_spaces', 'concat_with_spaces', 'ordered_use', 'strict')) + ->fixers(array( + '-concat_without_spaces', + '-pre_increment', + '-unalign_double_arrow', + '-unalign_equals', + 'align_double_arrow', + 'concat_with_spaces', + 'ordered_use', + 'strict', + )) ->setUsingLinter(false); $finder = $config->getFinder() - ->in(__DIR__); + ->in('bin') + ->in('src') + ->in('test'); return $config; diff --git a/.styleci.yml b/.styleci.yml index a871cfe..1aebcc3 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -7,4 +7,7 @@ enabled: - strict disabled: - - concat_without_spaces \ No newline at end of file + - concat_without_spaces + - pre_increment + - unalign_double_arrow + - unalign_equals diff --git a/bin/create_example.php b/bin/create_example.php index cca36f3..0c41f47 100755 --- a/bin/create_example.php +++ b/bin/create_example.php @@ -34,7 +34,6 @@ define('EXAMPLE_PATH', realpath(dirname(__FILE__) . '/../test/fixtures/examples' * AStringMore -> a_string_more * * @param string $name - * @access public * * @return string */ @@ -56,7 +55,6 @@ function getLowerCaseName($name) * a_string_more -> AStringMore -> a_string_more * * @param string $name - * @access public * * @return string */ @@ -72,7 +70,6 @@ function getUpperCaseName($name) * return the given value and echo it out appending "\n". * * @param mixed $value - * @access public * * @return mixed */ @@ -91,9 +88,8 @@ function out($value) * the returned filename will be echoed out. * * @param string $directory directory without / at the end - * @param string $filename filename without path and extension + * @param string $filename filename without path and extension * @param string $extension extension of the file without "." - * @access public * * @return string */ @@ -109,7 +105,6 @@ function buildPath($directory, $filename = null, $extension = null) * the script die()'s if mkdir() fails. * * @param string $directory - * @access public */ function createDirectory($directory) { @@ -124,10 +119,9 @@ function createDirectory($directory) * the script die()'s if fopen() fails. * * @param string $directory directory without / at the end - * @param string $filename filename without path and extension + * @param string $filename filename without path and extension * @param string $extension extension of the file without "." - * @param string $content the content of the file - * @access public + * @param string $content the content of the file */ function createFile($directory, $filename, $extension, $content = '') { @@ -150,7 +144,6 @@ function createFile($directory, $filename, $extension, $content = '') * examples/some_thing/SomeThing.php * * @param mixed $example_name - * @access public */ function main($example_name) { diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index c4c8890..f34db4b 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -317,8 +317,8 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase list($name, $mustache) = $this->getLoggedMustache(Mustache_Logger::DEBUG); $mustache->render('{{ foo }}{{> bar }}', array('foo' => 'FOO')); $log = file_get_contents($name); - $this->assertContains('DEBUG: Instantiating template: ', $log); - $this->assertContains("WARNING: Partial not found: \"bar\"", $log); + $this->assertContains('DEBUG: Instantiating template: ', $log); + $this->assertContains('WARNING: Partial not found: "bar"', $log); } /** From 6b16313cedacacccb57dedb577f542976472c3f6 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 18 Jul 2015 07:28:44 -0700 Subject: [PATCH 05/12] Update travis-ci environments. hhvm-nightly is no more, but there is a php 7.0. Will it pass? The suspense is killing me! --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4c894ed..a938487 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 - hhvm - - hhvm-nightly sudo: false From ba028d1dcf3757c12b4a9cfa663f05d7bdce6f95 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 18 Jul 2015 07:30:38 -0700 Subject: [PATCH 06/12] We won't be needing this anymore. --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a938487..7d3b7e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,3 @@ php: - hhvm sudo: false - -matrix: - allow_failures: - - php: hhvm-nightly - fast_finish: true From a5ad0a86dbfdbc2ee918e6eff54c02b444a746cc Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 19 Jul 2012 23:14:09 -0700 Subject: [PATCH 07/12] Anchor dot notation context: {{ .foo }} 1. Given that {{ . }} resolves as the top of the context stack; 2. And when any falsey segment in a dotted name is encountered, the whole name yields ''; 3. A name like {{ .name }} should imply {{ [top of stack].name }}; 4. Thus, it must resolve as truthy only if a member of the top of the context stack matches name. See mustache/spec#52 --- src/Mustache/Context.php | 7 ++++- test/Mustache/Test/ContextTest.php | 43 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/Mustache/Context.php b/src/Mustache/Context.php index db03acc..f729c87 100644 --- a/src/Mustache/Context.php +++ b/src/Mustache/Context.php @@ -128,7 +128,12 @@ class Mustache_Context { $chunks = explode('.', $id); $first = array_shift($chunks); - $value = $this->findVariableInStack($first, $this->stack); + + if ($first === '') { + $value = $this->last(); + } else { + $value = $this->findVariableInStack($first, $this->stack); + } foreach ($chunks as $chunk) { if ($value === '') { diff --git a/test/Mustache/Test/ContextTest.php b/test/Mustache/Test/ContextTest.php index 864b448..19589d5 100644 --- a/test/Mustache/Test/ContextTest.php +++ b/test/Mustache/Test/ContextTest.php @@ -119,6 +119,49 @@ class Mustache_Test_ContextTest extends PHPUnit_Framework_TestCase $this->assertEquals('win', $context->find('baz'), 'ArrayAccess stands alone'); $this->assertEquals('win', $context->find('qux'), 'ArrayAccess beats private property'); } + + public function testAnchoredDotNotation() + { + $context = new Mustache_Context(); + + $a = array( + 'name' => 'a', + 'number' => 1, + ); + + $b = array( + 'number' => 2, + 'child' => array( + 'name' => 'baby bee', + ), + ); + + $c = array( + 'name' => 'cee', + ); + + $context->push($a); + $this->assertEquals('a', $context->find('name')); + $this->assertEquals('a', $context->findDot('.name')); + $this->assertEquals(1, $context->find('number')); + $this->assertEquals(1, $context->findDot('.number')); + + $context->push($b); + $this->assertEquals('a', $context->find('name')); + $this->assertEquals(2, $context->find('number')); + $this->assertEquals('', $context->findDot('.name')); + $this->assertEquals(2, $context->findDot('.number')); + $this->assertEquals('baby bee', $context->findDot('child.name')); + $this->assertEquals('baby bee', $context->findDot('.child.name')); + + $context->push($c); + $this->assertEquals('cee', $context->find('name')); + $this->assertEquals('cee', $context->findDot('.name')); + $this->assertEquals(2, $context->find('number')); + $this->assertEquals('', $context->findDot('.number')); + $this->assertEquals('baby bee', $context->findDot('child.name')); + $this->assertEquals('', $context->findDot('.child.name')); + } } class Mustache_Test_TestDummy From 7b81206923916aee04999f2091b9467711376398 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 15 Aug 2015 09:22:13 -0700 Subject: [PATCH 08/12] Remove create_example script. I'm not sure it has ever been used, and it's not all that difficult to create one manually. --- bin/create_example.php | 174 ----------------------------------------- 1 file changed, 174 deletions(-) delete mode 100755 bin/create_example.php diff --git a/bin/create_example.php b/bin/create_example.php deleted file mode 100755 index 0c41f47..0000000 --- a/bin/create_example.php +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/env php - string - * AString -> a_string - * SomeStrings -> some_strings - * AStringMore -> a_string_more - * - * @param string $name - * - * @return string - */ -function getLowerCaseName($name) -{ - return preg_replace_callback('/([A-Z])/', create_function( - '$match', - 'return "_" . strtolower($match[1]);' - ), lcfirst($name)); -} - -/** - * transform a string to Uppercase (camelcase). - * - * Examples - * string -> String - * a_string -> AString - * some_strings -> SomeStrings - * a_string_more -> AStringMore -> a_string_more - * - * @param string $name - * - * @return string - */ -function getUpperCaseName($name) -{ - return preg_replace_callback('/_([a-z])/', create_function( - '$match', - 'return strtoupper($match{1});' - ), ucfirst($name)); -} - -/** - * return the given value and echo it out appending "\n". - * - * @param mixed $value - * - * @return mixed - */ -function out($value) -{ - echo $value . "\n"; - - return $value; -} - -/** - * create Path for certain files in an example. - * - * returns the directory name if only $directory is given. - * if an extension is given a complete filename is returned. - * the returned filename will be echoed out. - * - * @param string $directory directory without / at the end - * @param string $filename filename without path and extension - * @param string $extension extension of the file without "." - * - * @return string - */ -function buildPath($directory, $filename = null, $extension = null) -{ - return out(EXAMPLE_PATH . '/' . $directory . - ($extension !== null && $filename !== null ? '/' . $filename . '.' . $extension : '')); -} - -/** - * creates the directory for the example. - * - * the script die()'s if mkdir() fails. - * - * @param string $directory - */ -function createDirectory($directory) -{ - if (!@mkdir(buildPath($directory))) { - die("FAILED to create directory\n"); - } -} - -/** - * create a file for the example with the given $content. - * - * the script die()'s if fopen() fails. - * - * @param string $directory directory without / at the end - * @param string $filename filename without path and extension - * @param string $extension extension of the file without "." - * @param string $content the content of the file - */ -function createFile($directory, $filename, $extension, $content = '') -{ - $handle = @fopen(buildPath($directory, $filename, $extension), 'w'); - if ($handle) { - fwrite($handle, $content); - fclose($handle); - } else { - die("FAILED to create file\n"); - } -} - -/** - * routine to create the example directory and 3 files. - * - * if the $example_name is "SomeThing" the following files will be created - * examples/some_thing - * examples/some_thing/some_thing.mustache - * examples/some_thing/some_thing.txt - * examples/some_thing/SomeThing.php - * - * @param mixed $example_name - */ -function main($example_name) -{ - $lowercase = getLowerCaseName($example_name); - $uppercase = getUpperCaseName($example_name); - createDirectory($lowercase); - createFile($lowercase, $lowercase, 'mustache'); - createFile($lowercase, $lowercase, 'txt'); - createFile($lowercase, $uppercase, 'php', << 1) { - // get the name of the example - $example_name = $argv[1]; - - main($example_name); -} else { - echo USAGE; -} From 8be838e1445b65e1acc6a74b2130569a514ecaa3 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 15 Aug 2015 09:23:54 -0700 Subject: [PATCH 09/12] Bump copyright dates. --- LICENSE | 2 +- bin/build_bootstrap.php | 2 +- src/Mustache/Autoloader.php | 2 +- src/Mustache/Cache.php | 2 +- src/Mustache/Cache/AbstractCache.php | 2 +- src/Mustache/Cache/FilesystemCache.php | 2 +- src/Mustache/Cache/NoopCache.php | 2 +- src/Mustache/Compiler.php | 2 +- src/Mustache/Context.php | 2 +- src/Mustache/Engine.php | 2 +- src/Mustache/Exception.php | 2 +- src/Mustache/Exception/InvalidArgumentException.php | 2 +- src/Mustache/Exception/LogicException.php | 2 +- src/Mustache/Exception/RuntimeException.php | 2 +- src/Mustache/Exception/SyntaxException.php | 2 +- src/Mustache/Exception/UnknownFilterException.php | 2 +- src/Mustache/Exception/UnknownHelperException.php | 2 +- src/Mustache/Exception/UnknownTemplateException.php | 2 +- src/Mustache/HelperCollection.php | 2 +- src/Mustache/LambdaHelper.php | 2 +- src/Mustache/Loader.php | 2 +- src/Mustache/Loader/ArrayLoader.php | 2 +- src/Mustache/Loader/CascadingLoader.php | 2 +- src/Mustache/Loader/FilesystemLoader.php | 2 +- src/Mustache/Loader/InlineLoader.php | 2 +- src/Mustache/Loader/MutableLoader.php | 2 +- src/Mustache/Loader/StringLoader.php | 2 +- src/Mustache/Logger.php | 2 +- src/Mustache/Logger/AbstractLogger.php | 2 +- src/Mustache/Logger/StreamLogger.php | 2 +- src/Mustache/Parser.php | 2 +- src/Mustache/Template.php | 2 +- src/Mustache/Tokenizer.php | 2 +- test/Mustache/Test/AutoloaderTest.php | 2 +- test/Mustache/Test/Cache/AbstractCacheTest.php | 2 +- test/Mustache/Test/Cache/FilesystemCacheTest.php | 2 +- test/Mustache/Test/CompilerTest.php | 2 +- test/Mustache/Test/ContextTest.php | 2 +- test/Mustache/Test/EngineTest.php | 2 +- test/Mustache/Test/Exception/SyntaxExceptionTest.php | 2 +- test/Mustache/Test/Exception/UnknownFilterExceptionTest.php | 2 +- test/Mustache/Test/Exception/UnknownHelperExceptionTest.php | 2 +- test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/EngineTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/FiltersTest.php | 2 +- .../Test/FiveThree/Functional/HigherOrderSectionsTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php | 2 +- .../Test/FiveThree/Functional/PartialLambdaIndentTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php | 2 +- test/Mustache/Test/Functional/CallTest.php | 2 +- test/Mustache/Test/Functional/ExamplesTest.php | 2 +- test/Mustache/Test/Functional/HigherOrderSectionsTest.php | 2 +- test/Mustache/Test/Functional/MustacheInjectionTest.php | 2 +- test/Mustache/Test/Functional/MustacheSpecTest.php | 2 +- test/Mustache/Test/Functional/NestedPartialIndentTest.php | 2 +- test/Mustache/Test/Functional/ObjectSectionTest.php | 2 +- test/Mustache/Test/FunctionalTestCase.php | 2 +- test/Mustache/Test/HelperCollectionTest.php | 2 +- test/Mustache/Test/Loader/ArrayLoaderTest.php | 2 +- test/Mustache/Test/Loader/CascadingLoaderTest.php | 2 +- test/Mustache/Test/Loader/FilesystemLoaderTest.php | 2 +- test/Mustache/Test/Loader/InlineLoaderTest.php | 2 +- test/Mustache/Test/Loader/StringLoaderTest.php | 2 +- test/Mustache/Test/Logger/AbstractLoggerTest.php | 2 +- test/Mustache/Test/Logger/StreamLoggerTest.php | 2 +- test/Mustache/Test/ParserTest.php | 2 +- test/Mustache/Test/SpecTestCase.php | 2 +- test/Mustache/Test/TemplateTest.php | 2 +- test/Mustache/Test/TokenizerTest.php | 2 +- test/bootstrap.php | 2 +- test/fixtures/autoloader/Mustache/Bar.php | 2 +- test/fixtures/autoloader/Mustache/Foo.php | 2 +- test/fixtures/autoloader/NonMustacheClass.php | 2 +- 75 files changed, 75 insertions(+), 75 deletions(-) diff --git a/LICENSE b/LICENSE index 0bdbc04..e0aecc9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2010-2014 Justin Hileman +Copyright (c) 2010-2015 Justin Hileman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bin/build_bootstrap.php b/bin/build_bootstrap.php index 923ed23..8a63803 100755 --- a/bin/build_bootstrap.php +++ b/bin/build_bootstrap.php @@ -4,7 +4,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Autoloader.php b/src/Mustache/Autoloader.php index d9b2935..b33bc24 100644 --- a/src/Mustache/Autoloader.php +++ b/src/Mustache/Autoloader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache.php b/src/Mustache/Cache.php index 45c4e7e..5df8a23 100644 --- a/src/Mustache/Cache.php +++ b/src/Mustache/Cache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache/AbstractCache.php b/src/Mustache/Cache/AbstractCache.php index eb157c7..cf1c041 100644 --- a/src/Mustache/Cache/AbstractCache.php +++ b/src/Mustache/Cache/AbstractCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache/FilesystemCache.php b/src/Mustache/Cache/FilesystemCache.php index 15bcb87..5b56222 100644 --- a/src/Mustache/Cache/FilesystemCache.php +++ b/src/Mustache/Cache/FilesystemCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache/NoopCache.php b/src/Mustache/Cache/NoopCache.php index 66787c7..7a4b55b 100644 --- a/src/Mustache/Cache/NoopCache.php +++ b/src/Mustache/Cache/NoopCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index 076501e..b0c49cb 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Context.php b/src/Mustache/Context.php index f729c87..9243239 100644 --- a/src/Mustache/Context.php +++ b/src/Mustache/Context.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index d13f1cb..20ef798 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception.php b/src/Mustache/Exception.php index 8a2b01c..7c04792 100644 --- a/src/Mustache/Exception.php +++ b/src/Mustache/Exception.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/InvalidArgumentException.php b/src/Mustache/Exception/InvalidArgumentException.php index 9bd1107..c6084b8 100644 --- a/src/Mustache/Exception/InvalidArgumentException.php +++ b/src/Mustache/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/LogicException.php b/src/Mustache/Exception/LogicException.php index 255ce54..4bfda5f 100644 --- a/src/Mustache/Exception/LogicException.php +++ b/src/Mustache/Exception/LogicException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/RuntimeException.php b/src/Mustache/Exception/RuntimeException.php index a3c48f7..5eb90dd 100644 --- a/src/Mustache/Exception/RuntimeException.php +++ b/src/Mustache/Exception/RuntimeException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/SyntaxException.php b/src/Mustache/Exception/SyntaxException.php index 7a16f7e..ab4d6aa 100644 --- a/src/Mustache/Exception/SyntaxException.php +++ b/src/Mustache/Exception/SyntaxException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/UnknownFilterException.php b/src/Mustache/Exception/UnknownFilterException.php index b9a315a..43d2c06 100644 --- a/src/Mustache/Exception/UnknownFilterException.php +++ b/src/Mustache/Exception/UnknownFilterException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/UnknownHelperException.php b/src/Mustache/Exception/UnknownHelperException.php index 226d774..7fe4a71 100644 --- a/src/Mustache/Exception/UnknownHelperException.php +++ b/src/Mustache/Exception/UnknownHelperException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/UnknownTemplateException.php b/src/Mustache/Exception/UnknownTemplateException.php index 5dafe89..f1f69bf 100644 --- a/src/Mustache/Exception/UnknownTemplateException.php +++ b/src/Mustache/Exception/UnknownTemplateException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/HelperCollection.php b/src/Mustache/HelperCollection.php index 00a9b01..0a92428 100644 --- a/src/Mustache/HelperCollection.php +++ b/src/Mustache/HelperCollection.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/LambdaHelper.php b/src/Mustache/LambdaHelper.php index 7cd8092..de48fd6 100644 --- a/src/Mustache/LambdaHelper.php +++ b/src/Mustache/LambdaHelper.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader.php b/src/Mustache/Loader.php index e75ee3f..1b075d0 100644 --- a/src/Mustache/Loader.php +++ b/src/Mustache/Loader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/ArrayLoader.php b/src/Mustache/Loader/ArrayLoader.php index e7ece91..90cecca 100644 --- a/src/Mustache/Loader/ArrayLoader.php +++ b/src/Mustache/Loader/ArrayLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/CascadingLoader.php b/src/Mustache/Loader/CascadingLoader.php index 1650512..09a376c 100644 --- a/src/Mustache/Loader/CascadingLoader.php +++ b/src/Mustache/Loader/CascadingLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/FilesystemLoader.php b/src/Mustache/Loader/FilesystemLoader.php index 7cbf9cd..e2aab78 100644 --- a/src/Mustache/Loader/FilesystemLoader.php +++ b/src/Mustache/Loader/FilesystemLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/InlineLoader.php b/src/Mustache/Loader/InlineLoader.php index b1ed9ec..2970937 100644 --- a/src/Mustache/Loader/InlineLoader.php +++ b/src/Mustache/Loader/InlineLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/MutableLoader.php b/src/Mustache/Loader/MutableLoader.php index 1c4adc6..4855c16 100644 --- a/src/Mustache/Loader/MutableLoader.php +++ b/src/Mustache/Loader/MutableLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/StringLoader.php b/src/Mustache/Loader/StringLoader.php index 72d105d..99fb38e 100644 --- a/src/Mustache/Loader/StringLoader.php +++ b/src/Mustache/Loader/StringLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Logger.php b/src/Mustache/Logger.php index 3af5049..93c27f6 100644 --- a/src/Mustache/Logger.php +++ b/src/Mustache/Logger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Logger/AbstractLogger.php b/src/Mustache/Logger/AbstractLogger.php index 3dd96e7..1c27db9 100644 --- a/src/Mustache/Logger/AbstractLogger.php +++ b/src/Mustache/Logger/AbstractLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Logger/StreamLogger.php b/src/Mustache/Logger/StreamLogger.php index 7db52d6..88f3000 100644 --- a/src/Mustache/Logger/StreamLogger.php +++ b/src/Mustache/Logger/StreamLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Parser.php b/src/Mustache/Parser.php index c60f5db..7d3559b 100644 --- a/src/Mustache/Parser.php +++ b/src/Mustache/Parser.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Template.php b/src/Mustache/Template.php index 0648e2c..91074c4 100644 --- a/src/Mustache/Template.php +++ b/src/Mustache/Template.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Tokenizer.php b/src/Mustache/Tokenizer.php index dfbaa8a..a71df2c 100644 --- a/src/Mustache/Tokenizer.php +++ b/src/Mustache/Tokenizer.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/AutoloaderTest.php b/test/Mustache/Test/AutoloaderTest.php index 01e6d28..ebe42df 100644 --- a/test/Mustache/Test/AutoloaderTest.php +++ b/test/Mustache/Test/AutoloaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Cache/AbstractCacheTest.php b/test/Mustache/Test/Cache/AbstractCacheTest.php index 42fa47c..77fc18a 100644 --- a/test/Mustache/Test/Cache/AbstractCacheTest.php +++ b/test/Mustache/Test/Cache/AbstractCacheTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Cache/FilesystemCacheTest.php b/test/Mustache/Test/Cache/FilesystemCacheTest.php index 8256525..f3fead5 100644 --- a/test/Mustache/Test/Cache/FilesystemCacheTest.php +++ b/test/Mustache/Test/Cache/FilesystemCacheTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/CompilerTest.php b/test/Mustache/Test/CompilerTest.php index ce0eee6..d981249 100644 --- a/test/Mustache/Test/CompilerTest.php +++ b/test/Mustache/Test/CompilerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/ContextTest.php b/test/Mustache/Test/ContextTest.php index 19589d5..7145d40 100644 --- a/test/Mustache/Test/ContextTest.php +++ b/test/Mustache/Test/ContextTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index f34db4b..ab56185 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/SyntaxExceptionTest.php b/test/Mustache/Test/Exception/SyntaxExceptionTest.php index 8b176c5..fe85bef 100644 --- a/test/Mustache/Test/Exception/SyntaxExceptionTest.php +++ b/test/Mustache/Test/Exception/SyntaxExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php b/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php index 9daf643..e5fe263 100644 --- a/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php +++ b/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php b/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php index b5da3ed..c45d15c 100644 --- a/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php +++ b/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php b/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php index 501181b..61cdd2f 100644 --- a/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php +++ b/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php b/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php index b048c7e..a6f8353 100644 --- a/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php +++ b/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/EngineTest.php b/test/Mustache/Test/FiveThree/Functional/EngineTest.php index 3bc43ca..09e256b 100644 --- a/test/Mustache/Test/FiveThree/Functional/EngineTest.php +++ b/test/Mustache/Test/FiveThree/Functional/EngineTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/FiltersTest.php b/test/Mustache/Test/FiveThree/Functional/FiltersTest.php index 9fee396..a6236fa 100644 --- a/test/Mustache/Test/FiveThree/Functional/FiltersTest.php +++ b/test/Mustache/Test/FiveThree/Functional/FiltersTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php b/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php index d24e4be..8abd209 100644 --- a/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php +++ b/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php b/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php index 54ad518..fcc1cd9 100644 --- a/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php +++ b/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php b/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php index 16ef8f6..6db379f 100644 --- a/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php +++ b/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php b/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php index 98fc8c0..1ed93b6 100644 --- a/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php +++ b/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php b/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php index d4e1652..8fe64d8 100644 --- a/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php +++ b/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/CallTest.php b/test/Mustache/Test/Functional/CallTest.php index 34798cd..7ffd53e 100644 --- a/test/Mustache/Test/Functional/CallTest.php +++ b/test/Mustache/Test/Functional/CallTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/ExamplesTest.php b/test/Mustache/Test/Functional/ExamplesTest.php index dcf1fe4..e33384a 100644 --- a/test/Mustache/Test/Functional/ExamplesTest.php +++ b/test/Mustache/Test/Functional/ExamplesTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/HigherOrderSectionsTest.php b/test/Mustache/Test/Functional/HigherOrderSectionsTest.php index c193636..956d8cd 100644 --- a/test/Mustache/Test/Functional/HigherOrderSectionsTest.php +++ b/test/Mustache/Test/Functional/HigherOrderSectionsTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/MustacheInjectionTest.php b/test/Mustache/Test/Functional/MustacheInjectionTest.php index d97335e..ee87f38 100644 --- a/test/Mustache/Test/Functional/MustacheInjectionTest.php +++ b/test/Mustache/Test/Functional/MustacheInjectionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/MustacheSpecTest.php b/test/Mustache/Test/Functional/MustacheSpecTest.php index b79dcb2..bdf851a 100644 --- a/test/Mustache/Test/Functional/MustacheSpecTest.php +++ b/test/Mustache/Test/Functional/MustacheSpecTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/NestedPartialIndentTest.php b/test/Mustache/Test/Functional/NestedPartialIndentTest.php index fcc5355..b3bad37 100644 --- a/test/Mustache/Test/Functional/NestedPartialIndentTest.php +++ b/test/Mustache/Test/Functional/NestedPartialIndentTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/ObjectSectionTest.php b/test/Mustache/Test/Functional/ObjectSectionTest.php index 77f0e7d..1cfb8c7 100644 --- a/test/Mustache/Test/Functional/ObjectSectionTest.php +++ b/test/Mustache/Test/Functional/ObjectSectionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FunctionalTestCase.php b/test/Mustache/Test/FunctionalTestCase.php index 34647fc..3cb5581 100644 --- a/test/Mustache/Test/FunctionalTestCase.php +++ b/test/Mustache/Test/FunctionalTestCase.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/HelperCollectionTest.php b/test/Mustache/Test/HelperCollectionTest.php index 212cfe9..17e6b85 100644 --- a/test/Mustache/Test/HelperCollectionTest.php +++ b/test/Mustache/Test/HelperCollectionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/ArrayLoaderTest.php b/test/Mustache/Test/Loader/ArrayLoaderTest.php index 723535c..8abccd7 100644 --- a/test/Mustache/Test/Loader/ArrayLoaderTest.php +++ b/test/Mustache/Test/Loader/ArrayLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/CascadingLoaderTest.php b/test/Mustache/Test/Loader/CascadingLoaderTest.php index 1342740..13c7299 100644 --- a/test/Mustache/Test/Loader/CascadingLoaderTest.php +++ b/test/Mustache/Test/Loader/CascadingLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/FilesystemLoaderTest.php b/test/Mustache/Test/Loader/FilesystemLoaderTest.php index d569961..20b75c1 100644 --- a/test/Mustache/Test/Loader/FilesystemLoaderTest.php +++ b/test/Mustache/Test/Loader/FilesystemLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/InlineLoaderTest.php b/test/Mustache/Test/Loader/InlineLoaderTest.php index be52733..2f1d414 100644 --- a/test/Mustache/Test/Loader/InlineLoaderTest.php +++ b/test/Mustache/Test/Loader/InlineLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/StringLoaderTest.php b/test/Mustache/Test/Loader/StringLoaderTest.php index 347be64..87b537b 100644 --- a/test/Mustache/Test/Loader/StringLoaderTest.php +++ b/test/Mustache/Test/Loader/StringLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Logger/AbstractLoggerTest.php b/test/Mustache/Test/Logger/AbstractLoggerTest.php index 63d210d..1aac4df 100644 --- a/test/Mustache/Test/Logger/AbstractLoggerTest.php +++ b/test/Mustache/Test/Logger/AbstractLoggerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Logger/StreamLoggerTest.php b/test/Mustache/Test/Logger/StreamLoggerTest.php index c0dc7cb..dadc765 100644 --- a/test/Mustache/Test/Logger/StreamLoggerTest.php +++ b/test/Mustache/Test/Logger/StreamLoggerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/ParserTest.php b/test/Mustache/Test/ParserTest.php index 77c6fae..6dd5a9e 100644 --- a/test/Mustache/Test/ParserTest.php +++ b/test/Mustache/Test/ParserTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/SpecTestCase.php b/test/Mustache/Test/SpecTestCase.php index 2a961e4..4a8dd29 100644 --- a/test/Mustache/Test/SpecTestCase.php +++ b/test/Mustache/Test/SpecTestCase.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/TemplateTest.php b/test/Mustache/Test/TemplateTest.php index 3255b64..1547873 100644 --- a/test/Mustache/Test/TemplateTest.php +++ b/test/Mustache/Test/TemplateTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/TokenizerTest.php b/test/Mustache/Test/TokenizerTest.php index c9fb5b9..7056eb2 100644 --- a/test/Mustache/Test/TokenizerTest.php +++ b/test/Mustache/Test/TokenizerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/bootstrap.php b/test/bootstrap.php index 99b6fcf..fd06b53 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/autoloader/Mustache/Bar.php b/test/fixtures/autoloader/Mustache/Bar.php index a04da7a..8d64463 100644 --- a/test/fixtures/autoloader/Mustache/Bar.php +++ b/test/fixtures/autoloader/Mustache/Bar.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/autoloader/Mustache/Foo.php b/test/fixtures/autoloader/Mustache/Foo.php index 3114188..4b3bfc0 100644 --- a/test/fixtures/autoloader/Mustache/Foo.php +++ b/test/fixtures/autoloader/Mustache/Foo.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/autoloader/NonMustacheClass.php b/test/fixtures/autoloader/NonMustacheClass.php index dbe844d..4e0f372 100644 --- a/test/fixtures/autoloader/NonMustacheClass.php +++ b/test/fixtures/autoloader/NonMustacheClass.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2014 Justin Hileman + * (c) 2010-2015 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. From 664895f4b9ef72b5dd312b11986b5124a6b3de05 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 15 Aug 2015 09:29:18 -0700 Subject: [PATCH 10/12] Add a simple BLOCKS pragma example. --- test/fixtures/examples/blocks/Blocks.php | 6 ++++++ test/fixtures/examples/blocks/blocks.mustache | 4 ++++ test/fixtures/examples/blocks/blocks.txt | 3 +++ test/fixtures/examples/blocks/partials/parent.mustache | 4 ++++ 4 files changed, 17 insertions(+) create mode 100644 test/fixtures/examples/blocks/Blocks.php create mode 100644 test/fixtures/examples/blocks/blocks.mustache create mode 100644 test/fixtures/examples/blocks/blocks.txt create mode 100644 test/fixtures/examples/blocks/partials/parent.mustache diff --git a/test/fixtures/examples/blocks/Blocks.php b/test/fixtures/examples/blocks/Blocks.php new file mode 100644 index 0000000..4b7031c --- /dev/null +++ b/test/fixtures/examples/blocks/Blocks.php @@ -0,0 +1,6 @@ + Date: Sat, 15 Aug 2015 12:18:04 -0700 Subject: [PATCH 11/12] Put anchored dots behind {{%ANCHORED-DOT}} pragma. --- src/Mustache/Compiler.php | 6 +++++ src/Mustache/Context.php | 39 +++++++++++++++++++++++++++--- src/Mustache/Engine.php | 10 +++++--- test/Mustache/Test/ContextTest.php | 28 +++++++++++++++++---- 4 files changed, 70 insertions(+), 13 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index b0c49cb..7d5c96b 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -631,6 +631,12 @@ class Mustache_Compiler return 'last'; } + if (isset($this->pragmas[Mustache_Engine::PRAGMA_ANCHORED_DOT]) && $this->pragmas[Mustache_Engine::PRAGMA_ANCHORED_DOT]) { + if (substr($id, 0, 1) === '.') { + return 'findAnchoredDot'; + } + } + if (strpos($id, '.') === false) { return 'find'; } diff --git a/src/Mustache/Context.php b/src/Mustache/Context.php index 9243239..e660b54 100644 --- a/src/Mustache/Context.php +++ b/src/Mustache/Context.php @@ -128,13 +128,44 @@ class Mustache_Context { $chunks = explode('.', $id); $first = array_shift($chunks); + $value = $this->findVariableInStack($first, $this->stack); - if ($first === '') { - $value = $this->last(); - } else { - $value = $this->findVariableInStack($first, $this->stack); + foreach ($chunks as $chunk) { + if ($value === '') { + return $value; + } + + $value = $this->findVariableInStack($chunk, array($value)); } + return $value; + } + + /** + * Find an 'anchored dot notation' variable in the Context stack. + * + * This is the same as findDot(), except it looks in the top of the context + * stack for the first value, rather than searching the whole context stack + * and starting from there. + * + * @see Mustache_Context::findDot + * + * @throws Mustache_Exception_InvalidArgumentException if given an invalid anchored dot $id. + * + * @param string $id Dotted variable selector + * + * @return mixed Variable value, or '' if not found + */ + public function findAnchoredDot($id) + { + $chunks = explode('.', $id); + $first = array_shift($chunks); + if ($first !== '') { + throw new Mustache_Exception_InvalidArgumentException(sprintf('Unexpected id for findAnchoredDot: %s', $id)); + } + + $value = $this->last(); + foreach ($chunks as $chunk) { if ($value === '') { return $value; diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 20ef798..d40a3af 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -26,13 +26,15 @@ class Mustache_Engine const VERSION = '2.8.0'; const SPEC_VERSION = '1.1.2'; - const PRAGMA_FILTERS = 'FILTERS'; - const PRAGMA_BLOCKS = 'BLOCKS'; + const PRAGMA_FILTERS = 'FILTERS'; + const PRAGMA_BLOCKS = 'BLOCKS'; + const PRAGMA_ANCHORED_DOT = 'ANCHORED-DOT'; // Known pragmas private static $knownPragmas = array( - self::PRAGMA_FILTERS => true, - self::PRAGMA_BLOCKS => true, + self::PRAGMA_FILTERS => true, + self::PRAGMA_BLOCKS => true, + self::PRAGMA_ANCHORED_DOT => true, ); // Template cache diff --git a/test/Mustache/Test/ContextTest.php b/test/Mustache/Test/ContextTest.php index 7145d40..5d700fd 100644 --- a/test/Mustache/Test/ContextTest.php +++ b/test/Mustache/Test/ContextTest.php @@ -142,25 +142,43 @@ class Mustache_Test_ContextTest extends PHPUnit_Framework_TestCase $context->push($a); $this->assertEquals('a', $context->find('name')); - $this->assertEquals('a', $context->findDot('.name')); + $this->assertEquals('', $context->findDot('.name')); + $this->assertEquals('a', $context->findAnchoredDot('.name')); $this->assertEquals(1, $context->find('number')); - $this->assertEquals(1, $context->findDot('.number')); + $this->assertEquals('', $context->findDot('.number')); + $this->assertEquals(1, $context->findAnchoredDot('.number')); $context->push($b); $this->assertEquals('a', $context->find('name')); $this->assertEquals(2, $context->find('number')); $this->assertEquals('', $context->findDot('.name')); - $this->assertEquals(2, $context->findDot('.number')); + $this->assertEquals('', $context->findDot('.number')); + $this->assertEquals('', $context->findAnchoredDot('.name')); + $this->assertEquals(2, $context->findAnchoredDot('.number')); $this->assertEquals('baby bee', $context->findDot('child.name')); - $this->assertEquals('baby bee', $context->findDot('.child.name')); + $this->assertEquals('', $context->findDot('.child.name')); + $this->assertEquals('baby bee', $context->findAnchoredDot('.child.name')); $context->push($c); $this->assertEquals('cee', $context->find('name')); - $this->assertEquals('cee', $context->findDot('.name')); + $this->assertEquals('', $context->findDot('.name')); + $this->assertEquals('cee', $context->findAnchoredDot('.name')); $this->assertEquals(2, $context->find('number')); $this->assertEquals('', $context->findDot('.number')); + $this->assertEquals('', $context->findAnchoredDot('.number')); $this->assertEquals('baby bee', $context->findDot('child.name')); $this->assertEquals('', $context->findDot('.child.name')); + $this->assertEquals('', $context->findAnchoredDot('.child.name')); + } + + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testAnchoredDotNotationThrowsExceptions() + { + $context = new Mustache_Context(); + $context->push(array('a' => 1)); + $context->findAnchoredDot('a'); } } From eff33aff4edc1151a5612311ec9c8c1e92ee243c Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sat, 15 Aug 2015 12:18:51 -0700 Subject: [PATCH 12/12] Bump to v2.9.0 --- src/Mustache/Engine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index d40a3af..08bcc81 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -23,7 +23,7 @@ */ class Mustache_Engine { - const VERSION = '2.8.0'; + const VERSION = '2.9.0'; const SPEC_VERSION = '1.1.2'; const PRAGMA_FILTERS = 'FILTERS';