From 5628f375e0cf48c7f0f592a918b7e74d7f4d5edf Mon Sep 17 00:00:00 2001 From: Ron Kirschler Date: Mon, 8 Aug 2022 11:16:07 +0200 Subject: [PATCH] Fixed type-hint for Discount If an offer has no discount, then `Mirakl\MMP\Common\Domain\Offer\AbstractOffer::getDiscount` will return `NULL`. This is not documented in the type-hint, which subsequently causes problems with PHPStan and co. --- src/Mirakl/MMP/Common/Domain/Offer/AbstractOffer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mirakl/MMP/Common/Domain/Offer/AbstractOffer.php b/src/Mirakl/MMP/Common/Domain/Offer/AbstractOffer.php index 3c6e357..136ac1f 100644 --- a/src/Mirakl/MMP/Common/Domain/Offer/AbstractOffer.php +++ b/src/Mirakl/MMP/Common/Domain/Offer/AbstractOffer.php @@ -29,7 +29,7 @@ * @method $this setCurrencyIsoCode(string $currencyIsoCode) * @method string getDescription() * @method $this setDescription(string $description) - * @method Discount getDiscount() + * @method Discount|null getDiscount() * @method int getFavoriteRank() * @method $this setFavoriteRank(int $favoriteRank) * @method Fulfillment getFulfillment() @@ -166,4 +166,4 @@ public function setProductReferences($product) return $this->setProduct($product); } -} \ No newline at end of file +}