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

Commit 8133866

Browse files
committed
Fixed coding standards
1 parent 2e436ca commit 8133866

20 files changed

Lines changed: 419 additions & 467 deletions

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ class ContactFormExtension extends Extension
547547
// ...
548548
```
549549
550-
The form type class itself uses the injected service this way:
550+
The form type class itself uses the injected service this way:
551551
552552
``` php
553553
<?php
@@ -559,9 +559,7 @@ use Symfony\Component\Form\FormBuilderInterface;
559559
560560
class ContactType extends AbstractType
561561
{
562-
/**
563-
* @var FormBuilderInterface
564-
*/
562+
/** @var FormBuilderInterface */
565563
private $recaptcha;
566564
567565
public function __construct(?FormBuilderInterface $recaptcha)
@@ -578,4 +576,4 @@ class ContactType extends AbstractType
578576
// ...
579577
}
580578
581-
```
579+
```

src/DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ private function addHttpClientConfiguration(ArrayNodeDefinition $node)
6767
;
6868
}
6969

70-
private function addServiceDefinitionConfiguration(ArrayNodeDefinition $node) {
70+
private function addServiceDefinitionConfiguration(ArrayNodeDefinition $node)
71+
{
7172
$node
7273
->children()
7374
->arrayNode('service_definition')

src/DependencyInjection/EWZRecaptchaExtension.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
namespace EWZ\Bundle\RecaptchaBundle\DependencyInjection;
44

5-
use EWZ\Bundle\RecaptchaBundle\DependencyInjection\CompilerPass\WidgetCompilerPass;
6-
use EWZ\Bundle\RecaptchaBundle\Resolver\WidgetResolver;
75
use EWZ\Bundle\RecaptchaBundle\Factory\EWZRecaptchaV2FormBuilderFactory;
86
use EWZ\Bundle\RecaptchaBundle\Factory\EWZRecaptchaV3FormBuilderFactory;
97
use Symfony\Component\Config\FileLocator;
108
use Symfony\Component\DependencyInjection\ContainerBuilder;
119
use Symfony\Component\DependencyInjection\Loader;
1210
use Symfony\Component\DependencyInjection\Reference;
13-
use Symfony\Component\Form\FormBuilder;
1411
use Symfony\Component\Form\FormBuilderInterface;
1512
use Symfony\Component\Form\FormFactoryInterface;
1613
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
@@ -20,7 +17,6 @@
2017
*/
2118
class EWZRecaptchaExtension extends Extension
2219
{
23-
2420
/**
2521
* {@inheritdoc}
2622
*/
@@ -51,14 +47,13 @@ public function load(array $configs, ContainerBuilder $container)
5147
->addArgument(new Reference(FormFactoryInterface::class));
5248
}
5349

54-
foreach($config['service_definition'] as $serviceDefinition) {
55-
$container->register('ewz_recaptcha.' . $serviceDefinition['service_name'], FormBuilderInterface::class)
50+
foreach ($config['service_definition'] as $serviceDefinition) {
51+
$container->register('ewz_recaptcha.'.$serviceDefinition['service_name'], FormBuilderInterface::class)
5652
->setFactory(array(
5753
new Reference('ewz_recaptcha.form_builder_factory'),
58-
'get'))
54+
'get', ))
5955
->setArguments([$serviceDefinition['options']]);
6056
}
61-
6257
}
6358

6459
/**

src/EWZRecaptchaBundle.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22

33
namespace EWZ\Bundle\RecaptchaBundle;
44

5-
use EWZ\Bundle\RecaptchaBundle\DependencyInjection\CompilerPass\WidgetCompilerPass;
6-
use EWZ\Bundle\RecaptchaBundle\Resolver\WidgetResolver;
7-
use Symfony\Component\DependencyInjection\ContainerBuilder;
85
use Symfony\Component\HttpKernel\Bundle\Bundle;
96

107
class EWZRecaptchaBundle extends Bundle
118
{
12-
139
}

src/Extension/ReCaptcha/RequestMethod/Post.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ class Post implements RequestMethod
2424
*/
2525
private $timeout;
2626

27-
/**
28-
* @var array
29-
*/
27+
/** @var array */
3028
private $cache;
3129

3230
/**

src/Extension/ReCaptcha/RequestMethod/ProxyPost.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ class ProxyPost implements RequestMethod
3131
*/
3232
private $timeout;
3333

34-
/**
35-
* @var array
36-
*/
34+
/** @var array */
3735
private $cache;
3836

3937
/**
Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
<?php
2-
3-
namespace EWZ\Bundle\RecaptchaBundle\Factory;
4-
5-
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
6-
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue;
7-
use Symfony\Component\Form\FormFactoryInterface;
8-
9-
class EWZRecaptchaV2FormBuilderFactory
10-
{
11-
12-
private $builder;
13-
14-
public function __construct(FormFactoryInterface $builder)
15-
{
16-
$this->builder = $builder;
17-
}
18-
19-
public function get()
20-
{
21-
return $this->builder->createBuilder(EWZRecaptchaType::class, null, [
22-
'constraints' => array(
23-
new IsTrue()
24-
)
25-
]);
26-
}
27-
28-
}
1+
<?php
2+
3+
namespace EWZ\Bundle\RecaptchaBundle\Factory;
4+
5+
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaType;
6+
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrue;
7+
use Symfony\Component\Form\FormFactoryInterface;
8+
9+
class EWZRecaptchaV2FormBuilderFactory
10+
{
11+
private $builder;
12+
13+
public function __construct(FormFactoryInterface $builder)
14+
{
15+
$this->builder = $builder;
16+
}
17+
18+
public function get()
19+
{
20+
return $this->builder->createBuilder(EWZRecaptchaType::class, null, [
21+
'constraints' => array(
22+
new IsTrue(),
23+
),
24+
]);
25+
}
26+
}
Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
1-
<?php
2-
3-
namespace EWZ\Bundle\RecaptchaBundle\Factory;
4-
5-
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaV3Type;
6-
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrueV3;
7-
use Symfony\Component\Form\FormFactoryInterface;
8-
9-
class EWZRecaptchaV3FormBuilderFactory
10-
{
11-
12-
private $builder;
13-
14-
public function __construct(FormFactoryInterface $builder)
15-
{
16-
$this->builder = $builder;
17-
}
18-
19-
public function get(array $options = array())
20-
{
21-
$constraint = array(
22-
'constraints' => array(
23-
new IsTrueV3()
24-
));
25-
26-
return $this->builder->createBuilder(EWZRecaptchaV3Type::class, null, array_merge($options, $constraint)
27-
);
28-
}
29-
30-
}
1+
<?php
2+
3+
namespace EWZ\Bundle\RecaptchaBundle\Factory;
4+
5+
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaV3Type;
6+
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrueV3;
7+
use Symfony\Component\Form\FormFactoryInterface;
8+
9+
class EWZRecaptchaV3FormBuilderFactory
10+
{
11+
private $builder;
12+
13+
public function __construct(FormFactoryInterface $builder)
14+
{
15+
$this->builder = $builder;
16+
}
17+
18+
public function get(array $options = array())
19+
{
20+
$constraint = array(
21+
'constraints' => array(
22+
new IsTrueV3(),
23+
), );
24+
25+
return $this->builder->createBuilder(EWZRecaptchaV3Type::class, null, array_merge($options, $constraint)
26+
);
27+
}
28+
}

0 commit comments

Comments
 (0)