@@ -32,7 +32,7 @@ final class RefundOrderAction
3232{
3333 public function __construct (
3434 private readonly FactoryInterface |StateMachineInterface $ stateMachineFactory ,
35- private readonly PaymentProviderInterface $ paymentProvider ,
35+ private readonly ? PaymentProviderInterface $ paymentProvider ,
3636 private readonly ObjectManager $ paymentManager ,
3737 private readonly PayPalRefundDataProviderInterface $ payPalRefundDataProvider ,
3838 private readonly ?PaypalPaymentQueryInterface $ paypalPaymentQuery = null ,
@@ -48,6 +48,26 @@ public function __construct(
4848 ),
4949 );
5050 }
51+ if (null !== $ this ->paymentProvider ) {
52+ trigger_deprecation (
53+ 'sylius/paypal-plugin ' ,
54+ '1.7 ' ,
55+ sprintf (
56+ 'Passing an instance of "%s" as the second argument is deprecated and will be prohibited in 3.0 ' ,
57+ PaymentProviderInterface::class,
58+ ),
59+ );
60+ }
61+ if (null === $ this ->paypalPaymentQuery ) {
62+ trigger_deprecation (
63+ 'sylius/paypal-plugin ' ,
64+ '1.7 ' ,
65+ sprintf (
66+ 'Not passing an instance of "%s" is deprecated and will be prohibited in 3.0 ' ,
67+ PaypalPaymentQueryInterface::class,
68+ ),
69+ );
70+ }
5171 }
5272
5373 public function __invoke (Request $ request ): Response
0 commit comments