diff --git a/src/Sylius/Component/Product/Model/ProductVariant.php b/src/Sylius/Component/Product/Model/ProductVariant.php index 3e31c68e9ac..ca128885dba 100644 --- a/src/Sylius/Component/Product/Model/ProductVariant.php +++ b/src/Sylius/Component/Product/Model/ProductVariant.php @@ -108,9 +108,9 @@ public function removeOptionValue(ProductOptionValueInterface $optionValue): voi } } - public function hasOptionValue(?ProductOptionValueInterface $optionValue): bool + public function hasOptionValue(ProductOptionValueInterface $optionValue): bool { - return $optionValue === null ? true : $this->optionValues->contains($optionValue); + return $this->optionValues->contains($optionValue); } public function getProduct(): ?ProductInterface diff --git a/src/Sylius/Component/Product/Model/ProductVariantInterface.php b/src/Sylius/Component/Product/Model/ProductVariantInterface.php index a19b93a6ec2..bd9b30ceba3 100644 --- a/src/Sylius/Component/Product/Model/ProductVariantInterface.php +++ b/src/Sylius/Component/Product/Model/ProductVariantInterface.php @@ -45,7 +45,7 @@ public function addOptionValue(ProductOptionValueInterface $optionValue): void; public function removeOptionValue(ProductOptionValueInterface $optionValue): void; - public function hasOptionValue(?ProductOptionValueInterface $optionValue): bool; + public function hasOptionValue(ProductOptionValueInterface $optionValue): bool; public function getProduct(): ?ProductInterface;