|
16 | 16 | use Doctrine\Persistence\ObjectManager; |
17 | 17 | use Sylius\Abstraction\StateMachine\StateMachineInterface; |
18 | 18 | use Sylius\Component\Core\Factory\AddressFactoryInterface; |
| 19 | +use Sylius\Component\Core\Model\AddressInterface; |
19 | 20 | use Sylius\Component\Core\Model\CustomerInterface; |
20 | 21 | use Sylius\Component\Core\Model\PaymentInterface; |
21 | 22 | use Sylius\Component\Core\Model\PaymentMethodInterface; |
22 | 23 | use Sylius\Component\Core\OrderCheckoutTransitions; |
23 | 24 | use Sylius\Component\Core\Repository\CustomerRepositoryInterface; |
24 | | -use Sylius\Component\Resource\Factory\FactoryInterface; |
| 25 | +use Sylius\Resource\Factory\FactoryInterface; |
25 | 26 | use Sylius\PayPalPlugin\Api\CacheAuthorizeClientApiInterface; |
26 | 27 | use Sylius\PayPalPlugin\Api\OrderDetailsApiInterface; |
27 | 28 | use Sylius\PayPalPlugin\Exception\PaymentAmountMismatchException; |
|
34 | 35 |
|
35 | 36 | final readonly class ProcessPayPalOrderAction |
36 | 37 | { |
| 38 | + /** |
| 39 | + * @param CustomerRepositoryInterface<CustomerInterface> $customerRepository |
| 40 | + * @param FactoryInterface<CustomerInterface> $customerFactory |
| 41 | + * @param AddressFactoryInterface<AddressInterface> $addressFactory |
| 42 | + */ |
37 | 43 | public function __construct( |
38 | 44 | private CustomerRepositoryInterface $customerRepository, |
39 | 45 | private FactoryInterface $customerFactory, |
@@ -85,6 +91,7 @@ public function __invoke(Request $request): Response |
85 | 91 |
|
86 | 92 | if ($order->isShippingRequired()) { |
87 | 93 | $name = explode(' ', $purchaseUnit['shipping']['name']['full_name']); |
| 94 | + /** @phpstan-ignore-next-line false positive */ |
88 | 95 | $address->setLastName(array_pop($name) ?? ''); |
89 | 96 | $address->setFirstName(implode(' ', $name)); |
90 | 97 | $address->setStreet($purchaseUnit['shipping']['address']['address_line_1']); |
|
0 commit comments