From f9d4fb90cd70f12f0e883031de716394edd49cd2 Mon Sep 17 00:00:00 2001 From: Klein Florian Date: Wed, 3 Oct 2012 16:39:07 +0200 Subject: [PATCH] allow to pass classes wich have constructor arguments --- Parser/FormTypeParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parser/FormTypeParser.php b/Parser/FormTypeParser.php index 5ae5752..43f815d 100644 --- a/Parser/FormTypeParser.php +++ b/Parser/FormTypeParser.php @@ -65,7 +65,7 @@ class FormTypeParser implements ParserInterface public function parse($type) { if (is_string($type) && class_exists($type)) { - $type = new $type(); + $item = unserialize(sprintf('O:%d:"%s":0:{}', strlen($item), $item)); } $form = $this->formFactory->create($type);