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/.travis.yml b/.travis.yml index 4c894ed..7d3b7e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,12 +13,7 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 - hhvm - - hhvm-nightly sudo: false - -matrix: - allow_failures: - - php: hhvm-nightly - fast_finish: true 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/bin/create_example.php b/bin/create_example.php deleted file mode 100755 index cca36f3..0000000 --- a/bin/create_example.php +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env php - string - * AString -> a_string - * SomeStrings -> some_strings - * AStringMore -> a_string_more - * - * @param string $name - * @access public - * - * @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 - * @access public - * - * @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 - * @access public - * - * @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 "." - * @access public - * - * @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 - * @access public - */ -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 - * @access public - */ -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 - * @access public - */ -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; -} 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 e25bd8c..7d5c96b 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. @@ -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 = ' - $value = $this->resolveValue($context->findInBlock(%s), $context, $indent); - if ($value && !is_array($value) && !is_object($value)) { - $buffer .= $value; - } else { - %s + $blockFunction = $context->findInBlock(%s); + if (is_callable($blockFunction)) { + $buffer .= call_user_func($blockFunction, $context); + } else {%s } '; @@ -258,14 +261,10 @@ 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, $level)); } - const BLOCK_ARG = ' - // %s block_arg - $value = $this->section%s($context, \'\', true); - $newContext[%s] = %s$value; - '; + const BLOCK_ARG = '$newContext[%s] = array($this, \'block%s\');'; /** * Generate Mustache Template inheritance block argument PHP source. @@ -282,10 +281,39 @@ 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); + $key = $this->block($nodes); + $keystr = var_export($key, true); + $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_ARG, $level), $id, $key, $id, $this->flushIndent()); + return sprintf($this->prepare(self::BLOCK_ARG, 1), $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, 0); + $key = ucfirst(md5($code)); + + if (!isset($this->blocks[$key])) { + $this->blocks[$key] = sprintf($this->prepare(self::BLOCK_FUNCTION, 0), $key, $code); + } + + return $key; } const SECTION_CALL = ' @@ -318,7 +346,8 @@ class Mustache_Compiler } return $buffer; - }'; + } + '; /** * Generate Mustache Template section PHP source. @@ -368,7 +397,8 @@ class Mustache_Compiler $value = $context->%s(%s);%s if (empty($value)) { %s - }'; + } + '; /** * Generate Mustache Template inverted section PHP source. @@ -601,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 db03acc..e660b54 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. @@ -141,6 +141,42 @@ class Mustache_Context 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; + } + + $value = $this->findVariableInStack($chunk, array($value)); + } + + return $value; + } + /** * Find an argument in the block context stack. * diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index d13f1cb..08bcc81 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. @@ -23,16 +23,18 @@ */ class Mustache_Engine { - const VERSION = '2.8.0'; + const VERSION = '2.9.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/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 864b448..5d700fd 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. @@ -119,6 +119,67 @@ 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('', $context->findDot('.name')); + $this->assertEquals('a', $context->findAnchoredDot('.name')); + $this->assertEquals(1, $context->find('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('', $context->findDot('.number')); + $this->assertEquals('', $context->findAnchoredDot('.name')); + $this->assertEquals(2, $context->findAnchoredDot('.number')); + $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('', $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'); + } } class Mustache_Test_TestDummy diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index c4c8890..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. @@ -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); } /** 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/InheritanceTest.php b/test/Mustache/Test/Functional/InheritanceTest.php index 122ed31..598e798 100644 --- a/test/Mustache/Test/Functional/InheritanceTest.php +++ b/test/Mustache/Test/Functional/InheritanceTest.php @@ -433,6 +433,57 @@ 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)); + } + + 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 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. 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 @@ +