Quellcode durchsuchen

Merge branch 'release/2.9.0'

Justin Hileman vor 10 Jahren
Ursprung
Commit
c745b01956
84 geänderte Dateien mit 321 neuen und 290 gelöschten Zeilen
  1. 13 2
      .php_cs
  2. 4 1
      .styleci.yml
  3. 1 6
      .travis.yml
  4. 1 1
      LICENSE
  5. 1 1
      bin/build_bootstrap.php
  6. 0 181
      bin/create_example.php
  7. 1 1
      src/Mustache/Autoloader.php
  8. 1 1
      src/Mustache/Cache.php
  9. 1 1
      src/Mustache/Cache/AbstractCache.php
  10. 1 1
      src/Mustache/Cache/FilesystemCache.php
  11. 1 1
      src/Mustache/Cache/NoopCache.php
  12. 55 19
      src/Mustache/Compiler.php
  13. 37 1
      src/Mustache/Context.php
  14. 8 6
      src/Mustache/Engine.php
  15. 1 1
      src/Mustache/Exception.php
  16. 1 1
      src/Mustache/Exception/InvalidArgumentException.php
  17. 1 1
      src/Mustache/Exception/LogicException.php
  18. 1 1
      src/Mustache/Exception/RuntimeException.php
  19. 1 1
      src/Mustache/Exception/SyntaxException.php
  20. 1 1
      src/Mustache/Exception/UnknownFilterException.php
  21. 1 1
      src/Mustache/Exception/UnknownHelperException.php
  22. 1 1
      src/Mustache/Exception/UnknownTemplateException.php
  23. 1 1
      src/Mustache/HelperCollection.php
  24. 1 1
      src/Mustache/LambdaHelper.php
  25. 1 1
      src/Mustache/Loader.php
  26. 1 1
      src/Mustache/Loader/ArrayLoader.php
  27. 1 1
      src/Mustache/Loader/CascadingLoader.php
  28. 1 1
      src/Mustache/Loader/FilesystemLoader.php
  29. 1 1
      src/Mustache/Loader/InlineLoader.php
  30. 1 1
      src/Mustache/Loader/MutableLoader.php
  31. 1 1
      src/Mustache/Loader/StringLoader.php
  32. 1 1
      src/Mustache/Logger.php
  33. 1 1
      src/Mustache/Logger/AbstractLogger.php
  34. 1 1
      src/Mustache/Logger/StreamLogger.php
  35. 1 1
      src/Mustache/Parser.php
  36. 1 1
      src/Mustache/Template.php
  37. 1 1
      src/Mustache/Tokenizer.php
  38. 1 1
      test/Mustache/Test/AutoloaderTest.php
  39. 1 1
      test/Mustache/Test/Cache/AbstractCacheTest.php
  40. 1 1
      test/Mustache/Test/Cache/FilesystemCacheTest.php
  41. 1 1
      test/Mustache/Test/CompilerTest.php
  42. 62 1
      test/Mustache/Test/ContextTest.php
  43. 3 3
      test/Mustache/Test/EngineTest.php
  44. 1 1
      test/Mustache/Test/Exception/SyntaxExceptionTest.php
  45. 1 1
      test/Mustache/Test/Exception/UnknownFilterExceptionTest.php
  46. 1 1
      test/Mustache/Test/Exception/UnknownHelperExceptionTest.php
  47. 1 1
      test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php
  48. 1 1
      test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php
  49. 1 1
      test/Mustache/Test/FiveThree/Functional/EngineTest.php
  50. 1 1
      test/Mustache/Test/FiveThree/Functional/FiltersTest.php
  51. 1 1
      test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php
  52. 1 1
      test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php
  53. 1 1
      test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php
  54. 1 1
      test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php
  55. 1 1
      test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php
  56. 1 1
      test/Mustache/Test/Functional/CallTest.php
  57. 1 1
      test/Mustache/Test/Functional/ExamplesTest.php
  58. 1 1
      test/Mustache/Test/Functional/HigherOrderSectionsTest.php
  59. 51 0
      test/Mustache/Test/Functional/InheritanceTest.php
  60. 1 1
      test/Mustache/Test/Functional/MustacheInjectionTest.php
  61. 1 1
      test/Mustache/Test/Functional/MustacheSpecTest.php
  62. 1 1
      test/Mustache/Test/Functional/NestedPartialIndentTest.php
  63. 1 1
      test/Mustache/Test/Functional/ObjectSectionTest.php
  64. 1 1
      test/Mustache/Test/FunctionalTestCase.php
  65. 1 1
      test/Mustache/Test/HelperCollectionTest.php
  66. 1 1
      test/Mustache/Test/Loader/ArrayLoaderTest.php
  67. 1 1
      test/Mustache/Test/Loader/CascadingLoaderTest.php
  68. 1 1
      test/Mustache/Test/Loader/FilesystemLoaderTest.php
  69. 1 1
      test/Mustache/Test/Loader/InlineLoaderTest.php
  70. 1 1
      test/Mustache/Test/Loader/StringLoaderTest.php
  71. 1 1
      test/Mustache/Test/Logger/AbstractLoggerTest.php
  72. 1 1
      test/Mustache/Test/Logger/StreamLoggerTest.php
  73. 1 1
      test/Mustache/Test/ParserTest.php
  74. 1 1
      test/Mustache/Test/SpecTestCase.php
  75. 1 1
      test/Mustache/Test/TemplateTest.php
  76. 1 1
      test/Mustache/Test/TokenizerTest.php
  77. 1 1
      test/bootstrap.php
  78. 1 1
      test/fixtures/autoloader/Mustache/Bar.php
  79. 1 1
      test/fixtures/autoloader/Mustache/Foo.php
  80. 1 1
      test/fixtures/autoloader/NonMustacheClass.php
  81. 6 0
      test/fixtures/examples/blocks/Blocks.php
  82. 4 0
      test/fixtures/examples/blocks/blocks.mustache
  83. 3 0
      test/fixtures/examples/blocks/blocks.txt
  84. 4 0
      test/fixtures/examples/blocks/partials/parent.mustache

+ 13 - 2
.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;

+ 4 - 1
.styleci.yml

@@ -7,4 +7,7 @@ enabled:
   - strict
 
 disabled:
-  - concat_without_spaces
+  - concat_without_spaces
+  - pre_increment
+  - unalign_double_arrow
+  - unalign_equals

+ 1 - 6
.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

+ 1 - 1
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

+ 1 - 1
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.

+ 0 - 181
bin/create_example.php

@@ -1,181 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-/**
- * A commandline script to create an example and the needed files.
- *
- *     $ bin/create_example.php my_new_example
- *
- * ... and the folder my_new_example will be created in the examples/ folder containing 3 files:
- *
- *     my_new_example/my_new_example.mustache
- *     my_new_example/my_new_example.txt
- *     my_new_example/MyNewExample.php
- */
-
-// some constants
-define('USAGE', <<<USAGE
-USAGE: {$argv[0]} example_name
-
-This creates a new example and the corresponding files in the examples/ directory
-
-USAGE
-);
-
-define('EXAMPLE_PATH', realpath(dirname(__FILE__) . '/../test/fixtures/examples'));
-
-/**
- * transform a string to lowercase using underlines.
- *
- * Examples:
- * String -> 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', <<<CONTENT
-<?php
-
-class {$uppercase} {
-
-}
-
-CONTENT
-    );
-}
-
-// check if enougth arguments are given
-if (count($argv) > 1) {
-    // get the name of the example
-    $example_name = $argv[1];
-
-    main($example_name);
-} else {
-    echo USAGE;
-}

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 55 - 19
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 = '<?php
@@ -225,19 +228,19 @@ class Mustache_Compiler
     {
         $code     = $this->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, 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));
 
-        return sprintf($this->prepare(self::BLOCK_ARG, $level), $id, $key, $id, $this->flushIndent());
+        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';
         }

+ 37 - 1
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.
      *

+ 8 - 6
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

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 62 - 1
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

+ 3 - 3
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);
     }
 
     /**

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 51 - 0
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(
+            '{{<parent}}{{$value}}<{{ . }}>{{/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(
+            '{{<parent}}\n\n\n{{$value}}<{{ . }}>{{/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(
+            '{{<parent}}\n\n\n{{$value}}<{{ . }}>{{#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

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 1 - 1
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.

+ 6 - 0
test/fixtures/examples/blocks/Blocks.php

@@ -0,0 +1,6 @@
+<?php
+
+class Blocks
+{
+    public $items = array(1, 2, 3);
+}

+ 4 - 0
test/fixtures/examples/blocks/blocks.mustache

@@ -0,0 +1,4 @@
+{{% BLOCKS }}
+{{< parent }}
+{{$ value }}[{{ . }}]{{/ value }}
+{{/ parent }}

+ 3 - 0
test/fixtures/examples/blocks/blocks.txt

@@ -0,0 +1,3 @@
+[1]
+[2]
+[3]

+ 4 - 0
test/fixtures/examples/blocks/partials/parent.mustache

@@ -0,0 +1,4 @@
+{{% BLOCKS }}
+{{# items }}
+{{$ value }}ignored{{/ value }}
+{{/ items }}