Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Commit 3219e7a

Browse files
authored
Merge pull request #196 from someniatko/master
Check for the twig.form.resources parameter existence
2 parents ae542b3 + 419c49e commit 3219e7a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/DependencyInjection/EWZRecaptchaExtension.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,17 @@ protected function registerWidget(ContainerBuilder $container)
5050
$formRessource = 'EWZRecaptchaBundle:Form:ewz_recaptcha_widget.html.twig';
5151

5252
$container->setParameter('twig.form.resources', array_merge(
53-
$container->getParameter('twig.form.resources'),
53+
$this->getTwigFormResources($container),
5454
array($formRessource)
5555
));
5656
}
5757
}
58+
59+
private function getTwigFormResources(ContainerBuilder $container)
60+
{
61+
if (!$container->hasParameter('twig.form.resources'))
62+
return [];
63+
64+
return $container->getParameter('twig.form.resources');
65+
}
5866
}

0 commit comments

Comments
 (0)