From a009821dd31fa783269602507542cea978c9714a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 3 Nov 2012 08:27:23 +0100 Subject: [PATCH] fixed CS --- lib/Twig/Autoloader.php | 4 ++-- lib/Twig/CompilerInterface.php | 4 ++-- lib/Twig/ExistsLoaderInterface.php | 1 - lib/Twig/Extension/Core.php | 5 +++-- lib/Twig/Extension/Escaper.php | 1 - lib/Twig/ExtensionInterface.php | 18 +++++++++--------- lib/Twig/FilterInterface.php | 16 ++++++++-------- lib/Twig/FunctionInterface.php | 12 ++++++------ lib/Twig/LexerInterface.php | 2 +- lib/Twig/LoaderInterface.php | 6 +++--- lib/Twig/Node.php | 2 +- lib/Twig/Node/Macro.php | 2 +- lib/Twig/Node/SandboxedModule.php | 2 +- lib/Twig/NodeInterface.php | 6 +++--- lib/Twig/NodeVisitorInterface.php | 6 +++--- lib/Twig/ParserInterface.php | 2 +- lib/Twig/Sandbox/SecurityPolicyInterface.php | 6 +++--- lib/Twig/Template.php | 4 ++-- lib/Twig/TemplateInterface.php | 6 +++--- lib/Twig/Test/IntegrationTestCase.php | 4 ++-- lib/Twig/TestInterface.php | 2 +- lib/Twig/Token.php | 4 ++-- lib/Twig/TokenParserBrokerInterface.php | 6 +++--- lib/Twig/TokenParserInterface.php | 6 +++--- test/Twig/Tests/Extension/SandboxTest.php | 6 +++--- test/Twig/Tests/Node/AutoEscapeTest.php | 1 - test/Twig/Tests/Node/BlockReferenceTest.php | 1 - test/Twig/Tests/Node/BlockTest.php | 1 - test/Twig/Tests/Node/DoTest.php | 1 - test/Twig/Tests/Node/ForTest.php | 1 - test/Twig/Tests/Node/IfTest.php | 1 - test/Twig/Tests/Node/ImportTest.php | 1 - test/Twig/Tests/Node/IncludeTest.php | 1 - test/Twig/Tests/Node/MacroTest.php | 3 +-- test/Twig/Tests/Node/ModuleTest.php | 1 - test/Twig/Tests/Node/PrintTest.php | 1 - test/Twig/Tests/Node/SandboxTest.php | 1 - test/Twig/Tests/Node/SandboxedModuleTest.php | 7 ++++--- test/Twig/Tests/Node/SandboxedPrintTest.php | 1 - test/Twig/Tests/Node/SetTest.php | 1 - test/Twig/Tests/Node/SpacelessTest.php | 1 - test/Twig/Tests/Node/TextTest.php | 1 - test/Twig/Tests/TemplateTest.php | 16 ++++++++++------ test/Twig/Tests/TokenStreamTest.php | 2 +- 44 files changed, 82 insertions(+), 94 deletions(-) diff --git a/lib/Twig/Autoloader.php b/lib/Twig/Autoloader.php index 59f28f7..9bcec43 100644 --- a/lib/Twig/Autoloader.php +++ b/lib/Twig/Autoloader.php @@ -20,7 +20,7 @@ class Twig_Autoloader /** * Registers Twig_Autoloader as an SPL autoloader. */ - static public function register() + public static function register() { ini_set('unserialize_callback_func', 'spl_autoload_call'); spl_autoload_register(array(new self, 'autoload')); @@ -31,7 +31,7 @@ class Twig_Autoloader * * @param string $class A class name. */ - static public function autoload($class) + public static function autoload($class) { if (0 !== strpos($class, 'Twig')) { return; diff --git a/lib/Twig/CompilerInterface.php b/lib/Twig/CompilerInterface.php index f861381..89d87e6 100644 --- a/lib/Twig/CompilerInterface.php +++ b/lib/Twig/CompilerInterface.php @@ -24,12 +24,12 @@ interface Twig_CompilerInterface * * @return Twig_CompilerInterface The current compiler instance */ - function compile(Twig_NodeInterface $node); + public function compile(Twig_NodeInterface $node); /** * Gets the current PHP code after compilation. * * @return string The PHP code */ - function getSource(); + public function getSource(); } diff --git a/lib/Twig/ExistsLoaderInterface.php b/lib/Twig/ExistsLoaderInterface.php index 90709c6..0e08a1d 100644 --- a/lib/Twig/ExistsLoaderInterface.php +++ b/lib/Twig/ExistsLoaderInterface.php @@ -17,7 +17,6 @@ */ interface Twig_ExistsLoaderInterface { - /** * Check if we have the source code of a template, given its name. * diff --git a/lib/Twig/Extension/Core.php b/lib/Twig/Extension/Core.php index 62fc49c..3db899f 100644 --- a/lib/Twig/Extension/Core.php +++ b/lib/Twig/Extension/Core.php @@ -969,6 +969,7 @@ function _twig_escape_css_callback($matches) if (0 === strlen($hex)) { $hex = '0'; } + return '\\'.$hex.' '; } @@ -1030,6 +1031,7 @@ function _twig_escape_html_attr_callback($matches) * Per OWASP recommendations, we'll use hex entities for any other * characters where a named entity does not exist. */ + return sprintf('&#x%s;', $hex); } @@ -1118,8 +1120,7 @@ if (function_exists('mb_get_info')) { } } // and byte fallback -else -{ +else { /** * Returns the length of a variable. * diff --git a/lib/Twig/Extension/Escaper.php b/lib/Twig/Extension/Escaper.php index c02c3a8..db1a50e 100644 --- a/lib/Twig/Extension/Escaper.php +++ b/lib/Twig/Extension/Escaper.php @@ -105,4 +105,3 @@ function twig_raw_filter($string) { return $string; } - diff --git a/lib/Twig/ExtensionInterface.php b/lib/Twig/ExtensionInterface.php index 0bfed88..fe20a4e 100644 --- a/lib/Twig/ExtensionInterface.php +++ b/lib/Twig/ExtensionInterface.php @@ -24,61 +24,61 @@ interface Twig_ExtensionInterface * * @param Twig_Environment $environment The current Twig_Environment instance */ - function initRuntime(Twig_Environment $environment); + public function initRuntime(Twig_Environment $environment); /** * Returns the token parser instances to add to the existing list. * * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances */ - function getTokenParsers(); + public function getTokenParsers(); /** * Returns the node visitor instances to add to the existing list. * * @return array An array of Twig_NodeVisitorInterface instances */ - function getNodeVisitors(); + public function getNodeVisitors(); /** * Returns a list of filters to add to the existing list. * * @return array An array of filters */ - function getFilters(); + public function getFilters(); /** * Returns a list of tests to add to the existing list. * * @return array An array of tests */ - function getTests(); + public function getTests(); /** * Returns a list of functions to add to the existing list. * * @return array An array of functions */ - function getFunctions(); + public function getFunctions(); /** * Returns a list of operators to add to the existing list. * * @return array An array of operators */ - function getOperators(); + public function getOperators(); /** * Returns a list of global variables to add to the existing list. * * @return array An array of global variables */ - function getGlobals(); + public function getGlobals(); /** * Returns the name of the extension. * * @return string The extension name */ - function getName(); + public function getName(); } diff --git a/lib/Twig/FilterInterface.php b/lib/Twig/FilterInterface.php index f398026..0a07c7c 100644 --- a/lib/Twig/FilterInterface.php +++ b/lib/Twig/FilterInterface.php @@ -22,19 +22,19 @@ interface Twig_FilterInterface * * @return string The PHP code for the filter */ - function compile(); + public function compile(); - function needsEnvironment(); + public function needsEnvironment(); - function needsContext(); + public function needsContext(); - function getSafe(Twig_Node $filterArgs); + public function getSafe(Twig_Node $filterArgs); - function getPreservesSafety(); + public function getPreservesSafety(); - function getPreEscape(); + public function getPreEscape(); - function setArguments($arguments); + public function setArguments($arguments); - function getArguments(); + public function getArguments(); } diff --git a/lib/Twig/FunctionInterface.php b/lib/Twig/FunctionInterface.php index d402d17..d652ac3 100644 --- a/lib/Twig/FunctionInterface.php +++ b/lib/Twig/FunctionInterface.php @@ -23,15 +23,15 @@ interface Twig_FunctionInterface * * @return string The PHP code for the function */ - function compile(); + public function compile(); - function needsEnvironment(); + public function needsEnvironment(); - function needsContext(); + public function needsContext(); - function getSafe(Twig_Node $filterArgs); + public function getSafe(Twig_Node $filterArgs); - function setArguments($arguments); + public function setArguments($arguments); - function getArguments(); + public function getArguments(); } diff --git a/lib/Twig/LexerInterface.php b/lib/Twig/LexerInterface.php index 2bec235..9c3d3d2 100644 --- a/lib/Twig/LexerInterface.php +++ b/lib/Twig/LexerInterface.php @@ -25,5 +25,5 @@ interface Twig_LexerInterface * * @return Twig_TokenStream A token stream instance */ - function tokenize($code, $filename = null); + public function tokenize($code, $filename = null); } diff --git a/lib/Twig/LoaderInterface.php b/lib/Twig/LoaderInterface.php index 55e3ac6..3d69b14 100644 --- a/lib/Twig/LoaderInterface.php +++ b/lib/Twig/LoaderInterface.php @@ -26,7 +26,7 @@ interface Twig_LoaderInterface * * @throws Twig_Error_Loader When $name is not found */ - function getSource($name); + public function getSource($name); /** * Gets the cache key to use for the cache for a given template name. @@ -37,7 +37,7 @@ interface Twig_LoaderInterface * * @throws Twig_Error_Loader When $name is not found */ - function getCacheKey($name); + public function getCacheKey($name); /** * Returns true if the template is still fresh. @@ -49,5 +49,5 @@ interface Twig_LoaderInterface * * @throws Twig_Error_Loader When $name is not found */ - function isFresh($name, $time); + public function isFresh($name, $time); } diff --git a/lib/Twig/Node.php b/lib/Twig/Node.php index 04f735c..3048db5 100644 --- a/lib/Twig/Node.php +++ b/lib/Twig/Node.php @@ -134,7 +134,7 @@ class Twig_Node implements Twig_NodeInterface * * @param string The attribute name * - * @return mixed The attribute value + * @return mixed The attribute value */ public function getAttribute($name) { diff --git a/lib/Twig/Node/Macro.php b/lib/Twig/Node/Macro.php index e0c3dca..11a7d1a 100644 --- a/lib/Twig/Node/Macro.php +++ b/lib/Twig/Node/Macro.php @@ -70,7 +70,7 @@ class Twig_Node_Macro extends Twig_Node ->indent() ->subcompile($this->getNode('body')) ->outdent() - ->write("} catch(Exception \$e) {\n") + ->write("} catch (Exception \$e) {\n") ->indent() ->write("ob_end_clean();\n\n") ->write("throw \$e;\n") diff --git a/lib/Twig/Node/SandboxedModule.php b/lib/Twig/Node/SandboxedModule.php index 6dd63e5..c1b3bce 100644 --- a/lib/Twig/Node/SandboxedModule.php +++ b/lib/Twig/Node/SandboxedModule.php @@ -45,7 +45,7 @@ class Twig_Node_SandboxedModule extends Twig_Node_Module parent::compileDisplayFooter($compiler); $compiler - ->write("protected function checkSecurity() {\n") + ->write("protected function checkSecurity()\n", "{\n") ->indent() ->write("\$this->env->getExtension('sandbox')->checkSecurity(\n") ->indent() diff --git a/lib/Twig/NodeInterface.php b/lib/Twig/NodeInterface.php index 29a84b0..e77782f 100644 --- a/lib/Twig/NodeInterface.php +++ b/lib/Twig/NodeInterface.php @@ -22,9 +22,9 @@ interface Twig_NodeInterface extends Countable, IteratorAggregate * * @param Twig_Compiler A Twig_Compiler instance */ - function compile(Twig_Compiler $compiler); + public function compile(Twig_Compiler $compiler); - function getLine(); + public function getLine(); - function getNodeTag(); + public function getNodeTag(); } diff --git a/lib/Twig/NodeVisitorInterface.php b/lib/Twig/NodeVisitorInterface.php index e0123b5..f4974c6 100644 --- a/lib/Twig/NodeVisitorInterface.php +++ b/lib/Twig/NodeVisitorInterface.php @@ -25,7 +25,7 @@ interface Twig_NodeVisitorInterface * * @return Twig_NodeInterface The modified node */ - function enterNode(Twig_NodeInterface $node, Twig_Environment $env); + public function enterNode(Twig_NodeInterface $node, Twig_Environment $env); /** * Called after child nodes are visited. @@ -35,7 +35,7 @@ interface Twig_NodeVisitorInterface * * @return Twig_NodeInterface The modified node */ - function leaveNode(Twig_NodeInterface $node, Twig_Environment $env); + public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env); /** * Returns the priority for this visitor. @@ -44,5 +44,5 @@ interface Twig_NodeVisitorInterface * * @return integer The priority level */ - function getPriority(); + public function getPriority(); } diff --git a/lib/Twig/ParserInterface.php b/lib/Twig/ParserInterface.php index 9659845..4de3999 100644 --- a/lib/Twig/ParserInterface.php +++ b/lib/Twig/ParserInterface.php @@ -24,5 +24,5 @@ interface Twig_ParserInterface * * @return Twig_Node_Module A node tree */ - function parse(Twig_TokenStream $stream); + public function parse(Twig_TokenStream $stream); } diff --git a/lib/Twig/Sandbox/SecurityPolicyInterface.php b/lib/Twig/Sandbox/SecurityPolicyInterface.php index d5015af..655b16b 100644 --- a/lib/Twig/Sandbox/SecurityPolicyInterface.php +++ b/lib/Twig/Sandbox/SecurityPolicyInterface.php @@ -17,9 +17,9 @@ */ interface Twig_Sandbox_SecurityPolicyInterface { - function checkSecurity($tags, $filters, $functions); + public function checkSecurity($tags, $filters, $functions); - function checkMethodAllowed($obj, $method); + public function checkMethodAllowed($obj, $method); - function checkPropertyAllowed($obj, $method); + public function checkPropertyAllowed($obj, $method); } diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index 039c8ca..a078627 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -18,7 +18,7 @@ */ abstract class Twig_Template implements Twig_TemplateInterface { - static protected $cache = array(); + protected static $cache = array(); protected $parent; protected $parents; @@ -447,7 +447,7 @@ abstract class Twig_Template implements Twig_TemplateInterface /** * This method is only useful when testing Twig. Do not use it. */ - static public function clearCache() + public static function clearCache() { self::$cache = array(); } diff --git a/lib/Twig/TemplateInterface.php b/lib/Twig/TemplateInterface.php index 08da116..5d7b027 100644 --- a/lib/Twig/TemplateInterface.php +++ b/lib/Twig/TemplateInterface.php @@ -28,7 +28,7 @@ interface Twig_TemplateInterface * * @return string The rendered template */ - function render(array $context); + public function render(array $context); /** * Displays the template with the given context. @@ -36,12 +36,12 @@ interface Twig_TemplateInterface * @param array $context An array of parameters to pass to the template * @param array $blocks An array of blocks to pass to the template */ - function display(array $context, array $blocks = array()); + public function display(array $context, array $blocks = array()); /** * Returns the bound environment for this template. * * @return Twig_Environment The current environment */ - function getEnvironment(); + public function getEnvironment(); } diff --git a/lib/Twig/Test/IntegrationTestCase.php b/lib/Twig/Test/IntegrationTestCase.php index 3fcf4eb..2973dc5 100644 --- a/lib/Twig/Test/IntegrationTestCase.php +++ b/lib/Twig/Test/IntegrationTestCase.php @@ -129,10 +129,10 @@ abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase $expected = trim($match[3], "\n "); - if ($expected != $output) { + if ($expected != $output) { echo 'Compiled template that failed:'; - foreach (array_keys($templates) as $name) { + foreach (array_keys($templates) as $name) { echo "Template: $name\n"; $source = $loader->getSource($name); echo $twig->compile($twig->parse($twig->tokenize($source, $name))); diff --git a/lib/Twig/TestInterface.php b/lib/Twig/TestInterface.php index c2ff725..96db428 100644 --- a/lib/Twig/TestInterface.php +++ b/lib/Twig/TestInterface.php @@ -22,5 +22,5 @@ interface Twig_TestInterface * * @return string The PHP code for the test */ - function compile(); + public function compile(); } diff --git a/lib/Twig/Token.php b/lib/Twig/Token.php index 1232696..7f58e56 100644 --- a/lib/Twig/Token.php +++ b/lib/Twig/Token.php @@ -126,7 +126,7 @@ class Twig_Token * * @return string The string representation */ - static public function typeToString($type, $short = false, $line = -1) + public static function typeToString($type, $short = false, $line = -1) { switch ($type) { case self::EOF_TYPE: @@ -183,7 +183,7 @@ class Twig_Token * * @return string The string representation */ - static public function typeToEnglish($type, $line = -1) + public static function typeToEnglish($type, $line = -1) { switch ($type) { case self::EOF_TYPE: diff --git a/lib/Twig/TokenParserBrokerInterface.php b/lib/Twig/TokenParserBrokerInterface.php index c2df729..b8e3c23 100644 --- a/lib/Twig/TokenParserBrokerInterface.php +++ b/lib/Twig/TokenParserBrokerInterface.php @@ -27,19 +27,19 @@ interface Twig_TokenParserBrokerInterface * * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found */ - function getTokenParser($tag); + public function getTokenParser($tag); /** * Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of. * * @param Twig_ParserInterface $parser A Twig_ParserInterface interface */ - function setParser(Twig_ParserInterface $parser); + public function setParser(Twig_ParserInterface $parser); /** * Gets the Twig_ParserInterface. * * @return null|Twig_ParserInterface A Twig_ParserInterface instance or null */ - function getParser(); + public function getParser(); } diff --git a/lib/Twig/TokenParserInterface.php b/lib/Twig/TokenParserInterface.php index 192c018..2b6c2ac 100644 --- a/lib/Twig/TokenParserInterface.php +++ b/lib/Twig/TokenParserInterface.php @@ -22,7 +22,7 @@ interface Twig_TokenParserInterface * * @param $parser A Twig_Parser instance */ - function setParser(Twig_Parser $parser); + public function setParser(Twig_Parser $parser); /** * Parses a token and returns a node. @@ -31,12 +31,12 @@ interface Twig_TokenParserInterface * * @return Twig_NodeInterface A Twig_NodeInterface instance */ - function parse(Twig_Token $token); + public function parse(Twig_Token $token); /** * Gets the tag name associated with this token parser. * * @return string The tag name */ - function getTag(); + public function getTag(); } diff --git a/test/Twig/Tests/Extension/SandboxTest.php b/test/Twig/Tests/Extension/SandboxTest.php index b16f9c9..72253c8 100644 --- a/test/Twig/Tests/Extension/SandboxTest.php +++ b/test/Twig/Tests/Extension/SandboxTest.php @@ -11,7 +11,7 @@ class Twig_Tests_Extension_SandboxTest extends PHPUnit_Framework_TestCase { - static protected $params, $templates; + protected static $params, $templates; public function setUp() { @@ -180,11 +180,11 @@ EOF class FooObject { - static public $called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); + public static $called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); public $bar = 'bar'; - static public function reset() + public static function reset() { self::$called = array('__toString' => 0, 'foo' => 0, 'getFooBar' => 0); } diff --git a/test/Twig/Tests/Node/AutoEscapeTest.php b/test/Twig/Tests/Node/AutoEscapeTest.php index 1a5ffd3..608446b 100644 --- a/test/Twig/Tests/Node/AutoEscapeTest.php +++ b/test/Twig/Tests/Node/AutoEscapeTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_AutoEscapeTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/BlockReferenceTest.php b/test/Twig/Tests/Node/BlockReferenceTest.php index b4f545d..96d0e10 100644 --- a/test/Twig/Tests/Node/BlockReferenceTest.php +++ b/test/Twig/Tests/Node/BlockReferenceTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_BlockReferenceTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/BlockTest.php b/test/Twig/Tests/Node/BlockTest.php index f8de55a..024049d 100644 --- a/test/Twig/Tests/Node/BlockTest.php +++ b/test/Twig/Tests/Node/BlockTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_BlockTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/DoTest.php b/test/Twig/Tests/Node/DoTest.php index 6bb992b..a406e22 100644 --- a/test/Twig/Tests/Node/DoTest.php +++ b/test/Twig/Tests/Node/DoTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_DoTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/ForTest.php b/test/Twig/Tests/Node/ForTest.php index 23441fc..f1093b7 100644 --- a/test/Twig/Tests/Node/ForTest.php +++ b/test/Twig/Tests/Node/ForTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_ForTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/IfTest.php b/test/Twig/Tests/Node/IfTest.php index 99b76f8..92fc29d 100644 --- a/test/Twig/Tests/Node/IfTest.php +++ b/test/Twig/Tests/Node/IfTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_IfTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/ImportTest.php b/test/Twig/Tests/Node/ImportTest.php index 99ddeda..db36581 100644 --- a/test/Twig/Tests/Node/ImportTest.php +++ b/test/Twig/Tests/Node/ImportTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_ImportTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/IncludeTest.php b/test/Twig/Tests/Node/IncludeTest.php index e6c2bfa..3b7da6e 100644 --- a/test/Twig/Tests/Node/IncludeTest.php +++ b/test/Twig/Tests/Node/IncludeTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_IncludeTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/MacroTest.php b/test/Twig/Tests/Node/MacroTest.php index 260bd75..28364c3 100644 --- a/test/Twig/Tests/Node/MacroTest.php +++ b/test/Twig/Tests/Node/MacroTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_MacroTest extends Twig_Test_NodeTestCase { /** @@ -55,7 +54,7 @@ public function getfoo(\$foo = null) ob_start(); try { echo "foo"; - } catch(Exception \$e) { + } catch (Exception \$e) { ob_end_clean(); throw \$e; diff --git a/test/Twig/Tests/Node/ModuleTest.php b/test/Twig/Tests/Node/ModuleTest.php index 9ef8d45..dc3e2f1 100644 --- a/test/Twig/Tests/Node/ModuleTest.php +++ b/test/Twig/Tests/Node/ModuleTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_ModuleTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/PrintTest.php b/test/Twig/Tests/Node/PrintTest.php index 1294260..6fe43a4 100644 --- a/test/Twig/Tests/Node/PrintTest.php +++ b/test/Twig/Tests/Node/PrintTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_PrintTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/SandboxTest.php b/test/Twig/Tests/Node/SandboxTest.php index 2ca75ff..db9dbf9 100644 --- a/test/Twig/Tests/Node/SandboxTest.php +++ b/test/Twig/Tests/Node/SandboxTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_SandboxTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/SandboxedModuleTest.php b/test/Twig/Tests/Node/SandboxedModuleTest.php index b944cc3..28fbddf 100644 --- a/test/Twig/Tests/Node/SandboxedModuleTest.php +++ b/test/Twig/Tests/Node/SandboxedModuleTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_SandboxedModuleTest extends Twig_Test_NodeTestCase { /** @@ -83,7 +82,8 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template echo "foo"; } - protected function checkSecurity() { + protected function checkSecurity() + { \$this->env->getExtension('sandbox')->checkSecurity( array('upper'), array('for'), @@ -141,7 +141,8 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); } - protected function checkSecurity() { + protected function checkSecurity() + { \$this->env->getExtension('sandbox')->checkSecurity( array('upper'), array('for'), diff --git a/test/Twig/Tests/Node/SandboxedPrintTest.php b/test/Twig/Tests/Node/SandboxedPrintTest.php index 11fe361..058e02b 100644 --- a/test/Twig/Tests/Node/SandboxedPrintTest.php +++ b/test/Twig/Tests/Node/SandboxedPrintTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_SandboxedPrintTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/SetTest.php b/test/Twig/Tests/Node/SetTest.php index 276e020..d64d671 100644 --- a/test/Twig/Tests/Node/SetTest.php +++ b/test/Twig/Tests/Node/SetTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_SetTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/SpacelessTest.php b/test/Twig/Tests/Node/SpacelessTest.php index a19c010..6735dc3 100644 --- a/test/Twig/Tests/Node/SpacelessTest.php +++ b/test/Twig/Tests/Node/SpacelessTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_SpacelessTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/Node/TextTest.php b/test/Twig/Tests/Node/TextTest.php index 764b12d..6f85576 100644 --- a/test/Twig/Tests/Node/TextTest.php +++ b/test/Twig/Tests/Node/TextTest.php @@ -9,7 +9,6 @@ * file that was distributed with this source code. */ - class Twig_Tests_Node_TextTest extends Twig_Test_NodeTestCase { /** diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index 9c5b909..027b548 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -196,7 +196,7 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase // add twig_template_get_attributes tests if (function_exists('twig_template_get_attributes')) { - foreach(array_slice($tests, 0) as $test) { + foreach (array_slice($tests, 0) as $test) { $test = array_pad($test, 7, null); $test[6] = true; $tests[] = $test; @@ -370,7 +370,7 @@ class Twig_TemplateMethodObject return 'protected'; } - static public function getStatic() + public static function getStatic() { return 'static'; } @@ -379,24 +379,28 @@ class Twig_TemplateMethodObject class Twig_TemplateMethodAndPropObject { private $a = 'a_prop'; - public function getA() { + public function getA() + { return 'a'; } public $b = 'b_prop'; - public function getB() { + public function getB() + { return 'b'; } private $c = 'c_prop'; - private function getC() { + private function getC() + { return 'c'; } } class Twig_TemplateMagicMethodObject { - public function __call($method, $arguments) { + public function __call($method, $arguments) + { return '__call_'.$method; } } diff --git a/test/Twig/Tests/TokenStreamTest.php b/test/Twig/Tests/TokenStreamTest.php index e2a1fbc..4edb8c3 100644 --- a/test/Twig/Tests/TokenStreamTest.php +++ b/test/Twig/Tests/TokenStreamTest.php @@ -11,7 +11,7 @@ class Twig_Tests_TokenStreamTest extends PHPUnit_Framework_TestCase { - static protected $tokens; + protected static $tokens; public function setUp() { -- 1.7.2.5