Skip to content

Commit

Permalink
merged branch eriksencosta/cs-fixes (PR symfony#3816)
Browse files Browse the repository at this point in the history
Commits
-------

abd59c3 Merge branch 'master' into cs-fixes
f5f0506 [TwigBundle] fixed CS

Discussion
----------

CS fixes
  • Loading branch information
fabpot committed Apr 7, 2012
2 parents d967d39 + abd59c3 commit 0a585b7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Symfony/Bridge/Twig/Extension/FormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ public function renderLabel(FormView $view, $label = null, array $variables = ar
protected function render(FormView $view, $section, array $variables = array())
{
$mainTemplate = in_array($section, array('widget', 'row'));
if ($mainTemplate && $view->isRendered()) {

return '';
if ($mainTemplate && $view->isRendered()) {
return '';
}

if (null === $this->template) {
Expand All @@ -240,7 +240,7 @@ protected function render(FormView $view, $section, array $variables = array())
$types = $view->get('types');
$types[] = $custom;
$typeIndex = count($types) - 1;
$this->varStack[$rendering] = array (
$this->varStack[$rendering] = array(
'variables' => array_replace_recursive($view->all(), $variables),
'types' => $types,
);
Expand All @@ -250,7 +250,6 @@ protected function render(FormView $view, $section, array $variables = array())
$types[$typeIndex] .= '_'.$section;

if (isset($blocks[$types[$typeIndex]])) {

$this->varStack[$rendering]['typeIndex'] = $typeIndex;

// we do not call renderBlock here to avoid too many nested level calls (XDebug limits the level to 100 by default)
Expand Down Expand Up @@ -331,7 +330,6 @@ public function getName()
protected function getBlocks(FormView $view)
{
if (!$this->blocks->contains($view)) {

$rootView = !$view->hasParent();

$templates = $rootView ? $this->resources : array();
Expand All @@ -346,6 +344,7 @@ protected function getBlocks(FormView $view)
if (!$template instanceof \Twig_Template) {
$template = $this->environment->loadTemplate($template);
}

$templateBlocks = array();
do {
$templateBlocks = array_merge($template->getBlocks(), $templateBlocks);
Expand Down

0 comments on commit 0a585b7

Please sign in to comment.