From 2523586ba6ab217d58e69cad4983c210a2190e85 Mon Sep 17 00:00:00 2001 From: Matej Velikonja Date: Tue, 2 Jun 2015 13:40:23 +0200 Subject: [PATCH 1/3] SF 2.7 deprecation fix Like proposed here https://github.com/symfony/symfony/issues/14687 --- Resources/config/attachment.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Resources/config/attachment.xml b/Resources/config/attachment.xml index 38695b9..454de90 100644 --- a/Resources/config/attachment.xml +++ b/Resources/config/attachment.xml @@ -42,7 +42,8 @@ %infinite_form.attachment.default_secret% - + + %infinite_form.attachment.entity_manager% From a91e94704dc47fc1b59a006a90c5bd06b181b307 Mon Sep 17 00:00:00 2001 From: matejvelikonja Date: Tue, 2 Jun 2015 20:30:45 +0200 Subject: [PATCH 2/3] non BC without deprecations --- DependencyInjection/InfiniteFormExtension.php | 10 ++++++++++ Resources/config/attachment.xml | 3 ++- phpunit.xml.dist | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/InfiniteFormExtension.php b/DependencyInjection/InfiniteFormExtension.php index 975e0db..76b444c 100644 --- a/DependencyInjection/InfiniteFormExtension.php +++ b/DependencyInjection/InfiniteFormExtension.php @@ -12,6 +12,7 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\DependencyInjection\Extension; /** @@ -47,5 +48,14 @@ public function load(array $configs, ContainerBuilder $container) if ($configs['twig']) { $loader->load('twig.xml'); } + + $attachmentDefinition = $container->getDefinition('infinite_form.attachment.form_type'); + + if (method_exists($attachmentDefinition, 'setFactory')) { + $attachmentDefinition->setFactory(array(new Reference('doctrine'), 'getManager')); + } else { + $attachmentDefinition->setFactoryService('doctrine'); + $attachmentDefinition->setFactoryMethod('getManager'); + } } } diff --git a/Resources/config/attachment.xml b/Resources/config/attachment.xml index 454de90..dbe90c4 100644 --- a/Resources/config/attachment.xml +++ b/Resources/config/attachment.xml @@ -43,7 +43,8 @@ %infinite_form.attachment.default_secret% - + + %infinite_form.attachment.entity_manager% diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 766bb76..ff625ab 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,6 +12,9 @@ syntaxCheck = "false"> + + + From ce1d41d5355d943089e8e1194d4f511fd955728d Mon Sep 17 00:00:00 2001 From: matejvelikonja Date: Wed, 3 Jun 2015 09:04:28 +0200 Subject: [PATCH 3/3] reverted error reporting --- phpunit.xml.dist | 3 --- 1 file changed, 3 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ff625ab..766bb76 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,9 +12,6 @@ syntaxCheck = "false"> - - -