Skip to content

Commit

Permalink
Merge pull request #368 from formapro-forks/decouple-from-twig-bundle
Browse files Browse the repository at this point in the history
Decouple payum bundle from twig bundle.
  • Loading branch information
makasim committed May 31, 2016
2 parents df3d8ad + c0785c7 commit 24cfff7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 6 additions & 1 deletion DependencyInjection/Compiler/BuildConfigsPass.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
namespace Payum\Bundle\PayumBundle\DependencyInjection\Compiler;

use Payum\Core\Exception\LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

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

$builder = $container->getDefinition('payum.builder');
if ($container->hasDefinition('twig')) {
$config = ['twig.env' => '@twig'];

$builder->addMethodCall('addCoreGatewayFactoryConfig', [$config]);
}

if (false == empty($configs[0])) {
$builder->addMethodCall('addCoreGatewayFactoryConfig', [$configs[0]]);
}
Expand Down
2 changes: 0 additions & 2 deletions DependencyInjection/PayumExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ protected function loadCoreGateway(array $config, ContainerBuilder $container)
'PayumSymfonyBridge' => dirname((new \ReflectionClass(ReplyToSymfonyResponseConverter::class))->getFileName()).'/Resources/views',
],

'twig.env' => new Reference('twig'),

'payum.action.get_http_request' => new Reference('payum.action.get_http_request'),
'payum.action.obtain_credit_card' => new Reference('payum.action.obtain_credit_card_builder'),
];
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
],
"require": {
"php": "^5.5.0|^7.0",
"payum/core": "^1.3",
"payum/core": "^1.3.3",
"symfony/framework-bundle": "~2.8|~3.0",
"symfony/twig-bundle": "~2.8|~3.0",
"symfony/form": "~2.8|~3.0",
"symfony/validator": "~2.8|~3.0"
},
Expand Down

0 comments on commit 24cfff7

Please sign in to comment.