From 754d571eb117bb7390d402eea1f07cb6c0f061fe Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Fri, 25 Aug 2017 07:44:00 +0200 Subject: [PATCH 1/2] removed class construction for sub-types --- Form/Type/CompletionType.php | 2 +- Form/Type/ProfileContactAddressType.php | 2 +- Form/Type/RegistrationType.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Form/Type/CompletionType.php b/Form/Type/CompletionType.php index 1d674a38..459f0acd 100644 --- a/Form/Type/CompletionType.php +++ b/Form/Type/CompletionType.php @@ -41,7 +41,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) $builder->add( 'contact', - new $options['contact_type'](), + $options['contact_type'], array_merge( $options['contact_type_options'], [ diff --git a/Form/Type/ProfileContactAddressType.php b/Form/Type/ProfileContactAddressType.php index 10814872..ab8e3c71 100644 --- a/Form/Type/ProfileContactAddressType.php +++ b/Form/Type/ProfileContactAddressType.php @@ -24,7 +24,7 @@ class ProfileContactAddressType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('address', new $options['address_type'](), $options['address_type_options']); + $builder->add('address', $options['address_type'], $options['address_type_options']); $builder->add('main', HiddenType::class, [ 'required' => false, 'data' => 1, diff --git a/Form/Type/RegistrationType.php b/Form/Type/RegistrationType.php index a5a37218..8bf1de43 100644 --- a/Form/Type/RegistrationType.php +++ b/Form/Type/RegistrationType.php @@ -47,7 +47,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) $builder->add( 'contact', - new $options['contact_type'](), + $options['contact_type'], $options['contact_type_options'] ); From 7d13241720a8e77edda5225bad8e00f9c4da6f7c Mon Sep 17 00:00:00 2001 From: Johannes Wachter Date: Fri, 25 Aug 2017 11:59:48 +0200 Subject: [PATCH 2/2] updated docs --- Resources/doc/11-completion.md | 2 +- Resources/doc/5-registration.md | 2 +- Resources/doc/9-profile.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Resources/doc/11-completion.md b/Resources/doc/11-completion.md index 53c0be6d..eebadadd 100644 --- a/Resources/doc/11-completion.md +++ b/Resources/doc/11-completion.md @@ -131,7 +131,7 @@ class CompletionType extends AbstractType $builder->add( 'contact', - new $options['contact_type'](), + $options['contact_type'], array_merge( $options['contact_type_options'], [ diff --git a/Resources/doc/5-registration.md b/Resources/doc/5-registration.md index 08229437..6f0ff160 100644 --- a/Resources/doc/5-registration.md +++ b/Resources/doc/5-registration.md @@ -102,7 +102,7 @@ class RegistrationType extends AbstractType $builder->add( 'contact', - new $options['contact_type'](), + $options['contact_type'], $options['contact_type_options'] ); diff --git a/Resources/doc/9-profile.md b/Resources/doc/9-profile.md index d7dce3eb..a1d21499 100644 --- a/Resources/doc/9-profile.md +++ b/Resources/doc/9-profile.md @@ -259,7 +259,7 @@ class ProfileContactAddressType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('address', new $options['address_type'](), $options['address_type_options']); + $builder->add('address', $options['address_type'], $options['address_type_options']); $builder->add('main', 'hidden', [ 'required' => false, 'data' => 1,