made usage of return; instead of return null;

This commit is contained in:
Fabien Potencier
2014-04-16 09:47:36 +02:00
parent 81699ca6ca
commit 365feec87e
3 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -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);
+5 -5
View File
@@ -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;
}
-1
View File
@@ -585,7 +585,6 @@ class Twig_TemplateMethodObject
public function getNull()
{
return null;
}
public function isBar()