Skip to content

Commit

Permalink
fix: make categoryId nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
lsimeonov committed Nov 23, 2022
1 parent 341f227 commit 30b6079
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Response/ProductOffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ProductOffer

private ?int $buyButtonRank;

private int $categoryId;
private ?int $categoryId;

private int $id;

Expand Down Expand Up @@ -143,7 +143,7 @@ public static function fromArray(array $params): self
$product = new self();
$product->setPartNumberKey($params['part_number_key']);
$product->setBrandName($params['brand_name']);
$product->setBuyButtonRank($params['buy_button_rank']??null);
$product->setBuyButtonRank($params['buy_button_rank'] ?? null);
$product->setCategoryId($params['category_id']);
$product->setId($params['id']);
$product->setBrand($params['brand']);
Expand Down Expand Up @@ -236,17 +236,17 @@ public function setBuyButtonRank(?int $buyButtonRank): void
}

/**
* @return int
* @return int|null
*/
public function getCategoryId(): int
public function getCategoryId(): ?int
{
return $this->categoryId;
return $this->categoryId ?? null;
}

/**
* @param int $categoryId
* @param int|null $categoryId
*/
public function setCategoryId(int $categoryId): void
public function setCategoryId(?int $categoryId): void
{
$this->categoryId = $categoryId;
}
Expand Down

0 comments on commit 30b6079

Please sign in to comment.