Skip to content

Commit

Permalink
[API] Change the constructor signature of the AddItemToCart command
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafikooo committed Jul 3, 2023
1 parent 84669f4 commit 2876f9b
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,8 @@ class AddItemToCart implements OrderTokenValueAwareInterface, IriToIdentifierCon
/** @var string|null */
public $orderTokenValue;

/**
* @psalm-immutable
*
* @var string
*/
public $productVariantCode;

/**
* @psalm-immutable
*
* @var int
*/
public $quantity;

public function __construct(string $productVariantCode, int $quantity)
public function __construct(public ?string $productVariantCode, public ?int $quantity)
{
$this->productVariantCode = $productVariantCode;
$this->quantity = $quantity;
}

public static function createFromData(string $tokenValue, string $productVariantCode, int $quantity): self
Expand Down

0 comments on commit 2876f9b

Please sign in to comment.