Skip to content

Commit 33914c1

Browse files
committed
#33334:Inheriting from a class that doesn't exist
- Made changes backwards compatible.
1 parent 1aa93e0 commit 33914c1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,19 @@ public function __construct(
6767
$quantity,
6868
BundleCalculatorInterface $calculator,
6969
PriceCurrencyInterface $priceCurrency,
70-
DiscountCalculator $discountCalculator,
7170
ItemInterface $item = null,
7271
JsonSerializer $serializer = null,
73-
ConfiguredPriceSelection $configuredPriceSelection = null
72+
ConfiguredPriceSelection $configuredPriceSelection = null,
73+
DiscountCalculator $discountCalculator = null
7474
) {
7575
$this->item = $item;
7676
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
7777
->get(JsonSerializer::class);
7878
$this->configuredPriceSelection = $configuredPriceSelection
7979
?: \Magento\Framework\App\ObjectManager::getInstance()
8080
->get(ConfiguredPriceSelection::class);
81-
$this->discountCalculator = $discountCalculator;
81+
$this->discountCalculator = $discountCalculator
82+
?: \Magento\Framework\App\ObjectManager::getInstance()->get(DiscountCalculator::class);
8283
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
8384
}
8485

app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundlePriceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ protected function setUp(): void
130130
1,
131131
$this->calculator,
132132
$this->priceCurrencyMock,
133-
$this->discountCalculator,
134133
null,
135134
$this->jsonSerializerMock,
136-
$this->configuredPriceSelectionMock
135+
$this->configuredPriceSelectionMock,
136+
$this->discountCalculator,
137137
);
138138
$this->model->setItem($this->item);
139139
}

0 commit comments

Comments
 (0)