Skip to content

Commit

Permalink
fix pint
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Jul 8, 2024
1 parent 71b281d commit c5e34a5
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Drivers/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

interface Driver
{
public function storeItem(Model|array $item, int|null $userId = null): Driver;
public function storeItem(Model|array $item, ?int $userId = null): Driver;

public function storeItems(array $items): Driver;

Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/LaravelCartDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LaravelCartDatabase implements Driver
/**
* Store item in cart.
*/
public function storeItem(Model|array $item, int|null $userId = null): static
public function storeItem(Model|array $item, ?int $userId = null): static
{
if (is_null($userId)) {
$userId = auth()->id();
Expand Down
1 change: 0 additions & 1 deletion src/LaravelCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @method static \Binafy\LaravelCart\Drivers\Driver decreaseQuantity(\Illuminate\Database\Eloquent\Model $item, int $quantity = 1)
* @method static \Binafy\LaravelCart\Drivers\Driver removeItem(\Illuminate\Database\Eloquent\Model $item)
* @method static \Binafy\LaravelCart\Drivers\Driver emptyCart()
*
* @method static string getDefaultDriver()
* @method static void setDefaultDriver(string $name)
*
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/Manager/Database/CartDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\SetUp\Models\Product;
use Tests\SetUp\Models\User;

use function Pest\Laravel\assertDatabaseCount;

/*
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/Manager/Database/CartStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\SetUp\Models\Product;
use Tests\SetUp\Models\User;

use function Pest\Laravel\assertDatabaseCount;
use function Pest\Laravel\assertDatabaseHas;

Expand Down
5 changes: 3 additions & 2 deletions tests/Feature/Manager/Database/CartUpdateQuantityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\SetUp\Models\Product;
use Tests\SetUp\Models\User;

use function Pest\Laravel\assertDatabaseHas;
use function Pest\Laravel\assertDatabaseMissing;

Expand Down Expand Up @@ -88,7 +89,7 @@
assertDatabaseHas('cart_items', ['quantity' => 1]);

// Increase quantity
LaravelCart::driver('database')->increaseQuantity($product2 , 2);
LaravelCart::driver('database')->increaseQuantity($product2, 2);

assertDatabaseHas('cart_items', ['quantity' => 1]);
assertDatabaseMissing('cart_items', ['quantity' => 3]);
Expand Down Expand Up @@ -116,7 +117,7 @@
assertDatabaseHas('cart_items', ['quantity' => 3]);

// Decrease quantity
LaravelCart::driver('database')->decreaseQuantity($product2 , 2);
LaravelCart::driver('database')->decreaseQuantity($product2, 2);

assertDatabaseHas('cart_items', ['quantity' => 3]);
assertDatabaseMissing('cart_items', ['quantity' => 1]);
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/Models/CartDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\SetUp\Models\Product;
use Tests\SetUp\Models\User;

use function Pest\Laravel\assertDatabaseCount;

/*
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/Models/CartStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Support\Facades\Artisan;
use Tests\SetUp\Models\Product;
use Tests\SetUp\Models\User;

use function Pest\Laravel\assertDatabaseCount;
use function Pest\Laravel\assertDatabaseHas;
use function Pest\Laravel\assertDatabaseMissing;
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/Models/CartUpdateQuantityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\SetUp\Models\Product;
use Tests\SetUp\Models\User;

use function Pest\Laravel\assertDatabaseHas;

/*
Expand Down

0 comments on commit c5e34a5

Please sign in to comment.