mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Fix service definition and use state machine absctraction
This commit is contained in:
parent
166e1a97da
commit
b9b3cd2b2d
2 changed files with 15 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\PaymentBundle\Processor;
|
||||
|
||||
use SM\Factory\FactoryInterface as StateMachineFactoryInterface;
|
||||
use Sylius\Abstraction\StateMachine\StateMachineInterface;
|
||||
use Sylius\Component\Payment\Model\PaymentRequestInterface;
|
||||
use Sylius\Component\Payment\PaymentTransitions;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
|
@ -21,8 +22,19 @@ use Webmozart\Assert\Assert;
|
|||
final class AfterOfflineCaptureProcessor implements AfterOfflineCaptureProcessorInterface
|
||||
{
|
||||
public function __construct(
|
||||
private StateMachineFactoryInterface $stateMachineFactory,
|
||||
private StateMachineFactoryInterface|StateMachineInterface $stateMachineFactory,
|
||||
) {
|
||||
if ($this->stateMachineFactory instanceof StateMachineFactoryInterface) {
|
||||
trigger_deprecation(
|
||||
'sylius/payment-bundle',
|
||||
'1.13',
|
||||
sprintf(
|
||||
'Passing an instance of "%s" as the first argument is deprecated. It will accept only instances of "%s" in Sylius 2.0.',
|
||||
StateMachineFactoryInterface::class,
|
||||
StateMachineInterface::class,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function process(PaymentRequestInterface $paymentRequest): void
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@
|
|||
</service>
|
||||
|
||||
<service id="Sylius\Bundle\PaymentBundle\Processor\OfflineCaptureProcessorInterface" class="Sylius\Bundle\PaymentBundle\Processor\OfflineCaptureProcessor" />
|
||||
|
||||
<service id="Sylius\Bundle\PaymentBundle\Processor\AfterOfflineCaptureProcessorInterface" class="Sylius\Bundle\PaymentBundle\Processor\AfterOfflineCaptureProcessor">
|
||||
<argument tag="service" id="sm.factory" />
|
||||
<argument type="service" id="sylius_abstraction.state_machine" />
|
||||
</service>
|
||||
|
||||
</services>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue