Skip to content

Commit

Permalink
Fix scrutinizer patches.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBrauner committed May 8, 2022
1 parent ef2f170 commit 17a4361
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Braunstetter/valid-form-event/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/Braunstetter/valid-form-event/?branch=main)
[![Code Coverage](https://scrutinizer-ci.com/g/Braunstetter/valid-form-event/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/Braunstetter/valid-form-event/?branch=main)
[![Build Status](https://app.travis-ci.com/Braunstetter/valid-form-event.svg?branch=main)](https://app.travis-ci.com/Braunstetter/valid-form-event)
[![Total Downloads](http://poser.pugx.org/braunstetter/valid-form-event/downloads)](https://packagist.org/packages/braunstetter/valid-form-event)
[![License](http://poser.pugx.org/braunstetter/valid-form-event/license)](https://packagist.org/packages/braunstetter/valid-form-event)

The Symfony documentation recommends keeping logic out of forms and instead doing everything inside a controller.
That's probably good advice most of the time, but exceptions prove the rule.
Expand Down
2 changes: 1 addition & 1 deletion config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Braunstetter\ValidFormEvent\Form\Extension\ValidFormEventTypeExtension;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
return static function(ContainerConfigurator $containerConfigurator): void {

$services = $containerConfigurator->services();

Expand Down
18 changes: 9 additions & 9 deletions src/Form/Extension/ValidFormEventTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ValidFormEventTypeExtension extends AbstractTypeExtension
public function buildForm(FormBuilderInterface $builder, array $options)
{

$builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
$builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) {
$form = $event->getForm();

if ($form->isValid() && $form->isRoot()) {
Expand All @@ -28,12 +28,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)

}

/**
* @inheritDoc
*/
public
static function getExtendedTypes(): iterable
{
return [FormType::class];
}
/**
* @inheritDoc
*/
public
static function getExtendedTypes(): iterable
{
return [FormType::class];
}
}

0 comments on commit 17a4361

Please sign in to comment.