Skip to content

Commit bb3cede

Browse files
Merge pull request #4331 from magento-engcom/2.3-develop-prs
[Magento Community Engineering] Community Contributions - 2.3-develop
2 parents 2dd90d0 + 97b5cc9 commit bb3cede

File tree

104 files changed

+669
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+669
-348
lines changed

app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\Analytics\Model\ReportXml;
77

8-
use Magento\Framework\Module\Manager as ModuleManager;
8+
use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager;
99

1010
/**
1111
* Iterator for ReportXml modules

app/code/Magento/Analytics/Test/Unit/Model/ReportXml/ModuleIteratorTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
namespace Magento\Analytics\Test\Unit\Model\ReportXml;
88

99
use Magento\Analytics\Model\ReportXml\ModuleIterator;
10-
use Magento\Framework\Module\Manager as ModuleManager;
10+
use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager;
1111
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1212

13+
/**
14+
* Module iterator test.
15+
*/
1316
class ModuleIteratorTest extends \PHPUnit\Framework\TestCase
1417
{
1518
/**

app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ class Grid extends \Magento\Backend\Block\Dashboard\Grid
1919
protected $_collectionFactory;
2020

2121
/**
22-
* @var \Magento\Framework\Module\Manager
22+
* @var \Magento\Framework\Module\ModuleManagerInterface
2323
*/
2424
protected $_moduleManager;
2525

2626
/**
2727
* @param \Magento\Backend\Block\Template\Context $context
2828
* @param \Magento\Backend\Helper\Data $backendHelper
29-
* @param \Magento\Framework\Module\Manager $moduleManager
29+
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
3030
* @param \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory
3131
* @param array $data
3232
*/
3333
public function __construct(
3434
\Magento\Backend\Block\Template\Context $context,
3535
\Magento\Backend\Helper\Data $backendHelper,
36-
\Magento\Framework\Module\Manager $moduleManager,
36+
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
3737
\Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory,
3838
array $data = []
3939
) {
@@ -43,6 +43,8 @@ public function __construct(
4343
}
4444

4545
/**
46+
* Construct.
47+
*
4648
* @return void
4749
*/
4850
protected function _construct()
@@ -52,6 +54,8 @@ protected function _construct()
5254
}
5355

5456
/**
57+
* Prepare collection.
58+
*
5559
* @return $this
5660
*/
5761
protected function _prepareCollection()
@@ -110,6 +114,8 @@ protected function _preparePage()
110114
}
111115

112116
/**
117+
* Prepare columns.
118+
*
113119
* @return $this
114120
*/
115121
protected function _prepareColumns()
@@ -129,7 +135,9 @@ protected function _prepareColumns()
129135
]
130136
);
131137

132-
$baseCurrencyCode = $this->_storeManager->getStore((int)$this->getParam('store'))->getBaseCurrencyCode();
138+
$baseCurrencyCode = $this->_storeManager->getStore(
139+
(int)$this->getParam('store')
140+
)->getBaseCurrencyCode();
133141

134142
$this->addColumn(
135143
'total',
@@ -149,7 +157,7 @@ protected function _prepareColumns()
149157
}
150158

151159
/**
152-
* {@inheritdoc}
160+
* @inheritdoc
153161
*/
154162
public function getRowUrl($row)
155163
{

app/code/Magento/Backend/Block/Dashboard/Sales.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,29 @@ class Sales extends \Magento\Backend\Block\Dashboard\Bar
1818
protected $_template = 'Magento_Backend::dashboard/salebar.phtml';
1919

2020
/**
21-
* @var \Magento\Framework\Module\Manager
21+
* @var \Magento\Framework\Module\ModuleManagerInterface
2222
*/
2323
protected $_moduleManager;
2424

2525
/**
2626
* @param \Magento\Backend\Block\Template\Context $context
2727
* @param \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory
28-
* @param \Magento\Framework\Module\Manager $moduleManager
28+
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
2929
* @param array $data
3030
*/
3131
public function __construct(
3232
\Magento\Backend\Block\Template\Context $context,
3333
\Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory,
34-
\Magento\Framework\Module\Manager $moduleManager,
34+
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
3535
array $data = []
3636
) {
3737
$this->_moduleManager = $moduleManager;
3838
parent::__construct($context, $collectionFactory, $data);
3939
}
4040

4141
/**
42+
* Prepare layout.
43+
*
4244
* @return $this|void
4345
*/
4446
protected function _prepareLayout()

app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ class Ordered extends \Magento\Backend\Block\Dashboard\Grid
1919
protected $_collectionFactory;
2020

2121
/**
22-
* @var \Magento\Framework\Module\Manager
22+
* @var \Magento\Framework\Module\ModuleManagerInterface
2323
*/
2424
protected $_moduleManager;
2525

2626
/**
2727
* @param \Magento\Backend\Block\Template\Context $context
2828
* @param \Magento\Backend\Helper\Data $backendHelper
29-
* @param \Magento\Framework\Module\Manager $moduleManager
29+
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
3030
* @param \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $collectionFactory
3131
* @param array $data
3232
*/
3333
public function __construct(
3434
\Magento\Backend\Block\Template\Context $context,
3535
\Magento\Backend\Helper\Data $backendHelper,
36-
\Magento\Framework\Module\Manager $moduleManager,
36+
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
3737
\Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $collectionFactory,
3838
array $data = []
3939
) {
@@ -43,6 +43,8 @@ public function __construct(
4343
}
4444

4545
/**
46+
* Construct.
47+
*
4648
* @return void
4749
*/
4850
protected function _construct()
@@ -52,7 +54,7 @@ protected function _construct()
5254
}
5355

5456
/**
55-
* {@inheritdoc}
57+
* @inheritdoc
5658
*/
5759
protected function _prepareCollection()
5860
{
@@ -81,7 +83,7 @@ protected function _prepareCollection()
8183
}
8284

8385
/**
84-
* {@inheritdoc}
86+
* @inheritdoc
8587
*/
8688
protected function _prepareColumns()
8789
{

app/code/Magento/Backend/Block/Dashboard/Totals.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
namespace Magento\Backend\Block\Dashboard;
1313

14+
/**
15+
* Totals block.
16+
*/
1417
class Totals extends \Magento\Backend\Block\Dashboard\Bar
1518
{
1619
/**
@@ -19,27 +22,28 @@ class Totals extends \Magento\Backend\Block\Dashboard\Bar
1922
protected $_template = 'Magento_Backend::dashboard/totalbar.phtml';
2023

2124
/**
22-
* @var \Magento\Framework\Module\Manager
25+
* @var \Magento\Framework\Module\ModuleManagerInterface
2326
*/
2427
protected $_moduleManager;
2528

2629
/**
2730
* @param \Magento\Backend\Block\Template\Context $context
2831
* @param \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory
29-
* @param \Magento\Framework\Module\Manager $moduleManager
32+
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
3033
* @param array $data
3134
*/
3235
public function __construct(
3336
\Magento\Backend\Block\Template\Context $context,
3437
\Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory,
35-
\Magento\Framework\Module\Manager $moduleManager,
38+
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
3639
array $data = []
3740
) {
3841
$this->_moduleManager = $moduleManager;
3942
parent::__construct($context, $collectionFactory, $data);
4043
}
4144

4245
/**
46+
* @inheritDoc
4347
* @return $this|void
4448
*/
4549
protected function _prepareLayout()

app/code/Magento/Backend/Model/Menu/Item.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class Item
145145
protected $_moduleList;
146146

147147
/**
148-
* @var \Magento\Framework\Module\Manager
148+
* @var \Magento\Framework\Module\ModuleManagerInterface
149149
*/
150150
private $_moduleManager;
151151

@@ -163,7 +163,7 @@ class Item
163163
* @param \Magento\Backend\Model\MenuFactory $menuFactory
164164
* @param \Magento\Backend\Model\UrlInterface $urlModel
165165
* @param \Magento\Framework\Module\ModuleListInterface $moduleList
166-
* @param \Magento\Framework\Module\Manager $moduleManager
166+
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
167167
* @param array $data
168168
*/
169169
public function __construct(
@@ -173,7 +173,7 @@ public function __construct(
173173
\Magento\Backend\Model\MenuFactory $menuFactory,
174174
\Magento\Backend\Model\UrlInterface $urlModel,
175175
\Magento\Framework\Module\ModuleListInterface $moduleList,
176-
\Magento\Framework\Module\Manager $moduleManager,
176+
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
177177
array $data = []
178178
) {
179179
$this->_validator = $validator;

app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer
3232
* @param \Magento\Framework\Url\Helper\Data $urlHelper
3333
* @param \Magento\Framework\Message\ManagerInterface $messageManager
3434
* @param PriceCurrencyInterface $priceCurrency
35-
* @param \Magento\Framework\Module\Manager $moduleManager
35+
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
3636
* @param InterpretationStrategyInterface $messageInterpretationStrategy
3737
* @param Configuration $bundleProductConfiguration
3838
* @param array $data
@@ -46,7 +46,7 @@ public function __construct(
4646
\Magento\Framework\Url\Helper\Data $urlHelper,
4747
\Magento\Framework\Message\ManagerInterface $messageManager,
4848
PriceCurrencyInterface $priceCurrency,
49-
\Magento\Framework\Module\Manager $moduleManager,
49+
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
5050
InterpretationStrategyInterface $messageInterpretationStrategy,
5151
Configuration $bundleProductConfiguration,
5252
array $data = []

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Price implements DimensionalIndexerInterface
8585
private $eventManager;
8686

8787
/**
88-
* @var \Magento\Framework\Module\Manager
88+
* @var \Magento\Framework\Module\ModuleManagerInterface
8989
*/
9090
private $moduleManager;
9191

@@ -97,7 +97,7 @@ class Price implements DimensionalIndexerInterface
9797
* @param BasePriceModifier $basePriceModifier
9898
* @param JoinAttributeProcessor $joinAttributeProcessor
9999
* @param \Magento\Framework\Event\ManagerInterface $eventManager
100-
* @param \Magento\Framework\Module\Manager $moduleManager
100+
* @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager
101101
* @param bool $fullReindexAction
102102
* @param string $connectionName
103103
*
@@ -111,7 +111,7 @@ public function __construct(
111111
BasePriceModifier $basePriceModifier,
112112
JoinAttributeProcessor $joinAttributeProcessor,
113113
\Magento\Framework\Event\ManagerInterface $eventManager,
114-
\Magento\Framework\Module\Manager $moduleManager,
114+
\Magento\Framework\Module\ModuleManagerInterface $moduleManager,
115115
$fullReindexAction = false,
116116
$connectionName = 'indexer'
117117
) {
@@ -128,7 +128,7 @@ public function __construct(
128128
}
129129

130130
/**
131-
* {@inheritdoc}
131+
* @inheritdoc
132132
* @param array $dimensions
133133
* @param \Traversable $entityIds
134134
* @throws \Exception
@@ -137,7 +137,8 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds)
137137
{
138138
$this->tableMaintainer->createMainTmpTable($dimensions);
139139

140-
$temporaryPriceTable = $this->indexTableStructureFactory->create([
140+
$temporaryPriceTable = $this->indexTableStructureFactory->create(
141+
[
141142
'tableName' => $this->tableMaintainer->getMainTmpTable($dimensions),
142143
'entityField' => 'entity_id',
143144
'customerGroupField' => 'customer_group_id',
@@ -148,7 +149,8 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds)
148149
'minPriceField' => 'min_price',
149150
'maxPriceField' => 'max_price',
150151
'tierPriceField' => 'tier_price',
151-
]);
152+
]
153+
);
152154

153155
$entityIds = iterator_to_array($entityIds);
154156

@@ -331,11 +333,13 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
331333
'ROUND((1 - ' . $tierExpr . ' / 100) * ' . $price . ', 4)',
332334
'NULL'
333335
);
334-
$finalPrice = $connection->getLeastSql([
336+
$finalPrice = $connection->getLeastSql(
337+
[
335338
$price,
336339
$connection->getIfNullSql($specialPriceExpr, $price),
337340
$connection->getIfNullSql($tierPrice, $price),
338-
]);
341+
]
342+
);
339343
} else {
340344
$finalPrice = new \Zend_Db_Expr('0');
341345
$tierPrice = $connection->getCheckSql($tierExpr . ' IS NOT NULL', '0', 'NULL');
@@ -471,10 +475,12 @@ private function calculateBundleSelectionPrice($dimensions, $priceType)
471475
'NULL'
472476
);
473477

474-
$priceExpr = $connection->getLeastSql([
478+
$priceExpr = $connection->getLeastSql(
479+
[
475480
$priceExpr,
476481
$connection->getIfNullSql($tierExpr, $priceExpr),
477-
]);
482+
]
483+
);
478484
} else {
479485
$price = 'idx.min_price * bs.selection_qty';
480486
$specialExpr = $connection->getCheckSql(
@@ -487,10 +493,12 @@ private function calculateBundleSelectionPrice($dimensions, $priceType)
487493
'ROUND((1 - i.tier_percent / 100) * ' . $price . ', 4)',
488494
'NULL'
489495
);
490-
$priceExpr = $connection->getLeastSql([
496+
$priceExpr = $connection->getLeastSql(
497+
[
491498
$specialExpr,
492499
$connection->getIfNullSql($tierExpr, $price),
493-
]);
500+
]
501+
);
494502
}
495503

496504
$metadata = $this->metadataPool->getMetadata(ProductInterface::class);
@@ -613,7 +621,7 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
613621
* Create bundle price.
614622
*
615623
* @param IndexTableStructure $priceTable
616-
* @return void
624+
* @return void
617625
*/
618626
private function applyBundlePrice($priceTable): void
619627
{
@@ -699,7 +707,7 @@ private function getMainTable($dimensions)
699707
/**
700708
* Get connection
701709
*
702-
* return \Magento\Framework\DB\Adapter\AdapterInterface
710+
* @return \Magento\Framework\DB\Adapter\AdapterInterface
703711
* @throws \DomainException
704712
*/
705713
private function getConnection(): \Magento\Framework\DB\Adapter\AdapterInterface

0 commit comments

Comments
 (0)