From: jeroendedauw Date: Wed, 30 Jul 2014 21:27:25 +0000 (+0200) Subject: Remove unused local vars X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3e50672029f0c69281e8c49bb22c753b729efa97;p=web%2Fkonrad%2Ftwig.git Remove unused local vars --- diff --git a/test/Twig/Tests/EnvironmentTest.php b/test/Twig/Tests/EnvironmentTest.php index a5fc878..b791e57 100644 --- a/test/Twig/Tests/EnvironmentTest.php +++ b/test/Twig/Tests/EnvironmentTest.php @@ -48,7 +48,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase // globals can be added after calling getGlobals $twig = new Twig_Environment(new Twig_Loader_String()); $twig->addGlobal('foo', 'foo'); - $globals = $twig->getGlobals(); + $twig->getGlobals(); $twig->addGlobal('foo', 'bar'); $globals = $twig->getGlobals(); $this->assertEquals('bar', $globals['foo']); @@ -65,7 +65,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase // globals can be modified after extensions init $twig = new Twig_Environment(new Twig_Loader_String()); $twig->addGlobal('foo', 'foo'); - $globals = $twig->getGlobals(); + $twig->getGlobals(); $twig->getFunctions(); $twig->addGlobal('foo', 'bar'); $globals = $twig->getGlobals(); @@ -74,7 +74,7 @@ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase // globals can be modified after extensions and runtime init $twig = new Twig_Environment(new Twig_Loader_String()); $twig->addGlobal('foo', 'foo'); - $globals = $twig->getGlobals(); + $twig->getGlobals(); $twig->getFunctions(); $twig->initRuntime(); $twig->addGlobal('foo', 'bar'); diff --git a/test/Twig/Tests/FileCachingTest.php b/test/Twig/Tests/FileCachingTest.php index 8efc948..36cdd33 100644 --- a/test/Twig/Tests/FileCachingTest.php +++ b/test/Twig/Tests/FileCachingTest.php @@ -32,7 +32,7 @@ class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase public function testWritingCacheFiles() { $name = 'This is just text.'; - $template = $this->env->loadTemplate($name); + $this->env->loadTemplate($name); $cacheFileName = $this->env->getCacheFilename($name); $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); @@ -42,7 +42,7 @@ class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase public function testClearingCacheFiles() { $name = 'I will be deleted.'; - $template = $this->env->loadTemplate($name); + $this->env->loadTemplate($name); $cacheFileName = $this->env->getCacheFilename($name); $this->assertTrue(file_exists($cacheFileName), 'Cache file does not exist.'); diff --git a/test/Twig/Tests/LexerTest.php b/test/Twig/Tests/LexerTest.php index ab104f4..97df3e5 100644 --- a/test/Twig/Tests/LexerTest.php +++ b/test/Twig/Tests/LexerTest.php @@ -46,7 +46,6 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase $stream = $lexer->tokenize($template); $count = 0; - $tokens = array(); while (!$stream->isEOF()) { $token = $stream->next(); if ($type === $token->getType()) { @@ -114,7 +113,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase $template = '{% raw %}'.str_repeat('*', 100000).'{% endraw %}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); // should not throw an exception } @@ -124,7 +123,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase $template = '{{ '.str_repeat('x', 100000).' }}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); // should not throw an exception } @@ -134,7 +133,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase $template = '{% '.str_repeat('x', 100000).' %}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); // should not throw an exception } @@ -216,7 +215,7 @@ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase $template = '{{ "bar #{x" }}'; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); } public function testStringWithNestedInterpolations() @@ -281,7 +280,7 @@ bar '; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); } /** @@ -300,6 +299,6 @@ bar '; $lexer = new Twig_Lexer(new Twig_Environment()); - $stream = $lexer->tokenize($template); + $lexer->tokenize($template); } } diff --git a/test/Twig/Tests/escapingTest.php b/test/Twig/Tests/escapingTest.php index 9ab90c2..d581315 100644 --- a/test/Twig/Tests/escapingTest.php +++ b/test/Twig/Tests/escapingTest.php @@ -301,7 +301,7 @@ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase public function testCssEscapingEscapesOwaspRecommendedRanges() { - $immune = array(); // CSS has no exceptions to escaping ranges + // CSS has no exceptions to escaping ranges for ($chr=0; $chr < 0xFF; $chr++) { if ($chr >= 0x30 && $chr <= 0x39 || $chr >= 0x41 && $chr <= 0x5A