Skip to content

Commit

Permalink
Fixed tests and added composer script for phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Feb 4, 2025
1 parent 57d26ef commit 7fe935a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
],
"auto-index": [
"@php ./vendor/bin/autoindex --exclude=_dev,vendor,tests"
],
"phpstan": [
"@putenv _PS_ROOT_DIR_=../../.",
"@php phpstan analyse -c tests/phpstan/phpstan.neon"
]
},
"author": "PrestaShop"
Expand Down
9 changes: 1 addition & 8 deletions src/Builder/Payload/OrderPayloadBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ class OrderPayloadBuilder extends Builder implements PayloadBuilderInterface
*/
private $paypalOrderId;

/**
* @var bool
*/
private $isPatch;

/**
* @var bool
*/
Expand Down Expand Up @@ -137,12 +132,10 @@ public function setVault($vault)

/**
* @param array $cart
* @param bool $isPatch
*/
public function __construct(array $cart, $isPatch = false)
public function __construct(array $cart)
{
$this->cart = $cart;
$this->isPatch = $isPatch;

parent::__construct();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __invoke(UpdatePayPalOrderCommand $command)
}

$cartPresenter = (new CartPresenter())->present();
$builder = new OrderPayloadBuilder($cartPresenter, true);
$builder = new OrderPayloadBuilder($cartPresenter);
$builder->setIsUpdate(true);
$builder->setPaypalOrderId($command->getPayPalOrderId()->getValue());
$builder->setIsCard($command->getFundingSource() === 'card' && $command->isHostedFields());
Expand Down
3 changes: 3 additions & 0 deletions tests/Unit/PaypalCountryCodeMatriceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/

namespace Tests\Unit;

use PHPUnit\Framework\TestCase;
use PrestaShop\Module\PrestashopCheckout\PaypalCountryCodeMatrice;

Expand Down

0 comments on commit 7fe935a

Please sign in to comment.