for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sylius\ShopApiPlugin\Command;
use Webmozart\Assert\Assert;
final class PutOptionBasedConfigurableItemToCart
{
/**
* @var string
*/
private $orderToken;
private $product;
* @var array
private $options;
* @var int
private $quantity;
* @param string $orderToken
* @param string $product
* @param array $options
* @param int $quantity
public function __construct($orderToken, $product, array $options, $quantity)
Assert::string($orderToken, 'Expected order token to be string, got %s');
Assert::string($product, 'Expected product code to be string, got %s');
Assert::notEmpty($options, 'Options array cannot be empty');
Assert::integer($quantity, 'Expected quantity to be integer, got %s');
Assert::greaterThan($quantity, 0, 'Quantity should be greater than 0');
$this->orderToken = $orderToken;
$this->product = $product;
$this->options = $options;
$this->quantity = $quantity;
}
* @return string
public function orderToken()
return $this->orderToken;
public function product()
return $this->product;
* @return array
public function options()
return $this->options;
* @return int
public function quantity()
return $this->quantity;