diff --git a/Action/AuthorizePaymentAction.php b/Action/AuthorizePaymentAction.php index 0978769..77503e2 100644 --- a/Action/AuthorizePaymentAction.php +++ b/Action/AuthorizePaymentAction.php @@ -3,13 +3,17 @@ use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; +use Payum\Core\GatewayAwareInterface; +use Payum\Core\GatewayAwareTrait; use Payum\Core\Model\PaymentInterface; use Payum\Core\Request\Authorize; use Payum\Core\Request\Convert; use Payum\Core\Request\GetHumanStatus; -class AuthorizePaymentAction extends GatewayAwareAction +class AuthorizePaymentAction implements ActionInterface, GatewayAwareInterface { + use GatewayAwareTrait; + /** * {@inheritDoc} * diff --git a/Action/CapturePaymentAction.php b/Action/CapturePaymentAction.php index 60de322..00d0446 100644 --- a/Action/CapturePaymentAction.php +++ b/Action/CapturePaymentAction.php @@ -3,13 +3,17 @@ use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; +use Payum\Core\GatewayAwareInterface; +use Payum\Core\GatewayAwareTrait; use Payum\Core\Model\PaymentInterface; use Payum\Core\Request\Capture; use Payum\Core\Request\Convert; use Payum\Core\Request\GetHumanStatus; -class CapturePaymentAction extends GatewayAwareAction +class CapturePaymentAction implements ActionInterface, GatewayAwareInterface { + use GatewayAwareTrait; + /** * {@inheritDoc} * diff --git a/Action/ExecuteSameRequestWithModelDetailsAction.php b/Action/ExecuteSameRequestWithModelDetailsAction.php index 612331d..992b180 100644 --- a/Action/ExecuteSameRequestWithModelDetailsAction.php +++ b/Action/ExecuteSameRequestWithModelDetailsAction.php @@ -3,13 +3,17 @@ use Payum\Core\Bridge\Spl\ArrayObject; use Payum\Core\Exception\RequestNotSupportedException; +use Payum\Core\GatewayAwareInterface; +use Payum\Core\GatewayAwareTrait; use Payum\Core\Model\DetailsAggregateInterface; use Payum\Core\Model\DetailsAwareInterface; use Payum\Core\Model\ModelAggregateInterface; use Payum\Core\Model\ModelAwareInterface; -class ExecuteSameRequestWithModelDetailsAction extends GatewayAwareAction +class ExecuteSameRequestWithModelDetailsAction implements ActionInterface, GatewayAwareInterface { + use GatewayAwareTrait; + /** * {@inheritDoc} * diff --git a/Action/GetCurrencyAction.php b/Action/GetCurrencyAction.php index bf60ac4..bca6aa2 100644 --- a/Action/GetCurrencyAction.php +++ b/Action/GetCurrencyAction.php @@ -5,7 +5,7 @@ use Payum\Core\Request\GetCurrency; use Payum\ISO4217\ISO4217; -class GetCurrencyAction extends GatewayAwareAction +class GetCurrencyAction implements ActionInterface { /** * @var ISO4217 diff --git a/Action/GetTokenAction.php b/Action/GetTokenAction.php index 85d473c..3b3a0f6 100644 --- a/Action/GetTokenAction.php +++ b/Action/GetTokenAction.php @@ -6,7 +6,7 @@ use Payum\Core\Request\GetToken; use Payum\Core\Storage\StorageInterface; -class GetTokenAction extends GatewayAwareAction +class GetTokenAction implements ActionInterface { /** * @var StorageInterface diff --git a/Bridge/Symfony/Action/ObtainCreditCardAction.php b/Bridge/Symfony/Action/ObtainCreditCardAction.php index 85811e4..914ec4d 100644 --- a/Bridge/Symfony/Action/ObtainCreditCardAction.php +++ b/Bridge/Symfony/Action/ObtainCreditCardAction.php @@ -1,11 +1,13 @@ actionClass); - $this->assertTrue($rc->isSubclassOf('Payum\Core\Action\GatewayAwareAction')); + $this->assertTrue($rc->implementsInterface(GatewayAwareInterface::class)); } /** diff --git a/Tests/Action/GatewayAwareActionTest.php b/Tests/Action/GatewayAwareActionTest.php index 9d5ec2b..9efb570 100644 --- a/Tests/Action/GatewayAwareActionTest.php +++ b/Tests/Action/GatewayAwareActionTest.php @@ -1,6 +1,11 @@ assertTrue($rc->implementsInterface('Payum\Core\Action\ActionInterface')); + $this->assertTrue($rc->implementsInterface(ActionInterface::class)); } /** @@ -18,9 +23,9 @@ public function shouldImplementActionInterface() */ public function shouldImplementGatewayAwareInterface() { - $rc = new \ReflectionClass('Payum\Core\Action\GatewayAwareAction'); + $rc = new \ReflectionClass(GatewayAwareAction::class); - $this->assertTrue($rc->implementsInterface('Payum\Core\GatewayAwareInterface')); + $this->assertTrue($rc->implementsInterface(GatewayAwareInterface::class)); } /** @@ -28,9 +33,9 @@ public function shouldImplementGatewayAwareInterface() */ public function shouldSetGatewayToProperty() { - $gateway = $this->getMock('Payum\Core\GatewayInterface'); + $gateway = $this->getMock(GatewayInterface::class); - $action = $this->getMockForAbstractClass('Payum\Core\Action\GatewayAwareAction'); + $action = $this->getMockForAbstractClass(GatewayAwareAction::class); $action->setGateway($gateway); diff --git a/Tests/Bridge/Symfony/Action/ObtainCreditCardActionTest.php b/Tests/Bridge/Symfony/Action/ObtainCreditCardActionTest.php index 8a785f5..b7c447e 100644 --- a/Tests/Bridge/Symfony/Action/ObtainCreditCardActionTest.php +++ b/Tests/Bridge/Symfony/Action/ObtainCreditCardActionTest.php @@ -4,6 +4,7 @@ use Payum\Core\Bridge\Symfony\Action\ObtainCreditCardAction; use Payum\Core\Bridge\Symfony\Form\Type\CreditCardType; use Payum\Core\Bridge\Symfony\Reply\HttpResponse; +use Payum\Core\GatewayAwareInterface; use Payum\Core\Model\CreditCard; use Payum\Core\GatewayInterface; use Payum\Core\Request\ObtainCreditCard; @@ -18,11 +19,11 @@ class ObtainCreditCardActionTest extends \PHPUnit_Framework_TestCase /** * @test */ - public function shouldBeSubClassOfGatewayAwareAction() + public function shouldImplementGatewayAwareInterface() { - $rc = new \ReflectionClass('Payum\Core\Bridge\Symfony\Action\ObtainCreditCardAction'); + $rc = new \ReflectionClass(ObtainCreditCardAction::class); - $this->assertTrue($rc->isSubclassOf('Payum\Core\Action\GatewayAwareAction')); + $this->assertTrue($rc->implementsInterface(GatewayAwareInterface::class)); } /** diff --git a/Tests/Mocks/Action/CaptureAction.php b/Tests/Mocks/Action/CaptureAction.php index ca2e4e3..233ff5b 100644 --- a/Tests/Mocks/Action/CaptureAction.php +++ b/Tests/Mocks/Action/CaptureAction.php @@ -1,13 +1,17 @@