mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[Component/Core] Change parameter order in OrderPaymentProcessor class
This commit is contained in:
parent
14194a463c
commit
8ffcacd67a
4 changed files with 18 additions and 5 deletions
|
|
@ -73,6 +73,17 @@
|
|||
|
||||
* The `\Serializable` interface has been removed from the `Sylius\Component\User\Model\UserInterface`.
|
||||
|
||||
* The parameter order of the `Sylius\Component\Core\OrderProcessing\OrderPaymentProcessor::__construct` has been changed:
|
||||
```php
|
||||
public function __construct(
|
||||
private OrderPaymentProviderInterface $orderPaymentProvider,
|
||||
- private string $targetState = PaymentInterface::STATE_CART,
|
||||
private OrderPaymentsRemoverInterface $orderPaymentsRemover,
|
||||
private array $unprocessableOrderStates,
|
||||
+ private string $targetState = PaymentInterface::STATE_CART,
|
||||
)
|
||||
```
|
||||
|
||||
## Frontend
|
||||
|
||||
* `use_webpack` option was removed from the `sylius_ui` configuration, and the Webpack has become the only module bundler provided by Sylius.
|
||||
|
|
|
|||
|
|
@ -70,16 +70,16 @@
|
|||
|
||||
<service id="sylius.order_processing.order_payment_processor.checkout" class="Sylius\Component\Core\OrderProcessing\OrderPaymentProcessor">
|
||||
<argument type="service" id="sylius.order_payment_provider" />
|
||||
<argument>cart</argument>
|
||||
<argument type="service" id="Sylius\Component\Core\Payment\Remover\OrderPaymentsRemoverInterface" />
|
||||
<argument>%sylius.order_payment_processor.checkout.unsupported_states%</argument>
|
||||
<argument>cart</argument>
|
||||
<tag name="sylius.order_processor" priority="0"/>
|
||||
</service>
|
||||
<service id="sylius.order_processing.order_payment_processor.after_checkout" class="Sylius\Component\Core\OrderProcessing\OrderPaymentProcessor">
|
||||
<argument type="service" id="sylius.order_payment_provider" />
|
||||
<argument>new</argument>
|
||||
<argument type="service" id="Sylius\Component\Core\Payment\Remover\OrderPaymentsRemoverInterface" />
|
||||
<argument>%sylius.order_payment_processor.after_checkout.unsupported_states%</argument>
|
||||
<argument>new</argument>
|
||||
</service>
|
||||
</services>
|
||||
</container>
|
||||
|
|
|
|||
|
|
@ -24,12 +24,14 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class OrderPaymentProcessor implements OrderProcessorInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string> $unprocessableOrderStates
|
||||
*/
|
||||
public function __construct(
|
||||
private OrderPaymentProviderInterface $orderPaymentProvider,
|
||||
private string $targetState = PaymentInterface::STATE_CART,
|
||||
private OrderPaymentsRemoverInterface $orderPaymentsRemover,
|
||||
/** @var array<string> $unprocessableOrderStates */
|
||||
private array $unprocessableOrderStates,
|
||||
private string $targetState = PaymentInterface::STATE_CART,
|
||||
) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ final class OrderPaymentProcessorSpec extends ObjectBehavior
|
|||
): void {
|
||||
$this->beConstructedWith(
|
||||
$orderPaymentProvider,
|
||||
PaymentInterface::STATE_CART,
|
||||
$orderPaymentsRemover,
|
||||
[
|
||||
OrderInterface::STATE_FULFILLED,
|
||||
],
|
||||
PaymentInterface::STATE_CART,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue