moved method to function

This commit is contained in:
Fabien Potencier 2017-12-04 10:22:59 -08:00
parent 0829b79c6d
commit 93e136b306
1 changed files with 9 additions and 9 deletions

View File

@ -106,7 +106,7 @@ class FormExtension extends AbstractExtension implements InitRuntimeInterface
{
return array(
new TwigTest('selectedchoice', 'Symfony\Bridge\Twig\Extension\twig_is_selected_choice'),
new TwigTest('rootform', array($this, 'isRootForm')),
new TwigTest('rootform', 'Symfony\Bridge\Twig\Extension\twig_is_root_form'),
);
}
@ -166,14 +166,6 @@ class FormExtension extends AbstractExtension implements InitRuntimeInterface
unset($this->$name);
}
/**
* @internal
*/
public function isRootForm(FormView $formView)
{
return null === $formView->parent;
}
/**
* {@inheritdoc}
*/
@ -202,3 +194,11 @@ function twig_is_selected_choice(ChoiceView $choice, $selectedValue)
return $choice->value === $selectedValue;
}
/**
* @internal
*/
function twig_is_root_form(FormView $formView)
{
return null === $formView->parent;
}