Code Duplication    Length = 10-10 lines in 2 locations

src/Entity/Price.php 2 locations

@@ 218-227 (lines=10) @@
215
     * @param Money|null $specialOfferPrice
216
     * @return Price
217
     */
218
    public function setSpecialOfferPrice(Money $specialOfferPrice = null)
219
    {
220
        if($specialOfferPrice) {
221
            $this->specialOfferPrice = $specialOfferPrice->getAmount();
222
            $this->setCurrencyCode($specialOfferPrice->getCurrency()->getCode());
223
        } else {
224
            $this->specialOfferPrice = $specialOfferPrice;
225
        }
226
        return $this;
227
    }
228
229
    /**
230
     * @return Money|null
@@ 241-250 (lines=10) @@
238
     * @param Money|null $unitPrice
239
     * @return Price
240
     */
241
    public function setUnitPrice(Money $unitPrice = null)
242
    {
243
        if($unitPrice) {
244
            $this->unitPrice = $unitPrice->getAmount();
245
            $this->setCurrencyCode($unitPrice->getCurrency()->getCode());
246
        } else {
247
            $this->unitPrice = $unitPrice;
248
        }
249
        return $this;
250
    }
251
252
    /**
253
     * @return Period|null