From: Fabien Potencier Date: Wed, 16 Apr 2014 07:47:36 +0000 (+0200) Subject: made usage of return; instead of return null; X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=365feec87e0b2a5bde226a3e12fbae31c320fe0d;p=web%2Fkonrad%2Ftwig.git made usage of return; instead of return null; --- diff --git a/lib/Twig/NodeTraverser.php b/lib/Twig/NodeTraverser.php index aacaf29..8178a55 100644 --- a/lib/Twig/NodeTraverser.php +++ b/lib/Twig/NodeTraverser.php @@ -70,7 +70,7 @@ class Twig_NodeTraverser protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null) { if (null === $node) { - return null; + return; } $node = $visitor->enterNode($node, $this->env); diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index 55c1cdb..168a962 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -326,7 +326,7 @@ abstract class Twig_Template implements Twig_TemplateInterface { if (!array_key_exists($item, $context)) { if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item), -1, $this->getTemplateName()); @@ -371,7 +371,7 @@ abstract class Twig_Template implements Twig_TemplateInterface } if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } if ($object instanceof ArrayAccess) { @@ -396,7 +396,7 @@ abstract class Twig_Template implements Twig_TemplateInterface } if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } throw new Twig_Error_Runtime(sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object), -1, $this->getTemplateName()); @@ -441,7 +441,7 @@ abstract class Twig_Template implements Twig_TemplateInterface } if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { - return null; + return; } throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName()); @@ -461,7 +461,7 @@ abstract class Twig_Template implements Twig_TemplateInterface $ret = call_user_func_array(array($object, $method), $arguments); } catch (BadMethodCallException $e) { if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { - return null; + return; } throw $e; } diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index aa8dafd..b6f5a67 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -585,7 +585,6 @@ class Twig_TemplateMethodObject public function getNull() { - return null; } public function isBar()