From 5c52352eb54da189cac63d34569f8093da810aea Mon Sep 17 00:00:00 2001 From: Klein Florian Date: Wed, 3 Oct 2012 16:35:56 +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 6a25257..5ae5752 100644 --- a/Parser/FormTypeParser.php +++ b/Parser/FormTypeParser.php @@ -48,7 +48,7 @@ class FormTypeParser implements ParserInterface { try { if (is_string($item) && class_exists($item)) { - $item = new $item(); + $item = unserialize(sprintf('O:%d:"%s":0:{}', strlen($item), $item)); } $form = $this->formFactory->create($item);