Skip to content

Commit

Permalink
PHPStan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Feb 13, 2024
1 parent 06e19c1 commit 9deda5b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 25 deletions.
9 changes: 2 additions & 7 deletions src/Handler/CreatePaypalOrderHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@
use Module;
use PrestaShop\Module\PrestashopCheckout\Api\Payment\Order;
use PrestaShop\Module\PrestashopCheckout\Builder\Payload\OrderPayloadBuilder;
use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext;
use PrestaShop\Module\PrestashopCheckout\DTO\Orders\CreatePayPalOrderRequest;
use PrestaShop\Module\PrestashopCheckout\DTO\Orders\CreatePayPalOrderResponse;
use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderHttpClientInterface;
use PrestaShop\Module\PrestashopCheckout\Presenter\Cart\CartPresenter;
use PrestaShop\Module\PrestashopCheckout\ShopContext;
use Ps_checkout;
Expand All @@ -40,11 +35,11 @@ class CreatePaypalOrderHandler
/**
* Prestashop context object
*
* @var PrestaShopContext
* @var Context
*/
private $context;

public function __construct(\Context $context)
public function __construct(Context $context)
{
$this->context = $context;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@

use PrestaShop\Module\PrestashopCheckout\Cart\CartRepositoryInterface;
use PrestaShop\Module\PrestashopCheckout\Cart\Exception\CartNotFoundException;
use PrestaShop\Module\PrestashopCheckout\Context\PrestaShopContext;
use PrestaShop\Module\PrestashopCheckout\Event\EventDispatcherInterface;
use PrestaShop\Module\PrestashopCheckout\Handler\CreatePaypalOrderHandler;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Command\CreatePayPalOrderCommand;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\CreatePayPalOrderPayloadBuilderInterface;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Event\PayPalOrderCreatedEvent;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\PayPalOrderHttpClientInterface;

class CreatePayPalOrderCommandHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order;

use PrestaShop\Module\PrestashopCheckout\Cart\CartInterface;
use PrestaShop\Module\PrestashopCheckout\DTO\Orders\CreatePayPalOrderRequest;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO\CreatePayPalOrderRequest;


interface CreatePayPalOrderPayloadBuilderInterface
{
Expand Down
15 changes: 2 additions & 13 deletions src/PayPal/Order/PayPalOrderHttpClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@

namespace PrestaShop\Module\PrestashopCheckout\PayPal\Order;

use PrestaShop\Module\PrestashopCheckout\DTO\Orders\CreatePayPalOrderRequest;
use PrestaShop\Module\PrestashopCheckout\DTO\Orders\CreatePayPalOrderResponse;
use PrestaShop\Module\PrestashopCheckout\DTO\Orders\PatchPayPalOrderRequest;
use PrestaShop\Module\PrestashopCheckout\DTO\Orders\PatchPayPalOrderResponse;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO\CreatePayPalOrderRequest;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\DTO\CreatePayPalOrderResponse;
use PrestaShop\Module\PrestashopCheckout\PayPal\Order\Exception\PayPalOrderException;

interface PayPalOrderHttpClientInterface
Expand All @@ -36,13 +34,4 @@ interface PayPalOrderHttpClientInterface
* @throws PayPalOrderException
*/
public function createOrder(CreatePayPalOrderRequest $payload);

/**
* @param PatchPayPalOrderRequest $payload
*
* @return PatchPayPalOrderResponse
*
* @throws PayPalOrderException
*/
public function patchOrder(PatchPayPalOrderRequest $payload);
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(CacheInterface $orderCache, PsCheckoutCartRepository
*/
public function handle(GetPayPalOrderQuery $query)
{
$orderId = $query->getOrderId() ? $query->getOrderId()->getValue() : null;
$orderId = !$query->getOrderId()->getValue() ? null : $query->getOrderId()->getValue();

if (!$orderId) {
$psCheckoutCart = $this->checkoutCartRepository->findOneByCartId($query->getCartId()->getValue());
Expand Down

0 comments on commit 9deda5b

Please sign in to comment.