CS fixes.
Plus add config for StyleCI.
This commit is contained in:
@@ -6,7 +6,7 @@ use Symfony\CS\FixerInterface;
|
|||||||
$config = Config::create()
|
$config = Config::create()
|
||||||
// use symfony level and extra fixers:
|
// use symfony level and extra fixers:
|
||||||
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
|
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
|
||||||
->fixers(array('-concat_without_spaces', 'concat_with_spaces', 'strict'))
|
->fixers(array('align_double_arrow', '-concat_without_spaces', 'concat_with_spaces', 'ordered_use', 'strict'))
|
||||||
->setUsingLinter(false);
|
->setUsingLinter(false);
|
||||||
|
|
||||||
$finder = $config->getFinder()
|
$finder = $config->getFinder()
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
preset: symfony
|
||||||
|
|
||||||
|
enabled:
|
||||||
|
- align_double_arrow
|
||||||
|
- concat_with_spaces
|
||||||
|
- ordered_use
|
||||||
|
- strict
|
||||||
|
|
||||||
|
disabled:
|
||||||
|
- concat_without_spaces
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A shell script to create a single-file class cache of the entire Mustache
|
* A shell script to create a single-file class cache of the entire Mustache
|
||||||
* library:
|
* library.
|
||||||
*
|
*
|
||||||
* $ bin/build_bootstrap.php
|
* $ bin/build_bootstrap.php
|
||||||
*
|
*
|
||||||
@@ -72,7 +72,6 @@ SymfonyClassCollectionLoader::load(array(
|
|||||||
* the unnecessary bits removed.
|
* the unnecessary bits removed.
|
||||||
*
|
*
|
||||||
* @license http://www.opensource.org/licenses/MIT
|
* @license http://www.opensource.org/licenses/MIT
|
||||||
*
|
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class SymfonyClassCollectionLoader
|
class SymfonyClassCollectionLoader
|
||||||
|
|||||||
+19
-10
@@ -2,7 +2,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A commandline script to create an example and the needed files:
|
* A commandline script to create an example and the needed files.
|
||||||
*
|
*
|
||||||
* $ bin/create_example.php my_new_example
|
* $ bin/create_example.php my_new_example
|
||||||
*
|
*
|
||||||
@@ -26,6 +26,7 @@ define('EXAMPLE_PATH', realpath(dirname(__FILE__) . '/../test/fixtures/examples'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* transform a string to lowercase using underlines.
|
* transform a string to lowercase using underlines.
|
||||||
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* String -> string
|
* String -> string
|
||||||
* AString -> a_string
|
* AString -> a_string
|
||||||
@@ -34,6 +35,7 @@ define('EXAMPLE_PATH', realpath(dirname(__FILE__) . '/../test/fixtures/examples'
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getLowerCaseName($name)
|
function getLowerCaseName($name)
|
||||||
@@ -45,7 +47,8 @@ function getLowerCaseName($name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* transform a string to Uppercase (camelcase)
|
* transform a string to Uppercase (camelcase).
|
||||||
|
*
|
||||||
* Examples
|
* Examples
|
||||||
* string -> String
|
* string -> String
|
||||||
* a_string -> AString
|
* a_string -> AString
|
||||||
@@ -54,6 +57,7 @@ function getLowerCaseName($name)
|
|||||||
*
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getUpperCaseName($name)
|
function getUpperCaseName($name)
|
||||||
@@ -65,10 +69,11 @@ function getUpperCaseName($name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the given value and echo it out appending "\n"
|
* return the given value and echo it out appending "\n".
|
||||||
*
|
*
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function out($value)
|
function out($value)
|
||||||
@@ -79,15 +84,17 @@ function out($value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create Path for certain files in an example
|
* create Path for certain files in an example.
|
||||||
|
*
|
||||||
* returns the directory name if only $directory is given.
|
* returns the directory name if only $directory is given.
|
||||||
* if an extension is given a complete filename is returned.
|
* if an extension is given a complete filename is returned.
|
||||||
* the returned filename will be echoed out
|
* the returned filename will be echoed out.
|
||||||
*
|
*
|
||||||
* @param string $directory directory without / at the end
|
* @param string $directory directory without / at the end
|
||||||
* @param string $filename filename without path and extension
|
* @param string $filename filename without path and extension
|
||||||
* @param string $extension extension of the file without "."
|
* @param string $extension extension of the file without "."
|
||||||
* @access public
|
* @access public
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function buildPath($directory, $filename = null, $extension = null)
|
function buildPath($directory, $filename = null, $extension = null)
|
||||||
@@ -97,8 +104,9 @@ function buildPath($directory, $filename = null, $extension = null)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creates the directory for the example
|
* creates the directory for the example.
|
||||||
* the script die()'s if mkdir() fails
|
*
|
||||||
|
* the script die()'s if mkdir() fails.
|
||||||
*
|
*
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
* @access public
|
* @access public
|
||||||
@@ -111,8 +119,9 @@ function createDirectory($directory)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a file for the example with the given $content
|
* create a file for the example with the given $content.
|
||||||
* the script die()'s if fopen() fails
|
*
|
||||||
|
* the script die()'s if fopen() fails.
|
||||||
*
|
*
|
||||||
* @param string $directory directory without / at the end
|
* @param string $directory directory without / at the end
|
||||||
* @param string $filename filename without path and extension
|
* @param string $filename filename without path and extension
|
||||||
@@ -132,7 +141,7 @@ function createFile($directory, $filename, $extension, $content = "")
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* routine to create the example directory and 3 files
|
* routine to create the example directory and 3 files.
|
||||||
*
|
*
|
||||||
* if the $example_name is "SomeThing" the following files will be created
|
* if the $example_name is "SomeThing" the following files will be created
|
||||||
* examples/some_thing
|
* examples/some_thing
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache and load the compiled class
|
* Cache and load the compiled class.
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param string $value
|
* @param string $value
|
||||||
@@ -89,7 +89,7 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create cache directory
|
* Create cache directory.
|
||||||
*
|
*
|
||||||
* @throws Mustache_Exception_RuntimeException If unable to create directory
|
* @throws Mustache_Exception_RuntimeException If unable to create directory
|
||||||
*
|
*
|
||||||
@@ -117,7 +117,7 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write cache file
|
* Write cache file.
|
||||||
*
|
*
|
||||||
* @throws Mustache_Exception_RuntimeException If unable to write file
|
* @throws Mustache_Exception_RuntimeException If unable to write file
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Mustache_Loader_CascadingLoader implements Mustache_Loader
|
|||||||
private $loaders;
|
private $loaders;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a CascadingLoader with an array of loaders:
|
* Construct a CascadingLoader with an array of loaders.
|
||||||
*
|
*
|
||||||
* $loader = new Mustache_Loader_CascadingLoader(array(
|
* $loader = new Mustache_Loader_CascadingLoader(array(
|
||||||
* new Mustache_Loader_InlineLoader(__FILE__, __COMPILER_HALT_OFFSET__),
|
* new Mustache_Loader_InlineLoader(__FILE__, __COMPILER_HALT_OFFSET__),
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ class Mustache_Loader_InlineLoader implements Mustache_Loader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The InlineLoader requires a filename and offset to process templates.
|
* The InlineLoader requires a filename and offset to process templates.
|
||||||
|
*
|
||||||
* The magic constants `__FILE__` and `__COMPILER_HALT_OFFSET__` are usually
|
* The magic constants `__FILE__` and `__COMPILER_HALT_OFFSET__` are usually
|
||||||
* perfectly suited to the job:
|
* perfectly suited to the job:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a Mustache logger instance
|
* Describes a Mustache logger instance.
|
||||||
*
|
*
|
||||||
* This is identical to the Psr\Log\LoggerInterface.
|
* This is identical to the Psr\Log\LoggerInterface.
|
||||||
*
|
*
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
interface Mustache_Logger
|
interface Mustache_Logger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Psr\Log compatible log levels
|
* Psr\Log compatible log levels.
|
||||||
*/
|
*/
|
||||||
const EMERGENCY = 'emergency';
|
const EMERGENCY = 'emergency';
|
||||||
const ALERT = 'alert';
|
const ALERT = 'alert';
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ abstract class Mustache_Template
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mustache Template instances can be treated as a function and rendered by simply calling them:
|
* Mustache Template instances can be treated as a function and rendered by simply calling them.
|
||||||
*
|
*
|
||||||
* $m = new Mustache_Engine;
|
* $m = new Mustache_Engine;
|
||||||
* $tpl = $m->loadTemplate('Hello, {{ name }}!');
|
* $tpl = $m->loadTemplate('Hello, {{ name }}!');
|
||||||
|
|||||||
@@ -21,22 +21,22 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
|
|||||||
$partialsLoader = new Mustache_Loader_ArrayLoader();
|
$partialsLoader = new Mustache_Loader_ArrayLoader();
|
||||||
$mustache = new Mustache_Engine(array(
|
$mustache = new Mustache_Engine(array(
|
||||||
'template_class_prefix' => '__whot__',
|
'template_class_prefix' => '__whot__',
|
||||||
'cache' => self::$tempDir,
|
'cache' => self::$tempDir,
|
||||||
'cache_file_mode' => 777,
|
'cache_file_mode' => 777,
|
||||||
'logger' => $logger,
|
'logger' => $logger,
|
||||||
'loader' => $loader,
|
'loader' => $loader,
|
||||||
'partials_loader' => $partialsLoader,
|
'partials_loader' => $partialsLoader,
|
||||||
'partials' => array(
|
'partials' => array(
|
||||||
'foo' => '{{ foo }}',
|
'foo' => '{{ foo }}',
|
||||||
),
|
),
|
||||||
'helpers' => array(
|
'helpers' => array(
|
||||||
'foo' => array($this, 'getFoo'),
|
'foo' => array($this, 'getFoo'),
|
||||||
'bar' => 'BAR',
|
'bar' => 'BAR',
|
||||||
),
|
),
|
||||||
'escape' => 'strtoupper',
|
'escape' => 'strtoupper',
|
||||||
'entity_flags' => ENT_QUOTES,
|
'entity_flags' => ENT_QUOTES,
|
||||||
'charset' => 'ISO-8859-1',
|
'charset' => 'ISO-8859-1',
|
||||||
'pragmas' => array(Mustache_Engine::PRAGMA_FILTERS),
|
'pragmas' => array(Mustache_Engine::PRAGMA_FILTERS),
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertSame($logger, $mustache->getLogger());
|
$this->assertSame($logger, $mustache->getLogger());
|
||||||
@@ -127,7 +127,7 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
|
|||||||
{
|
{
|
||||||
$mustache = new Mustache_Engine(array(
|
$mustache = new Mustache_Engine(array(
|
||||||
'template_class_prefix' => '__whot__',
|
'template_class_prefix' => '__whot__',
|
||||||
'cache' => self::$tempDir,
|
'cache' => self::$tempDir,
|
||||||
));
|
));
|
||||||
|
|
||||||
$source = '{{ foo }}';
|
$source = '{{ foo }}';
|
||||||
@@ -140,7 +140,7 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
|
|||||||
public function testLambdaCache()
|
public function testLambdaCache()
|
||||||
{
|
{
|
||||||
$mustache = new MustacheStub(array(
|
$mustache = new MustacheStub(array(
|
||||||
'cache' => self::$tempDir,
|
'cache' => self::$tempDir,
|
||||||
'cache_lambda_templates' => true,
|
'cache_lambda_templates' => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A PHPUnit test case wrapping the Mustache Spec
|
* A PHPUnit test case wrapping the Mustache Spec.
|
||||||
*
|
*
|
||||||
* @group mustache-spec
|
* @group mustache-spec
|
||||||
* @group functional
|
* @group functional
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|||||||
public function testRecursionInInheritedTemplates()
|
public function testRecursionInInheritedTemplates()
|
||||||
{
|
{
|
||||||
$partials = array(
|
$partials = array(
|
||||||
'include' => '{{$foo}}default content{{/foo}} {{$bar}}{{<include2}}{{/include2}}{{/bar}}',
|
'include' => '{{$foo}}default content{{/foo}} {{$bar}}{{<include2}}{{/include2}}{{/bar}}',
|
||||||
'include2' => '{{$foo}}include2 default content{{/foo}} {{<include}}{{$bar}}don\'t recurse{{/bar}}{{/include}}',
|
'include2' => '{{$foo}}include2 default content{{/foo}} {{<include}}{{$bar}}don\'t recurse{{/bar}}{{/include}}',
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -341,8 +341,8 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|||||||
public function testTopLevelSubstitutionsTakePrecedenceInMultilevelInheritance()
|
public function testTopLevelSubstitutionsTakePrecedenceInMultilevelInheritance()
|
||||||
{
|
{
|
||||||
$partials = array(
|
$partials = array(
|
||||||
'parent' => '{{<older}}{{$a}}p{{/a}}{{/older}}',
|
'parent' => '{{<older}}{{$a}}p{{/a}}{{/older}}',
|
||||||
'older' => '{{<grandParent}}{{$a}}o{{/a}}{{/grandParent}}',
|
'older' => '{{<grandParent}}{{$a}}o{{/a}}{{/grandParent}}',
|
||||||
'grandParent' => '{{$a}}g{{/a}}',
|
'grandParent' => '{{$a}}g{{/a}}',
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -360,8 +360,8 @@ class Mustache_Test_Functional_InheritanceTest extends PHPUnit_Framework_TestCas
|
|||||||
public function testMultiLevelInheritanceNoSubChild()
|
public function testMultiLevelInheritanceNoSubChild()
|
||||||
{
|
{
|
||||||
$partials = array(
|
$partials = array(
|
||||||
'parent' => '{{<older}}{{$a}}p{{/a}}{{/older}}',
|
'parent' => '{{<older}}{{$a}}p{{/a}}{{/older}}',
|
||||||
'older' => '{{<grandParent}}{{$a}}o{{/a}}{{/grandParent}}',
|
'older' => '{{<grandParent}}{{$a}}o{{/a}}{{/grandParent}}',
|
||||||
'grandParent' => '{{$a}}g{{/a}}',
|
'grandParent' => '{{$a}}g{{/a}}',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A PHPUnit test case wrapping the Mustache Spec
|
* A PHPUnit test case wrapping the Mustache Spec.
|
||||||
*
|
*
|
||||||
* @group mustache-spec
|
* @group mustache-spec
|
||||||
* @group functional
|
* @group functional
|
||||||
|
|||||||
@@ -128,8 +128,8 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
|||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => 'bar',
|
Mustache_Tokenizer::VALUE => 'bar',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -142,8 +142,8 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
|||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => 'bar',
|
Mustache_Tokenizer::VALUE => 'bar',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -152,8 +152,8 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
|||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => " ",
|
Mustache_Tokenizer::VALUE => " ",
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@@ -161,8 +161,8 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
|||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => " \n",
|
Mustache_Tokenizer::VALUE => " \n",
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@@ -203,65 +203,65 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
|||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT,
|
||||||
Mustache_Tokenizer::NAME => 'foo',
|
Mustache_Tokenizer::NAME => 'foo',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 8,
|
Mustache_Tokenizer::INDEX => 8,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR,
|
||||||
Mustache_Tokenizer::NAME => 'bar',
|
Mustache_Tokenizer::NAME => 'bar',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 16,
|
Mustache_Tokenizer::INDEX => 16,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => 'baz',
|
Mustache_Tokenizer::VALUE => 'baz',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
||||||
Mustache_Tokenizer::NAME => 'bar',
|
Mustache_Tokenizer::NAME => 'bar',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 19,
|
Mustache_Tokenizer::INDEX => 19,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
||||||
Mustache_Tokenizer::NAME => 'foo',
|
Mustache_Tokenizer::NAME => 'foo',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 27,
|
Mustache_Tokenizer::INDEX => 27,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_PARENT,
|
||||||
Mustache_Tokenizer::NAME => 'foo',
|
Mustache_Tokenizer::NAME => 'foo',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 8,
|
Mustache_Tokenizer::INDEX => 8,
|
||||||
Mustache_Tokenizer::END => 27,
|
Mustache_Tokenizer::END => 27,
|
||||||
Mustache_Tokenizer::NODES => array(
|
Mustache_Tokenizer::NODES => array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_ARG,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_ARG,
|
||||||
Mustache_Tokenizer::NAME => 'bar',
|
Mustache_Tokenizer::NAME => 'bar',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 16,
|
Mustache_Tokenizer::INDEX => 16,
|
||||||
Mustache_Tokenizer::END => 19,
|
Mustache_Tokenizer::END => 19,
|
||||||
Mustache_Tokenizer::NODES => array(
|
Mustache_Tokenizer::NODES => array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => 'baz',
|
Mustache_Tokenizer::VALUE => 'baz',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -281,31 +281,31 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
|||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => 'bar',
|
Mustache_Tokenizer::VALUE => 'bar',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
||||||
Mustache_Tokenizer::NAME => 'foo',
|
Mustache_Tokenizer::NAME => 'foo',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 11,
|
Mustache_Tokenizer::INDEX => 11,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR,
|
||||||
Mustache_Tokenizer::NAME => 'foo',
|
Mustache_Tokenizer::NAME => 'foo',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::END => 11,
|
Mustache_Tokenizer::END => 11,
|
||||||
Mustache_Tokenizer::NODES => array(
|
Mustache_Tokenizer::NODES => array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => 'bar',
|
Mustache_Tokenizer::VALUE => 'bar',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -406,16 +406,16 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
|
|||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_TEXT,
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::VALUE => 'bar',
|
Mustache_Tokenizer::VALUE => 'bar',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_END_SECTION,
|
||||||
Mustache_Tokenizer::NAME => 'foo',
|
Mustache_Tokenizer::NAME => 'foo',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 11,
|
Mustache_Tokenizer::INDEX => 11,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -279,11 +279,11 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
|
|||||||
null,
|
null,
|
||||||
array(
|
array(
|
||||||
array(
|
array(
|
||||||
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR,
|
Mustache_Tokenizer::TYPE => Mustache_Tokenizer::T_BLOCK_VAR,
|
||||||
Mustache_Tokenizer::NAME => 'arg',
|
Mustache_Tokenizer::NAME => 'arg',
|
||||||
Mustache_Tokenizer::OTAG => '{{',
|
Mustache_Tokenizer::OTAG => '{{',
|
||||||
Mustache_Tokenizer::CTAG => '}}',
|
Mustache_Tokenizer::CTAG => '}}',
|
||||||
Mustache_Tokenizer::LINE => 0,
|
Mustache_Tokenizer::LINE => 0,
|
||||||
Mustache_Tokenizer::INDEX => 8,
|
Mustache_Tokenizer::INDEX => 8,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
class DotNotation
|
class DotNotation
|
||||||
{
|
{
|
||||||
public $person = array(
|
public $person = array(
|
||||||
'name' => array('first' => 'Chris', 'last' => 'Firescythe'),
|
'name' => array('first' => 'Chris', 'last' => 'Firescythe'),
|
||||||
'age' => 24,
|
'age' => 24,
|
||||||
'hometown' => array(
|
'hometown' => array(
|
||||||
'city' => 'Cincinnati',
|
'city' => 'Cincinnati',
|
||||||
'state' => 'OH',
|
'state' => 'OH',
|
||||||
|
|||||||
Vendored
+1
-1
@@ -10,7 +10,7 @@ class I18n
|
|||||||
|
|
||||||
// A *very* small i18n dictionary :)
|
// A *very* small i18n dictionary :)
|
||||||
private static $dictionary = array(
|
private static $dictionary = array(
|
||||||
'Hello.' => 'Hola.',
|
'Hello.' => 'Hola.',
|
||||||
'My name is {{ name }}.' => 'Me llamo {{ name }}.',
|
'My name is {{ name }}.' => 'Me llamo {{ name }}.',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class SectionsNested
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
'name' => 'Von Kaiser',
|
'name' => 'Von Kaiser',
|
||||||
'enemies' => array(
|
'enemies' => array(
|
||||||
array('name' => 'Super Macho Man'),
|
array('name' => 'Super Macho Man'),
|
||||||
array('name' => 'Piston Honda'),
|
array('name' => 'Piston Honda'),
|
||||||
@@ -16,7 +16,7 @@ class SectionsNested
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name' => 'Mike Tyson',
|
'name' => 'Mike Tyson',
|
||||||
'enemies' => array(
|
'enemies' => array(
|
||||||
array('name' => 'Soda Popinski'),
|
array('name' => 'Soda Popinski'),
|
||||||
array('name' => 'King Hippo'),
|
array('name' => 'King Hippo'),
|
||||||
@@ -25,7 +25,7 @@ class SectionsNested
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'name' => 'Don Flamenco',
|
'name' => 'Don Flamenco',
|
||||||
'enemies' => array(
|
'enemies' => array(
|
||||||
array('name' => 'Bald Bull'),
|
array('name' => 'Bald Bull'),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user