mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[API] Change the constructor signature of the AddProductReview command
This commit is contained in:
parent
6f6bf56a4d
commit
09a5b65424
2 changed files with 50 additions and 45 deletions
|
|
@ -1,5 +1,50 @@
|
|||
# UPGRADE FROM `v1.12.x` TO `v1.13.0`
|
||||
|
||||
1. The signature of constructor and `createFromData` method of 'Sylius\Bundle\ApiBundle\Command\Cart\ChangeItemQuantityCart' command changed:
|
||||
|
||||
````diff
|
||||
public function __construct(
|
||||
- public int $quantity,
|
||||
+ public ?int $quantity,
|
||||
) {
|
||||
}
|
||||
````
|
||||
|
||||
````diff
|
||||
public static function createFromData(
|
||||
string $tokenValue,
|
||||
string $orderItemId,
|
||||
- int $quantity,
|
||||
+ ?int $quantity,
|
||||
): self
|
||||
````
|
||||
|
||||
1. The constructor signature of 'Sylius\Bundle\ApiBundle\Command\Cart\AddItemToCart' changed:
|
||||
|
||||
````diff
|
||||
public function __construct(
|
||||
- public string $productCode,
|
||||
+ public ?string $productCode,
|
||||
- public int $quantity,
|
||||
+ public ?int $quantity,
|
||||
) {
|
||||
}
|
||||
````
|
||||
|
||||
1. The constructor signature of `Sylius\Bundle\ApiBundle\Command\Catalog\AddProductReview` changed:
|
||||
|
||||
````diff
|
||||
public function __construct(
|
||||
public ?string $title,
|
||||
public ?int $rating,
|
||||
public ?string $comment,
|
||||
- public string $productCode,
|
||||
+ public ?string $productCode,
|
||||
public ?string $email = null,
|
||||
) {
|
||||
}
|
||||
````
|
||||
|
||||
1. The item operation paths for ProductVariantTranslation resource changed:
|
||||
|
||||
- `GET /admin/product-variant-translation/{id}` -> `GET /admin/product-variant-translations/{id}`
|
||||
|
|
|
|||
|
|
@ -19,53 +19,13 @@ use Sylius\Bundle\ApiBundle\Command\IriToIdentifierConversionAwareInterface;
|
|||
/** @experimental */
|
||||
class AddProductReview implements IriToIdentifierConversionAwareInterface, CustomerEmailAwareInterface
|
||||
{
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $title;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*
|
||||
* @var int|null
|
||||
*/
|
||||
public $rating;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $comment;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $productCode;
|
||||
|
||||
/**
|
||||
* @psalm-immutable
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
public $email;
|
||||
|
||||
public function __construct(
|
||||
?string $title,
|
||||
?int $rating,
|
||||
?string $comment,
|
||||
string $productCode,
|
||||
?string $email = null,
|
||||
public ?string $title,
|
||||
public ?int $rating,
|
||||
public ?string $comment,
|
||||
public ?string $productCode,
|
||||
public ?string $email = null,
|
||||
) {
|
||||
$this->title = $title;
|
||||
$this->rating = $rating;
|
||||
$this->comment = $comment;
|
||||
$this->productCode = $productCode;
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue