Minor CS changes.

This commit is contained in:
Justin Hileman
2014-03-25 09:21:16 -07:00
parent 151de6f13e
commit 2bb13b37a4
8 changed files with 32 additions and 32 deletions
@@ -13,7 +13,7 @@
* @group lambdas * @group lambdas
* @group functional * @group functional
*/ */
class Mustache_Test_FiveThree_Functional_ClosuresQuirksTest extends PHPUnit_Framework_TestCase class Mustache_Test_FiveThree_Functional_ClosureQuirksTest extends PHPUnit_Framework_TestCase
{ {
private $mustache; private $mustache;
@@ -25,6 +25,6 @@ class Mustache_Test_FiveThree_Functional_ClosuresQuirksTest extends PHPUnit_Fram
public function testClosuresDontLikeItWhenYouTouchTheirProperties() public function testClosuresDontLikeItWhenYouTouchTheirProperties()
{ {
$tpl = $this->mustache->loadTemplate('{{ foo.bar }}'); $tpl = $this->mustache->loadTemplate('{{ foo.bar }}');
$this->assertEquals('', $tpl->render(array('foo' => function() { return 'FOO'; }))); $this->assertEquals('', $tpl->render(array('foo' => function () { return 'FOO'; })));
} }
} }
@@ -27,7 +27,7 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
{ {
$tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ date | longdate }}'); $tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ date | longdate }}');
$this->mustache->addHelper('longdate', function(\DateTime $value) { $this->mustache->addHelper('longdate', function (\DateTime $value) {
return $value->format('Y-m-d h:m:s'); return $value->format('Y-m-d h:m:s');
}); });
@@ -41,11 +41,11 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
{ {
$tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ date | longdate | withbrackets }}'); $tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ date | longdate | withbrackets }}');
$this->mustache->addHelper('longdate', function(\DateTime $value) { $this->mustache->addHelper('longdate', function (\DateTime $value) {
return $value->format('Y-m-d h:m:s'); return $value->format('Y-m-d h:m:s');
}); });
$this->mustache->addHelper('withbrackets', function($value) { $this->mustache->addHelper('withbrackets', function ($value) {
return sprintf('[[%s]]', $value); return sprintf('[[%s]]', $value);
}); });
@@ -60,7 +60,7 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
$tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ foo | bar }}'); $tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{ foo | bar }}');
$this->assertEquals('win!', $tpl->render(array( $this->assertEquals('win!', $tpl->render(array(
'foo' => 'FOO', 'foo' => 'FOO',
'bar' => function($value) { 'bar' => function ($value) {
return ($value === 'FOO') ? 'win!' : 'fail :('; return ($value === 'FOO') ? 'win!' : 'fail :(';
}, },
))); )));
@@ -84,11 +84,11 @@ class Mustache_Test_FiveThree_Functional_FiltersTest extends PHPUnit_Framework_T
array('foo | bar', array('foo' => 'FOO')), array('foo | bar', array('foo' => 'FOO')),
array('foo | bar', array('foo' => 'FOO', 'bar' => 'BAR')), array('foo | bar', array('foo' => 'FOO', 'bar' => 'BAR')),
array('foo | bar', array('foo' => 'FOO', 'bar' => array(1, 2))), array('foo | bar', array('foo' => 'FOO', 'bar' => array(1, 2))),
array('foo | bar | baz', array('foo' => 'FOO', 'bar' => function() { return 'BAR'; })), array('foo | bar | baz', array('foo' => 'FOO', 'bar' => function () { return 'BAR'; })),
array('foo | bar | baz', array('foo' => 'FOO', 'baz' => function() { return 'BAZ'; })), array('foo | bar | baz', array('foo' => 'FOO', 'baz' => function () { return 'BAZ'; })),
array('foo | bar | baz', array('bar' => function() { return 'BAR'; })), array('foo | bar | baz', array('bar' => function () { return 'BAR'; })),
array('foo | bar | baz', array('baz' => function() { return 'BAZ'; })), array('foo | bar | baz', array('baz' => function () { return 'BAZ'; })),
array('foo | bar.baz', array('foo' => 'FOO', 'bar' => function() { return 'BAR'; }, 'baz' => function() { return 'BAZ'; })), array('foo | bar.baz', array('foo' => 'FOO', 'bar' => function () { return 'BAR'; }, 'baz' => function () { return 'BAZ'; })),
); );
} }
} }
@@ -28,7 +28,7 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit
$foo = new Mustache_Test_FiveThree_Functional_Foo; $foo = new Mustache_Test_FiveThree_Functional_Foo;
$foo->name = 'Mario'; $foo->name = 'Mario';
$foo->wrapper = function($text) { $foo->wrapper = function ($text) {
return sprintf('<div class="anonymous">%s</div>', $text); return sprintf('<div class="anonymous">%s</div>', $text);
}; };
@@ -53,7 +53,7 @@ class Mustache_Test_FiveThree_Functional_HigherOrderSectionsTest extends PHPUnit
$data = array( $data = array(
'name' => 'Bob', 'name' => 'Bob',
'wrap' => function($text) { 'wrap' => function ($text) {
return sprintf('[[%s]]', $text); return sprintf('[[%s]]', $text);
} }
); );
@@ -70,7 +70,7 @@ class Mustache_Test_FiveThree_Functional_Foo
public function __construct() public function __construct()
{ {
$this->wrap = function($text) { $this->wrap = function ($text) {
return sprintf('<em>%s</em>', $text); return sprintf('<em>%s</em>', $text);
}; };
} }
@@ -29,7 +29,7 @@ class Mustache_Test_FiveThree_Functional_LambdaHelperTest extends PHPUnit_Framew
$foo = new StdClass; $foo = new StdClass;
$foo->name = 'Mario'; $foo->name = 'Mario';
$foo->lambda = function($text, $mustache) { $foo->lambda = function ($text, $mustache) {
return strtoupper($mustache->render($text)); return strtoupper($mustache->render($text));
}; };
@@ -55,7 +55,7 @@ class Mustache_Test_FiveThree_Functional_MustacheSpecTest extends Mustache_Test_
} }
$func = $val['php']; $func = $val['php'];
$data[$key] = function($text = null) use ($func) { $data[$key] = function ($text = null) use ($func) {
return eval($func); return eval($func);
}; };
} elseif (is_array($val)) { } elseif (is_array($val)) {
@@ -51,7 +51,7 @@ class Mustache_Test_Functional_ClassWithLambda
{ {
public function _t() public function _t()
{ {
return function($val) { return function ($val) {
return strtoupper($val); return strtoupper($val);
}; };
} }
@@ -27,7 +27,7 @@ class Mustache_Test_FiveThree_Functional_SectionFiltersTest extends PHPUnit_Fram
{ {
$tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{# word | echo }}{{ . }}!{{/ word | echo }}'); $tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{# word | echo }}{{ . }}!{{/ word | echo }}');
$this->mustache->addHelper('echo', function($value) { $this->mustache->addHelper('echo', function ($value) {
return array($value, $value, $value); return array($value, $value, $value);
}); });
@@ -45,12 +45,12 @@ EOS;
{ {
$tpl = $this->mustache->loadTemplate(self::CHAINED_FILTERS_TPL); $tpl = $this->mustache->loadTemplate(self::CHAINED_FILTERS_TPL);
$this->mustache->addHelper('echo', function($value) { $this->mustache->addHelper('echo', function ($value) {
return array($value, $value, $value); return array($value, $value, $value);
}); });
$this->mustache->addHelper('with_index', function($value) { $this->mustache->addHelper('with_index', function ($value) {
return array_map(function($k, $v) { return array_map(function ($k, $v) {
return array( return array(
'key' => $k, 'key' => $k,
'value' => $v, 'value' => $v,
@@ -66,7 +66,7 @@ EOS;
$tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}'); $tpl = $this->mustache->loadTemplate('{{% FILTERS }}{{# foo | bar }}{{ . }}{{/ foo | bar }}');
$this->assertEquals('win!', $tpl->render(array( $this->assertEquals('win!', $tpl->render(array(
'foo' => 'FOO', 'foo' => 'FOO',
'bar' => function($value) { 'bar' => function ($value) {
return ($value === 'FOO') ? 'win!' : 'fail :('; return ($value === 'FOO') ? 'win!' : 'fail :(';
}, },
))); )));
@@ -90,11 +90,11 @@ EOS;
array('foo | bar', array('foo' => 'FOO')), array('foo | bar', array('foo' => 'FOO')),
array('foo | bar', array('foo' => 'FOO', 'bar' => 'BAR')), array('foo | bar', array('foo' => 'FOO', 'bar' => 'BAR')),
array('foo | bar', array('foo' => 'FOO', 'bar' => array(1, 2))), array('foo | bar', array('foo' => 'FOO', 'bar' => array(1, 2))),
array('foo | bar | baz', array('foo' => 'FOO', 'bar' => function() { return 'BAR'; })), array('foo | bar | baz', array('foo' => 'FOO', 'bar' => function () { return 'BAR'; })),
array('foo | bar | baz', array('foo' => 'FOO', 'baz' => function() { return 'BAZ'; })), array('foo | bar | baz', array('foo' => 'FOO', 'baz' => function () { return 'BAZ'; })),
array('foo | bar | baz', array('bar' => function() { return 'BAR'; })), array('foo | bar | baz', array('bar' => function () { return 'BAR'; })),
array('foo | bar | baz', array('baz' => function() { return 'BAZ'; })), array('foo | bar | baz', array('baz' => function () { return 'BAZ'; })),
array('foo | bar.baz', array('foo' => 'FOO', 'bar' => function() { return 'BAR'; }, 'baz' => function() { return 'BAZ'; })), array('foo | bar.baz', array('foo' => 'FOO', 'bar' => function () { return 'BAR'; }, 'baz' => function () { return 'BAZ'; })),
); );
} }
@@ -32,7 +32,7 @@ class Mustache_Test_FiveThree_Functional_StrictCallablesTest extends PHPUnit_Fra
public function callables() public function callables()
{ {
$lambda = function($tpl, $mustache) { $lambda = function ($tpl, $mustache) {
return strtoupper($mustache->render($tpl)); return strtoupper($mustache->render($tpl));
}; };
@@ -49,7 +49,7 @@ class Mustache_Test_FiveThree_Functional_StrictCallablesTest extends PHPUnit_Fra
'YOSHI', 'YOSHI',
), ),
array( array(
function() { return 'Yoshi'; }, function () { return 'Yoshi'; },
$lambda, $lambda,
'YOSHI', 'YOSHI',
), ),
@@ -91,14 +91,14 @@ class Mustache_Test_FiveThree_Functional_StrictCallablesTest extends PHPUnit_Fra
public function strictCallables() public function strictCallables()
{ {
$lambda = function($tpl, $mustache) { $lambda = function ($tpl, $mustache) {
return strtoupper($mustache->render($tpl)); return strtoupper($mustache->render($tpl));
}; };
return array( return array(
// Interpolation lambdas // Interpolation lambdas
array( array(
function() { return 'Yoshi'; }, function () { return 'Yoshi'; },
$lambda, $lambda,
'YOSHI', 'YOSHI',
), ),
@@ -116,7 +116,7 @@ class Mustache_Test_FiveThree_Functional_StrictCallablesTest extends PHPUnit_Fra
), ),
array( array(
'Yoshi', 'Yoshi',
function($tpl, $mustache) { function ($tpl, $mustache) {
return strtoupper($mustache->render($tpl)); return strtoupper($mustache->render($tpl));
}, },
'YOSHI', 'YOSHI',