Skip to content

Commit 24cfff7

Browse files
committed
Merge pull request #368 from formapro-forks/decouple-from-twig-bundle
Decouple payum bundle from twig bundle.
2 parents df3d8ad + c0785c7 commit 24cfff7

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

DependencyInjection/Compiler/BuildConfigsPass.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
namespace Payum\Bundle\PayumBundle\DependencyInjection\Compiler;
33

4-
use Payum\Core\Exception\LogicException;
54
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
65
use Symfony\Component\DependencyInjection\ContainerBuilder;
76

@@ -23,6 +22,12 @@ public function process(ContainerBuilder $container)
2322
);
2423

2524
$builder = $container->getDefinition('payum.builder');
25+
if ($container->hasDefinition('twig')) {
26+
$config = ['twig.env' => '@twig'];
27+
28+
$builder->addMethodCall('addCoreGatewayFactoryConfig', [$config]);
29+
}
30+
2631
if (false == empty($configs[0])) {
2732
$builder->addMethodCall('addCoreGatewayFactoryConfig', [$configs[0]]);
2833
}

DependencyInjection/PayumExtension.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ protected function loadCoreGateway(array $config, ContainerBuilder $container)
115115
'PayumSymfonyBridge' => dirname((new \ReflectionClass(ReplyToSymfonyResponseConverter::class))->getFileName()).'/Resources/views',
116116
],
117117

118-
'twig.env' => new Reference('twig'),
119-
120118
'payum.action.get_http_request' => new Reference('payum.action.get_http_request'),
121119
'payum.action.obtain_credit_card' => new Reference('payum.action.obtain_credit_card_builder'),
122120
];

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
],
3939
"require": {
4040
"php": "^5.5.0|^7.0",
41-
"payum/core": "^1.3",
41+
"payum/core": "^1.3.3",
4242
"symfony/framework-bundle": "~2.8|~3.0",
43-
"symfony/twig-bundle": "~2.8|~3.0",
4443
"symfony/form": "~2.8|~3.0",
4544
"symfony/validator": "~2.8|~3.0"
4645
},

0 commit comments

Comments
 (0)