for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace SyliusCart\Domain\Command;
/**
* @author Arkadiusz Krakowiak <[email protected]>
*/
final class AddProductToCart
{
* @var string
private $cartId;
private $productCode;
* @var int
private $quantity;
private $price;
private $productCurrencyCode;
* @param string $cartId
* @param string $productCode
* @param int $quantity
* @param int $price
* @param string $productCurrencyCode
private function __construct(
string $cartId,
string $productCode,
int $quantity,
int $price,
string $productCurrencyCode
) {
$this->cartId = $cartId;
$this->productCode = $productCode;
$this->quantity = $quantity;
$this->price = $price;
$this->productCurrencyCode = $productCurrencyCode;
}
*
* @return self
public static function create(
): self {
return new self($cartId, $productCode, $quantity, $price, $productCurrencyCode);
* @return string
public function getCartId(): string
return $this->cartId;
public function getProductCode(): string
return $this->productCode;
* @return int
public function getQuantity(): int
return $this->quantity;
public function getPrice(): int
return $this->price;
public function getProductCurrencyCode(): string
return $this->productCurrencyCode;