update CS by php-cs-fixer

This commit is contained in:
Dariusz Rumiński
2014-08-17 00:29:05 +02:00
parent bd3c7798c3
commit d07cac322c
25 changed files with 75 additions and 75 deletions
+7 -7
View File
@@ -278,7 +278,7 @@ class Mustache_Engine
public function getLoader()
{
if (!isset($this->loader)) {
$this->loader = new Mustache_Loader_StringLoader;
$this->loader = new Mustache_Loader_StringLoader();
}
return $this->loader;
@@ -305,7 +305,7 @@ class Mustache_Engine
public function getPartialsLoader()
{
if (!isset($this->partialsLoader)) {
$this->partialsLoader = new Mustache_Loader_ArrayLoader;
$this->partialsLoader = new Mustache_Loader_ArrayLoader();
}
return $this->partialsLoader;
@@ -321,7 +321,7 @@ class Mustache_Engine
public function setPartials(array $partials = array())
{
if (!isset($this->partialsLoader)) {
$this->partialsLoader = new Mustache_Loader_ArrayLoader;
$this->partialsLoader = new Mustache_Loader_ArrayLoader();
}
if (!$this->partialsLoader instanceof Mustache_Loader_MutableLoader) {
@@ -365,7 +365,7 @@ class Mustache_Engine
public function getHelpers()
{
if (!isset($this->helpers)) {
$this->helpers = new Mustache_HelperCollection;
$this->helpers = new Mustache_HelperCollection();
}
return $this->helpers;
@@ -474,7 +474,7 @@ class Mustache_Engine
public function getTokenizer()
{
if (!isset($this->tokenizer)) {
$this->tokenizer = new Mustache_Tokenizer;
$this->tokenizer = new Mustache_Tokenizer();
}
return $this->tokenizer;
@@ -500,7 +500,7 @@ class Mustache_Engine
public function getParser()
{
if (!isset($this->parser)) {
$this->parser = new Mustache_Parser;
$this->parser = new Mustache_Parser();
}
return $this->parser;
@@ -526,7 +526,7 @@ class Mustache_Engine
public function getCompiler()
{
if (!isset($this->compiler)) {
$this->compiler = new Mustache_Compiler;
$this->compiler = new Mustache_Compiler();
}
return $this->compiler;
+1 -1
View File
@@ -140,7 +140,7 @@ abstract class Mustache_Template
*/
protected function prepareContextStack($context = null)
{
$stack = new Mustache_Context;
$stack = new Mustache_Context();
$helpers = $this->mustache->getHelpers();
if (!$helpers->isEmpty()) {
+2 -2
View File
@@ -20,7 +20,7 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
*/
public function testCompile($source, array $tree, $name, $customEscaper, $entityFlags, $charset, $expected)
{
$compiler = new Mustache_Compiler;
$compiler = new Mustache_Compiler();
$compiled = $compiler->compile($source, $tree, $name, $customEscaper, $charset, false, $entityFlags);
foreach ($expected as $contains) {
@@ -138,7 +138,7 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
*/
public function testCompilerThrowsSyntaxException()
{
$compiler = new Mustache_Compiler;
$compiler = new Mustache_Compiler();
$compiler->compile('', array(array(Mustache_Tokenizer::TYPE => 'invalid')), 'SomeClass');
}
+9 -9
View File
@@ -16,7 +16,7 @@ class Mustache_Test_ContextTest extends PHPUnit_Framework_TestCase
{
public function testConstructor()
{
$one = new Mustache_Context;
$one = new Mustache_Context();
$this->assertSame('', $one->find('foo'));
$this->assertSame('', $one->find('bar'));
@@ -27,7 +27,7 @@ class Mustache_Test_ContextTest extends PHPUnit_Framework_TestCase
$this->assertEquals('FOO', $two->find('foo'));
$this->assertEquals('<BAR>', $two->find('bar'));
$obj = new StdClass;
$obj = new StdClass();
$obj->name = 'NAME';
$three = new Mustache_Context($obj);
$this->assertSame($obj, $three->last());
@@ -36,16 +36,16 @@ class Mustache_Test_ContextTest extends PHPUnit_Framework_TestCase
public function testPushPopAndLast()
{
$context = new Mustache_Context;
$context = new Mustache_Context();
$this->assertFalse($context->last());
$dummy = new Mustache_Test_TestDummy;
$dummy = new Mustache_Test_TestDummy();
$context->push($dummy);
$this->assertSame($dummy, $context->last());
$this->assertSame($dummy, $context->pop());
$this->assertFalse($context->last());
$obj = new StdClass;
$obj = new StdClass();
$context->push($dummy);
$this->assertSame($dummy, $context->last());
$context->push($obj);
@@ -57,11 +57,11 @@ class Mustache_Test_ContextTest extends PHPUnit_Framework_TestCase
public function testFind()
{
$context = new Mustache_Context;
$context = new Mustache_Context();
$dummy = new Mustache_Test_TestDummy;
$dummy = new Mustache_Test_TestDummy();
$obj = new StdClass;
$obj = new StdClass();
$obj->name = 'obj';
$arr = array(
@@ -112,7 +112,7 @@ class Mustache_Test_ContextTest extends PHPUnit_Framework_TestCase
public function testAccessorPriority()
{
$context = new Mustache_Context(new Mustache_Test_AllTheThings);
$context = new Mustache_Context(new Mustache_Test_AllTheThings());
$this->assertEquals('win', $context->find('foo'), 'method beats property');
$this->assertEquals('win', $context->find('bar'), 'property beats ArrayAccess');
+12 -12
View File
@@ -17,8 +17,8 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
public function testConstructor()
{
$logger = new Mustache_Logger_StreamLogger(tmpfile());
$loader = new Mustache_Loader_StringLoader;
$partialsLoader = new Mustache_Loader_ArrayLoader;
$loader = new Mustache_Loader_StringLoader();
$partialsLoader = new Mustache_Loader_ArrayLoader();
$mustache = new Mustache_Engine(array(
'template_class_prefix' => '__whot__',
'cache' => self::$tempDir,
@@ -69,7 +69,7 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
->disableOriginalConstructor()
->getMock();
$mustache = new MustacheStub;
$mustache = new MustacheStub();
$mustache->template = $template;
$template->expects($this->once())
@@ -84,11 +84,11 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
public function testSettingServices()
{
$logger = new Mustache_Logger_StreamLogger(tmpfile());
$loader = new Mustache_Loader_StringLoader;
$tokenizer = new Mustache_Tokenizer;
$parser = new Mustache_Parser;
$compiler = new Mustache_Compiler;
$mustache = new Mustache_Engine;
$loader = new Mustache_Loader_StringLoader();
$tokenizer = new Mustache_Tokenizer();
$parser = new Mustache_Parser();
$compiler = new Mustache_Compiler();
$mustache = new Mustache_Engine();
$cache = new Mustache_Cache_FilesystemCache(self::$tempDir);
$this->assertNotSame($logger, $mustache->getLogger());
@@ -181,7 +181,7 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
public function testImmutablePartialsLoadersThrowException()
{
$mustache = new Mustache_Engine(array(
'partials_loader' => new Mustache_Loader_StringLoader,
'partials_loader' => new Mustache_Loader_StringLoader(),
));
$mustache->setPartials(array('foo' => '{{ foo }}'));
@@ -245,7 +245,7 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
*/
public function testSetHelpersThrowsExceptions()
{
$mustache = new Mustache_Engine;
$mustache = new Mustache_Engine();
$mustache->setHelpers('monkeymonkeymonkey');
}
@@ -254,8 +254,8 @@ class Mustache_Test_EngineTest extends Mustache_Test_FunctionalTestCase
*/
public function testSetLoggerThrowsExceptions()
{
$mustache = new Mustache_Engine;
$mustache->setLogger(new StdClass);
$mustache = new Mustache_Engine();
$mustache->setLogger(new StdClass());
}
public function testLoadPartialCascading()
@@ -19,7 +19,7 @@ class Mustache_Test_FiveThree_Functional_ClosureQuirksTest extends PHPUnit_Frame
public function setUp()
{
$this->mustache = new Mustache_Engine;
$this->mustache = new Mustache_Engine();
}
public function testClosuresDontLikeItWhenYouTouchTheirProperties()
@@ -19,7 +19,7 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
public function setUp()
{
$this->mustache = new Mustache_Engine;
$this->mustache = new Mustache_Engine();
}
/**
@@ -71,7 +71,7 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
return sprintf('[[%s]]', $value);
});
$foo = new \StdClass;
$foo = new \StdClass();
$foo->date = new DateTime('1/1/2000', new DateTimeZone("UTC"));
$this->assertEquals('[[2000-01-01 12:01:00]]', $tpl->render($foo));
@@ -19,14 +19,14 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit
public function setUp()
{
$this->mustache = new Mustache_Engine;
$this->mustache = new Mustache_Engine();
}
public function testAnonymousFunctionSectionCallback()
{
$tpl = $this->mustache->loadTemplate('{{#wrapper}}{{name}}{{/wrapper}}');
$foo = new Mustache_Test_FiveThree_Functional_Foo;
$foo = new Mustache_Test_FiveThree_Functional_Foo();
$foo->name = 'Mario';
$foo->wrapper = function ($text) {
return sprintf('<div class="anonymous">%s</div>', $text);
@@ -40,7 +40,7 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit
$one = $this->mustache->loadTemplate('{{name}}');
$two = $this->mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}');
$foo = new Mustache_Test_FiveThree_Functional_Foo;
$foo = new Mustache_Test_FiveThree_Functional_Foo();
$foo->name = 'Luigi';
$this->assertEquals($foo->name, $one->render($foo));
@@ -19,7 +19,7 @@ class Mustache_Test_FiveThree_Functional_LambdaHelperTest extends PHPUnit_Framew
public function setUp()
{
$this->mustache = new Mustache_Engine;
$this->mustache = new Mustache_Engine();
}
public function testSectionLambdaHelper()
@@ -27,7 +27,7 @@ class Mustache_Test_FiveThree_Functional_LambdaHelperTest extends PHPUnit_Framew
$one = $this->mustache->loadTemplate('{{name}}');
$two = $this->mustache->loadTemplate('{{#lambda}}{{name}}{{/lambda}}');
$foo = new StdClass;
$foo = new StdClass();
$foo->name = 'Mario';
$foo->lambda = function ($text, $mustache) {
return strtoupper($mustache->render($text));
@@ -23,7 +23,7 @@ class Mustache_Test_FiveThree_Functional_StrictCallablesTest extends PHPUnit_Fra
$mustache = new Mustache_Engine(array('strict_callables' => $strict));
$tpl = $mustache->loadTemplate('{{# section }}{{ name }}{{/ section }}');
$data = new StdClass;
$data = new StdClass();
$data->name = $name;
$data->section = $section;
+1 -1
View File
@@ -18,7 +18,7 @@ class Mustache_Test_Functional_CallTest extends PHPUnit_Framework_TestCase
public function testCallEatsContext()
{
$m = new Mustache_Engine;
$m = new Mustache_Engine();
$tpl = $m->loadTemplate('{{# foo }}{{ label }}: {{ name }}{{/ foo }}');
$foo = new Mustache_Test_Functional_ClassWithCall();
@@ -93,7 +93,7 @@ class Mustache_Test_Functional_ExamplesTest extends PHPUnit_Framework_TestCase
switch ($info['extension']) {
case 'php':
require_once $fullpath;
$context = new $info['filename'];
$context = new $info['filename']();
break;
case 'mustache':
@@ -19,7 +19,7 @@ class Mustache_Test_Functional_HigherOrderSectionsTest extends Mustache_Test_Fun
public function setUp()
{
$this->mustache = new Mustache_Engine;
$this->mustache = new Mustache_Engine();
}
/**
@@ -32,10 +32,10 @@ class Mustache_Test_Functional_HigherOrderSectionsTest extends Mustache_Test_Fun
public function sectionCallbackData()
{
$foo = new Mustache_Test_Functional_Foo;
$foo = new Mustache_Test_Functional_Foo();
$foo->doublewrap = array($foo, 'wrapWithBoth');
$bar = new Mustache_Test_Functional_Foo;
$bar = new Mustache_Test_Functional_Foo();
$bar->trimmer = array(get_class($bar), 'staticTrim');
return array(
@@ -48,7 +48,7 @@ class Mustache_Test_Functional_HigherOrderSectionsTest extends Mustache_Test_Fun
{
$tpl = $this->mustache->loadTemplate('{{#trim}} {{name}} {{/trim}}');
$foo = new Mustache_Test_Functional_Foo;
$foo = new Mustache_Test_Functional_Foo();
$data = array(
'name' => 'Bob',
@@ -81,7 +81,7 @@ class Mustache_Test_Functional_HigherOrderSectionsTest extends Mustache_Test_Fun
$tpl = $mustache->loadTemplate('{{#wrap}}NAME{{/wrap}}');
$foo = new Mustache_Test_Functional_Foo;
$foo = new Mustache_Test_Functional_Foo();
$foo->wrap = array($foo, 'wrapWithEm');
$this->assertEquals('<em>NAME</em>', $tpl->render($foo));
@@ -96,7 +96,7 @@ class Mustache_Test_Functional_HigherOrderSectionsTest extends Mustache_Test_Fun
$tpl = $mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}');
$foo = new Mustache_Test_Functional_Foo;
$foo = new Mustache_Test_Functional_Foo();
$foo->wrap = array($foo, 'wrapWithEm');
$this->assertEquals('<em>' . $foo->name . '</em>', $tpl->render($foo));
@@ -115,7 +115,7 @@ class Mustache_Test_Functional_HigherOrderSectionsTest extends Mustache_Test_Fun
));
$tpl = $mustache->loadTemplate('{{#wrap}}{{name}}{{/wrap}}');
$foo = new Mustache_Test_Functional_Foo;
$foo = new Mustache_Test_Functional_Foo();
$foo->wrap = array($foo, 'wrapWithEm');
$this->assertEquals('<em>' . $foo->name . '</em>', $tpl->render($foo));
$this->assertCount($expect, glob($cacheDir . '/*.php'));
@@ -20,7 +20,7 @@ class Mustache_Test_Functional_MustacheInjectionTest extends PHPUnit_Framework_T
public function setUp()
{
$this->mustache = new Mustache_Engine;
$this->mustache = new Mustache_Engine();
}
/**
@@ -19,13 +19,13 @@ class Mustache_Test_Functional_ObjectSectionTest extends PHPUnit_Framework_TestC
public function setUp()
{
$this->mustache = new Mustache_Engine;
$this->mustache = new Mustache_Engine();
}
public function testBasicObject()
{
$tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}');
$this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Alpha));
$this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Alpha()));
}
/**
@@ -34,7 +34,7 @@ class Mustache_Test_Functional_ObjectSectionTest extends PHPUnit_Framework_TestC
public function testObjectWithGet()
{
$tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}');
$this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Beta));
$this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Beta()));
}
/**
@@ -43,14 +43,14 @@ class Mustache_Test_Functional_ObjectSectionTest extends PHPUnit_Framework_TestC
public function testSectionObjectWithGet()
{
$tpl = $this->mustache->loadTemplate('{{#bar}}{{#foo}}{{name}}{{/foo}}{{/bar}}');
$this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Gamma));
$this->assertEquals('Foo', $tpl->render(new Mustache_Test_Functional_Gamma()));
}
public function testSectionObjectWithFunction()
{
$tpl = $this->mustache->loadTemplate('{{#foo}}{{name}}{{/foo}}');
$alpha = new Mustache_Test_Functional_Alpha;
$alpha->foo = new Mustache_Test_Functional_Delta;
$alpha = new Mustache_Test_Functional_Alpha();
$alpha->foo = new Mustache_Test_Functional_Delta();
$this->assertEquals('Foo', $tpl->render($alpha));
}
}
@@ -95,7 +95,7 @@ class Mustache_Test_Functional_Gamma
public function __construct()
{
$this->bar = new Mustache_Test_Functional_Beta;
$this->bar = new Mustache_Test_Functional_Beta();
}
}
+2 -2
View File
@@ -35,7 +35,7 @@ class Mustache_Test_HelperCollectionTest extends PHPUnit_Framework_TestCase
$foo = array($this, 'getFoo');
$bar = 'BAR';
$helpers = new Mustache_HelperCollection;
$helpers = new Mustache_HelperCollection();
$this->assertTrue($helpers->isEmpty());
$this->assertFalse($helpers->has('foo'));
$this->assertFalse($helpers->has('bar'));
@@ -61,7 +61,7 @@ class Mustache_Test_HelperCollectionTest extends PHPUnit_Framework_TestCase
$foo = array($this, 'getFoo');
$bar = 'BAR';
$helpers = new Mustache_HelperCollection;
$helpers = new Mustache_HelperCollection();
$this->assertTrue($helpers->isEmpty());
$this->assertFalse($helpers->has('foo'));
$this->assertFalse($helpers->has('bar'));
@@ -46,7 +46,7 @@ class Mustache_Test_Loader_ArrayLoaderTest extends PHPUnit_Framework_TestCase
*/
public function testMissingTemplatesThrowExceptions()
{
$loader = new Mustache_Loader_ArrayLoader;
$loader = new Mustache_Loader_ArrayLoader();
$loader->load('not_a_real_template');
}
}
@@ -16,7 +16,7 @@ class Mustache_Test_Loader_StringLoaderTest extends PHPUnit_Framework_TestCase
{
public function testLoadTemplates()
{
$loader = new Mustache_Loader_StringLoader;
$loader = new Mustache_Loader_StringLoader();
$this->assertEquals('foo', $loader->load('foo'));
$this->assertEquals('{{ bar }}', $loader->load('{{ bar }}'));
@@ -16,7 +16,7 @@ class Mustache_Test_Logger_AbstractLoggerTest extends PHPUnit_Framework_TestCase
{
public function testEverything()
{
$logger = new Mustache_Test_Logger_TestLogger;
$logger = new Mustache_Test_Logger_TestLogger();
$logger->emergency('emergency message');
$logger->alert('alert message');
+3 -3
View File
@@ -20,7 +20,7 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
*/
public function testParse($tokens, $expected)
{
$parser = new Mustache_Parser;
$parser = new Mustache_Parser();
$this->assertEquals($expected, $parser->parse($tokens));
}
@@ -157,7 +157,7 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
*/
public function testParseWithInheritance($tokens, $expected)
{
$parser = new Mustache_Parser;
$parser = new Mustache_Parser();
$parser->setPragmas(array(Mustache_Engine::PRAGMA_BLOCKS));
$this->assertEquals($expected, $parser->parse($tokens));
}
@@ -286,7 +286,7 @@ class Mustache_Test_ParserTest extends PHPUnit_Framework_TestCase
*/
public function testParserThrowsExceptions($tokens)
{
$parser = new Mustache_Parser;
$parser = new Mustache_Parser();
$parser->parse($tokens);
}
+2 -2
View File
@@ -15,7 +15,7 @@ abstract class Mustache_Test_SpecTestCase extends PHPUnit_Framework_TestCase
public static function setUpBeforeClass()
{
self::$mustache = new Mustache_Engine;
self::$mustache = new Mustache_Engine();
}
protected static function loadTemplate($source, $partials)
@@ -42,7 +42,7 @@ abstract class Mustache_Test_SpecTestCase extends PHPUnit_Framework_TestCase
}
$data = array();
$yaml = new sfYamlParser;
$yaml = new sfYamlParser();
$file = file_get_contents($filename);
// @hack: pre-process the 'lambdas' spec so the Symfony YAML parser doesn't complain.
+3 -3
View File
@@ -16,7 +16,7 @@ class Mustache_Test_TemplateTest extends PHPUnit_Framework_TestCase
{
public function testConstructor()
{
$mustache = new Mustache_Engine;
$mustache = new Mustache_Engine();
$template = new Mustache_Test_TemplateStub($mustache);
$this->assertSame($mustache, $template->getMustache());
}
@@ -24,10 +24,10 @@ class Mustache_Test_TemplateTest extends PHPUnit_Framework_TestCase
public function testRendering()
{
$rendered = '<< wheee >>';
$mustache = new Mustache_Engine;
$mustache = new Mustache_Engine();
$template = new Mustache_Test_TemplateStub($mustache);
$template->rendered = $rendered;
$context = new Mustache_Context;
$context = new Mustache_Context();
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
$this->assertEquals($rendered, $template());
+3 -3
View File
@@ -20,7 +20,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
*/
public function testScan($text, $delimiters, $expected)
{
$tokenizer = new Mustache_Tokenizer;
$tokenizer = new Mustache_Tokenizer();
$this->assertSame($expected, $tokenizer->scan($text, $delimiters));
}
@@ -29,7 +29,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
*/
public function testUnevenBracesThrowExceptions()
{
$tokenizer = new Mustache_Tokenizer;
$tokenizer = new Mustache_Tokenizer();
$text = "{{{ name }}";
$tokenizer->scan($text, null);
@@ -40,7 +40,7 @@ class Mustache_Test_TokenizerTest extends PHPUnit_Framework_TestCase
*/
public function testUnevenBracesWithCustomDelimiterThrowExceptions()
{
$tokenizer = new Mustache_Tokenizer;
$tokenizer = new Mustache_Tokenizer();
$text = "<%{ name %>";
$tokenizer->scan($text, "<% %>");
+1 -1
View File
@@ -6,7 +6,7 @@ class SectionObjects
public function middle()
{
return new SectionObject;
return new SectionObject();
}
public $final = "Then, surprisingly, it worked the final time.";