File tree Expand file tree Collapse file tree
DependencyInjection/Compiler Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" >
66
77 <services >
8- <service id =" beelab_recaptcha2.google_recaptcha.request_method" class =" %beelab_recaptcha2.request_method%" />
98 <service id =" beelab_recaptcha2.google_recaptcha" class =" ReCaptcha\ReCaptcha" >
109 <argument >%beelab_recaptcha2.secret%</argument >
11- <argument type = " service " id = " beelab_recaptcha2.google_recaptcha.request_method " / >
10+ <argument /> <!-- replaced by Configuration -- >
1211 </service >
1312 <service id =" Beelab\Recaptcha2Bundle\Recaptcha\SymfonyClientRequestMethod" public =" false" >
1413 <call method =" setClient" >
Original file line number Diff line number Diff line change 22
33namespace Beelab \Recaptcha2Bundle ;
44
5+ use Beelab \Recaptcha2Bundle \DependencyInjection \Compiler \RequestMethodPass ;
56use Beelab \Recaptcha2Bundle \DependencyInjection \Compiler \TwigFormPass ;
67use Symfony \Component \DependencyInjection \ContainerBuilder ;
78use Symfony \Component \HttpKernel \Bundle \Bundle ;
@@ -12,6 +13,7 @@ public function build(ContainerBuilder $container): void
1213 {
1314 parent ::build ($ container );
1415 $ container ->addCompilerPass (new TwigFormPass ());
16+ $ container ->addCompilerPass (new RequestMethodPass ());
1517 }
1618
1719 public function getPath (): string
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Beelab \Recaptcha2Bundle \DependencyInjection \Compiler ;
4+
5+ use Symfony \Component \DependencyInjection \Compiler \CompilerPassInterface ;
6+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
7+
8+ final class RequestMethodPass implements CompilerPassInterface
9+ {
10+ public function process (ContainerBuilder $ container ): void
11+ {
12+ $ service = $ container ->getDefinition ('beelab_recaptcha2.google_recaptcha ' );
13+ $ methodClass = $ container ->getParameter ('beelab_recaptcha2.request_method ' );
14+ $ methodService = $ container ->getDefinition ($ methodClass );
15+ $ service ->replaceArgument (1 , $ methodService );
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments