Skip to content

Commit

Permalink
feat: fix namespace of new added test-Classes
Browse files Browse the repository at this point in the history
add ContainerAwareInterface and ContainerAwareTrait to support symfony 7
  • Loading branch information
Chris8934 authored and pierredup committed Apr 8, 2024
1 parent 37b5508 commit 5d74dc6
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Builder/CoreGatewayFactoryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Payum\Bundle\PayumBundle\Builder;

use Payum\Bundle\PayumBundle\ContainerAwareCoreGatewayFactory;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareTrait;
use Payum\Core\GatewayFactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

class CoreGatewayFactoryBuilder implements ContainerAwareInterface
{
Expand Down
4 changes: 2 additions & 2 deletions ContainerAwareCoreGatewayFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Payum\Bundle\PayumBundle;

use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareTrait;
use Payum\Core\Bridge\Spl\ArrayObject;
use Payum\Core\CoreGatewayFactory;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

class ContainerAwareCoreGatewayFactory extends CoreGatewayFactory implements ContainerAwareInterface
{
Expand Down
4 changes: 2 additions & 2 deletions ContainerAwareRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Payum\Bundle\PayumBundle;

use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareTrait;
use Payum\Core\Registry\AbstractRegistry;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

/**
* @template T of object
Expand Down
11 changes: 11 additions & 0 deletions DependencyInjection/ContainerAwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Payum\Bundle\PayumBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerInterface;

interface ContainerAwareInterface {

public function setContainer(?ContainerInterface $container);

}
15 changes: 15 additions & 0 deletions DependencyInjection/ContainerAwareTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Payum\Bundle\PayumBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerInterface;

trait ContainerAwareTrait {

protected ?ContainerInterface $container;

public function setContainer(?ContainerInterface $container): void {
$this->container = $container;
}

}
2 changes: 1 addition & 1 deletion Tests/Builder/CoreGatewayFactoryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use Payum\Bundle\PayumBundle\Builder\CoreGatewayFactoryBuilder;
use Payum\Bundle\PayumBundle\ContainerAwareCoreGatewayFactory;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class CoreGatewayFactoryBuilderTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/ContainerAwareCoreGatewayFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use ReflectionClass;
use stdClass;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;

class ContainerAwareCoreGatewayFactoryTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/ContainerAwareRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use ReflectionClass;
use stdClass;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;

class ContainerAwareRegistryTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Command/CreateCaptureTokenCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
namespace Payum\Bundle\PayumBundle\Tests\Functional\Command;

use Payum\Bundle\PayumBundle\Command\CreateCaptureTokenCommand;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase;
use Payum\Core\Registry\RegistryInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class CreateCaptureTokenCommandTest extends WebTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Command/CreateNotifyTokenCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
namespace Payum\Bundle\PayumBundle\Tests\Functional\Command;

use Payum\Bundle\PayumBundle\Command\CreateNotifyTokenCommand;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase;
use Payum\Core\Registry\RegistryInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class CreateNotifyTokenCommandTest extends WebTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Command/DebugGatewayCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
namespace Payum\Bundle\PayumBundle\Tests\Functional\Command;

use Payum\Bundle\PayumBundle\Command\DebugGatewayCommand;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase;
use Payum\Core\Registry\RegistryInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class DebugGatewayCommandTest extends WebTestCase
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/Command/StatusCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
namespace Payum\Bundle\PayumBundle\Tests\Functional\Command;

use Payum\Bundle\PayumBundle\Command\StatusCommand;
use Payum\Bundle\PayumBundle\DependencyInjection\ContainerAwareInterface;
use Payum\Bundle\PayumBundle\Tests\Functional\WebTestCase;
use Payum\Core\Registry\RegistryInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class StatusCommandTest extends WebTestCase
{
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
"symfony/form": "^4.4.20 || ^5.4 || ^6.0 || ^7.0",
"symfony/validator": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/security-csrf": "^4.4 || ^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.4",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.4 || ^7.0",
"symfony/polyfill-php80": "^1.26"
},
"require-dev": {
"defuse/php-encryption": "^2",
"doctrine/orm": "^2.8 || 3.0",
"doctrine/orm": "^2.8 || ^3.0",
"omnipay/common": "^3@dev",
"omnipay/dummy": "^3@alpha",
"omnipay/paypal": "^3@dev",
Expand Down

0 comments on commit 5d74dc6

Please sign in to comment.