Skip to content

Commit 3993417

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1240 from magento-engcom/develop-prs
Public Pull Requests #10086 #10082 #9986 #9672
2 parents 1e19c93 + 74f029b commit 3993417

File tree

8 files changed

+298
-254
lines changed

8 files changed

+298
-254
lines changed

app/code/Magento/Quote/Model/Quote.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Model\AbstractExtensibleModel;
1313
use Magento\Quote\Api\Data\PaymentInterface;
1414
use Magento\Quote\Model\Quote\Address;
15+
use Magento\Quote\Model\Quote\Address\Total as AddressTotal;
1516
use Magento\Sales\Model\Status;
1617

1718
/**
@@ -1944,7 +1945,7 @@ public function collectTotals()
19441945
/**
19451946
* Get all quote totals (sorted by priority)
19461947
*
1947-
* @return array
1948+
* @return AddressTotal[]
19481949
*/
19491950
public function getTotals()
19501951
{

app/code/Magento/Quote/Model/Quote/Address/Total.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@
66
namespace Magento\Quote\Model\Quote\Address;
77

88
/**
9+
* @method string getCode()
10+
*
911
* @api
1012
*/
1113
class Total extends \Magento\Framework\DataObject
1214
{
1315
/**
1416
* @var array
1517
*/
16-
protected $totalAmounts;
18+
protected $totalAmounts = [];
1719

1820
/**
1921
* @var array
2022
*/
21-
protected $baseTotalAmounts;
23+
protected $baseTotalAmounts = [];
2224

2325
/**
2426
* Serializer interface instance.

app/code/Magento/Quote/Model/Quote/Address/TotalFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objManage
3333
*
3434
* @param string $instanceName
3535
* @param array $data
36-
* @return \Magento\Quote\Model\Quote\Address\Total\AbstractTotal
36+
* @return Total\AbstractTotal|Total
3737
*/
38-
public function create($instanceName, array $data = [])
38+
public function create($instanceName = Total::class, array $data = [])
3939
{
4040
return $this->_objectManager->create($instanceName, $data);
4141
}

app/code/Magento/Quote/Model/Quote/TotalsReader.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public function __construct(
3535
/**
3636
* @param \Magento\Quote\Model\Quote $quote
3737
* @param array $total
38-
* @return array
38+
* @return Total[]
3939
*/
4040
public function fetch(\Magento\Quote\Model\Quote $quote, array $total)
4141
{
4242
$output = [];
43-
$total = $this->totalFactory->create(\Magento\Quote\Model\Quote\Address\Total::class)->setData($total);
43+
$total = $this->totalFactory->create()->setData($total);
4444
/** @var ReaderInterface $reader */
4545
foreach ($this->collectorList->getCollectors($quote->getStoreId()) as $reader) {
4646
$data = $reader->fetch($quote, $total);
@@ -62,7 +62,7 @@ public function fetch(\Magento\Quote\Model\Quote $quote, array $total)
6262

6363
/**
6464
* @param array $total
65-
* @return Total|array
65+
* @return Total|Total[]
6666
*/
6767
protected function convert($total)
6868
{
@@ -73,22 +73,20 @@ protected function convert($total)
7373
if (count(array_column($total, 'code')) > 0) {
7474
$totals = [];
7575
foreach ($total as $item) {
76-
$totals[] = $this->totalFactory->create(
77-
\Magento\Quote\Model\Quote\Address\Total::class
78-
)->setData($item);
76+
$totals[] = $this->totalFactory->create()->setData($item);
7977
}
8078
return $totals;
8179
}
8280

83-
return $this->totalFactory->create(\Magento\Quote\Model\Quote\Address\Total::class)->setData($total);
81+
return $this->totalFactory->create()->setData($total);
8482
}
8583

8684
/**
8785
* @param Total $totalInstance
88-
* @param array $output
89-
* @return array
86+
* @param Total[] $output
87+
* @return Total[]
9088
*/
91-
protected function merge($totalInstance, $output)
89+
protected function merge(Total $totalInstance, $output)
9290
{
9391
if (array_key_exists($totalInstance->getCode(), $output)) {
9492
$output[$totalInstance->getCode()] = $output[$totalInstance->getCode()]->addData(

app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/module/_data-grid.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ body._in-resize {
304304
.action-menu {
305305
left: auto;
306306
min-width: 10rem;
307-
right: 0;
307+
right: auto;
308308
text-align: left;
309309
top: auto;
310310
z-index: 1;

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,5 @@
257257
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
258258
}
259259
},
260-
"minimum-stability": "alpha",
261260
"prefer-stable": true
262261
}

0 commit comments

Comments
 (0)