mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 20:36:33 +00:00
made usage of return; instead of return null;
This commit is contained in:
@@ -70,7 +70,7 @@ class Twig_NodeTraverser
|
|||||||
protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null)
|
protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null)
|
||||||
{
|
{
|
||||||
if (null === $node) {
|
if (null === $node) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$node = $visitor->enterNode($node, $this->env);
|
$node = $visitor->enterNode($node, $this->env);
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|||||||
{
|
{
|
||||||
if (!array_key_exists($item, $context)) {
|
if (!array_key_exists($item, $context)) {
|
||||||
if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
|
if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item), -1, $this->getTemplateName());
|
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()) {
|
if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object instanceof ArrayAccess) {
|
if ($object instanceof ArrayAccess) {
|
||||||
@@ -396,7 +396,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
|
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());
|
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()) {
|
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());
|
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);
|
$ret = call_user_func_array(array($object, $method), $arguments);
|
||||||
} catch (BadMethodCallException $e) {
|
} catch (BadMethodCallException $e) {
|
||||||
if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
|
if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -585,7 +585,6 @@ class Twig_TemplateMethodObject
|
|||||||
|
|
||||||
public function getNull()
|
public function getNull()
|
||||||
{
|
{
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isBar()
|
public function isBar()
|
||||||
|
|||||||
Reference in New Issue
Block a user