diff --git a/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php b/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php index fecbf2033c1ba..4d62344197405 100644 --- a/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php +++ b/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php @@ -5,7 +5,7 @@ */ namespace Magento\Analytics\Model\ReportXml; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager; /** * Iterator for ReportXml modules diff --git a/app/code/Magento/Analytics/Test/Unit/Model/ReportXml/ModuleIteratorTest.php b/app/code/Magento/Analytics/Test/Unit/Model/ReportXml/ModuleIteratorTest.php index f314d77f32b41..b08d41ac829b7 100644 --- a/app/code/Magento/Analytics/Test/Unit/Model/ReportXml/ModuleIteratorTest.php +++ b/app/code/Magento/Analytics/Test/Unit/Model/ReportXml/ModuleIteratorTest.php @@ -7,9 +7,12 @@ namespace Magento\Analytics\Test\Unit\Model\ReportXml; use Magento\Analytics\Model\ReportXml\ModuleIterator; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +/** + * Module iterator test. + */ class ModuleIteratorTest extends \PHPUnit\Framework\TestCase { /** diff --git a/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php b/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php index 50279786c0a5b..bca7f13b0cee3 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php +++ b/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php @@ -19,21 +19,21 @@ class Grid extends \Magento\Backend\Block\Dashboard\Grid protected $_collectionFactory; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory, array $data = [] ) { @@ -43,6 +43,8 @@ public function __construct( } /** + * Construct. + * * @return void */ protected function _construct() @@ -52,6 +54,8 @@ protected function _construct() } /** + * Prepare collection. + * * @return $this */ protected function _prepareCollection() @@ -110,6 +114,8 @@ protected function _preparePage() } /** + * Prepare columns. + * * @return $this */ protected function _prepareColumns() @@ -129,7 +135,9 @@ protected function _prepareColumns() ] ); - $baseCurrencyCode = $this->_storeManager->getStore((int)$this->getParam('store'))->getBaseCurrencyCode(); + $baseCurrencyCode = $this->_storeManager->getStore( + (int)$this->getParam('store') + )->getBaseCurrencyCode(); $this->addColumn( 'total', @@ -149,7 +157,7 @@ protected function _prepareColumns() } /** - * {@inheritdoc} + * @inheritdoc */ public function getRowUrl($row) { diff --git a/app/code/Magento/Backend/Block/Dashboard/Sales.php b/app/code/Magento/Backend/Block/Dashboard/Sales.php index 6d7a4d6458a8e..3455ff087a799 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Sales.php +++ b/app/code/Magento/Backend/Block/Dashboard/Sales.php @@ -18,20 +18,20 @@ class Sales extends \Magento\Backend\Block\Dashboard\Bar protected $_template = 'Magento_Backend::dashboard/salebar.phtml'; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_moduleManager = $moduleManager; @@ -39,6 +39,8 @@ public function __construct( } /** + * Prepare layout. + * * @return $this|void */ protected function _prepareLayout() diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php index cac10ae372004..7dc897a62a320 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php @@ -19,21 +19,21 @@ class Ordered extends \Magento\Backend\Block\Dashboard\Grid protected $_collectionFactory; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $collectionFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $collectionFactory, array $data = [] ) { @@ -43,6 +43,8 @@ public function __construct( } /** + * Construct. + * * @return void */ protected function _construct() @@ -52,7 +54,7 @@ protected function _construct() } /** - * {@inheritdoc} + * @inheritdoc */ protected function _prepareCollection() { @@ -81,7 +83,7 @@ protected function _prepareCollection() } /** - * {@inheritdoc} + * @inheritdoc */ protected function _prepareColumns() { diff --git a/app/code/Magento/Backend/Block/Dashboard/Totals.php b/app/code/Magento/Backend/Block/Dashboard/Totals.php index 4dcda3677584c..e57a6249af47d 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Totals.php +++ b/app/code/Magento/Backend/Block/Dashboard/Totals.php @@ -11,6 +11,9 @@ */ namespace Magento\Backend\Block\Dashboard; +/** + * Totals block. + */ class Totals extends \Magento\Backend\Block\Dashboard\Bar { /** @@ -19,20 +22,20 @@ class Totals extends \Magento\Backend\Block\Dashboard\Bar protected $_template = 'Magento_Backend::dashboard/totalbar.phtml'; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Reports\Model\ResourceModel\Order\CollectionFactory $collectionFactory, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_moduleManager = $moduleManager; @@ -40,6 +43,7 @@ public function __construct( } /** + * @inheritDoc * @return $this|void */ protected function _prepareLayout() diff --git a/app/code/Magento/Backend/Model/Menu/Item.php b/app/code/Magento/Backend/Model/Menu/Item.php index 67c6216cbbc06..d535e9c84df24 100644 --- a/app/code/Magento/Backend/Model/Menu/Item.php +++ b/app/code/Magento/Backend/Model/Menu/Item.php @@ -145,7 +145,7 @@ class Item protected $_moduleList; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $_moduleManager; @@ -163,7 +163,7 @@ class Item * @param \Magento\Backend\Model\MenuFactory $menuFactory * @param \Magento\Backend\Model\UrlInterface $urlModel * @param \Magento\Framework\Module\ModuleListInterface $moduleList - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data */ public function __construct( @@ -173,7 +173,7 @@ public function __construct( \Magento\Backend\Model\MenuFactory $menuFactory, \Magento\Backend\Model\UrlInterface $urlModel, \Magento\Framework\Module\ModuleListInterface $moduleList, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_validator = $validator; diff --git a/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php b/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php index 863f273225693..c0a2d9d43034d 100644 --- a/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php @@ -32,7 +32,7 @@ class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer * @param \Magento\Framework\Url\Helper\Data $urlHelper * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param PriceCurrencyInterface $priceCurrency - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param InterpretationStrategyInterface $messageInterpretationStrategy * @param Configuration $bundleProductConfiguration * @param array $data @@ -46,7 +46,7 @@ public function __construct( \Magento\Framework\Url\Helper\Data $urlHelper, \Magento\Framework\Message\ManagerInterface $messageManager, PriceCurrencyInterface $priceCurrency, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, InterpretationStrategyInterface $messageInterpretationStrategy, Configuration $bundleProductConfiguration, array $data = [] diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php index b5dfd312cd0c4..b71853cde41ac 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php @@ -85,7 +85,7 @@ class Price implements DimensionalIndexerInterface private $eventManager; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManager; @@ -97,7 +97,7 @@ class Price implements DimensionalIndexerInterface * @param BasePriceModifier $basePriceModifier * @param JoinAttributeProcessor $joinAttributeProcessor * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param bool $fullReindexAction * @param string $connectionName * @@ -111,7 +111,7 @@ public function __construct( BasePriceModifier $basePriceModifier, JoinAttributeProcessor $joinAttributeProcessor, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, $fullReindexAction = false, $connectionName = 'indexer' ) { @@ -128,7 +128,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @param array $dimensions * @param \Traversable $entityIds * @throws \Exception @@ -137,7 +137,8 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds) { $this->tableMaintainer->createMainTmpTable($dimensions); - $temporaryPriceTable = $this->indexTableStructureFactory->create([ + $temporaryPriceTable = $this->indexTableStructureFactory->create( + [ 'tableName' => $this->tableMaintainer->getMainTmpTable($dimensions), 'entityField' => 'entity_id', 'customerGroupField' => 'customer_group_id', @@ -148,7 +149,8 @@ public function executeByDimensions(array $dimensions, \Traversable $entityIds) 'minPriceField' => 'min_price', 'maxPriceField' => 'max_price', 'tierPriceField' => 'tier_price', - ]); + ] + ); $entityIds = iterator_to_array($entityIds); @@ -331,11 +333,13 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity 'ROUND((1 - ' . $tierExpr . ' / 100) * ' . $price . ', 4)', 'NULL' ); - $finalPrice = $connection->getLeastSql([ + $finalPrice = $connection->getLeastSql( + [ $price, $connection->getIfNullSql($specialPriceExpr, $price), $connection->getIfNullSql($tierPrice, $price), - ]); + ] + ); } else { $finalPrice = new \Zend_Db_Expr('0'); $tierPrice = $connection->getCheckSql($tierExpr . ' IS NOT NULL', '0', 'NULL'); @@ -471,10 +475,12 @@ private function calculateBundleSelectionPrice($dimensions, $priceType) 'NULL' ); - $priceExpr = $connection->getLeastSql([ + $priceExpr = $connection->getLeastSql( + [ $priceExpr, $connection->getIfNullSql($tierExpr, $priceExpr), - ]); + ] + ); } else { $price = 'idx.min_price * bs.selection_qty'; $specialExpr = $connection->getCheckSql( @@ -487,10 +493,12 @@ private function calculateBundleSelectionPrice($dimensions, $priceType) 'ROUND((1 - i.tier_percent / 100) * ' . $price . ', 4)', 'NULL' ); - $priceExpr = $connection->getLeastSql([ + $priceExpr = $connection->getLeastSql( + [ $specialExpr, $connection->getIfNullSql($tierExpr, $price), - ]); + ] + ); } $metadata = $this->metadataPool->getMetadata(ProductInterface::class); @@ -613,7 +621,7 @@ private function prepareTierPriceIndex($dimensions, $entityIds) * Create bundle price. * * @param IndexTableStructure $priceTable - * @return void + * @return void */ private function applyBundlePrice($priceTable): void { @@ -699,7 +707,7 @@ private function getMainTable($dimensions) /** * Get connection * - * return \Magento\Framework\DB\Adapter\AdapterInterface + * @return \Magento\Framework\DB\Adapter\AdapterInterface * @throws \DomainException */ private function getConnection(): \Magento\Framework\DB\Adapter\AdapterInterface diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php b/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php index 5b88288ff72ca..21ba1f75ba90b 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php @@ -15,6 +15,7 @@ * * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @since 100.0.2 */ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection @@ -60,7 +61,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -87,7 +88,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, @@ -145,7 +146,8 @@ protected function _construct() } /** - * Set store id for each collection item when collection was loaded + * Set store id for each collection item when collection was loaded. + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * * @return $this */ diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php index 62c27a421419d..a829c058d89bf 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg.php @@ -11,6 +11,9 @@ */ namespace Magento\Catalog\Block\Adminhtml\Helper\Form; +/** + * Wysiwyg helper. + */ class Wysiwyg extends \Magento\Framework\Data\Form\Element\Textarea { /** @@ -23,7 +26,7 @@ class Wysiwyg extends \Magento\Framework\Data\Form\Element\Textarea /** * Catalog data * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager = null; @@ -43,7 +46,7 @@ class Wysiwyg extends \Magento\Framework\Data\Form\Element\Textarea * @param \Magento\Framework\Escaper $escaper * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig * @param \Magento\Framework\View\LayoutInterface $layout - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Backend\Helper\Data $backendData * @param array $data */ @@ -53,7 +56,7 @@ public function __construct( \Magento\Framework\Escaper $escaper, \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, \Magento\Framework\View\LayoutInterface $layout, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Backend\Helper\Data $backendData, array $data = [] ) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php index 3b4a5f9eabfd2..e754ab9700517 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php @@ -19,7 +19,7 @@ class Price extends Extended /** * Catalog data * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -32,14 +32,14 @@ class Price extends Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\ProductAlert\Model\PriceFactory $priceFactory - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\ProductAlert\Model\PriceFactory $priceFactory, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_priceFactory = $priceFactory; @@ -48,6 +48,8 @@ public function __construct( } /** + * Construct. + * * @return void */ protected function _construct() @@ -63,6 +65,8 @@ protected function _construct() } /** + * @inheritDoc + * * @return Grid */ protected function _prepareCollection() @@ -80,6 +84,8 @@ protected function _prepareCollection() } /** + * @inheritDoc + * * @return $this */ protected function _prepareColumns() @@ -116,6 +122,8 @@ protected function _prepareColumns() } /** + * @inheritDoc + * * @return string */ public function getGridUrl() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php index d572690143ca4..2c6647fd57be6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php @@ -19,7 +19,7 @@ class Stock extends Extended /** * Catalog data * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -32,14 +32,14 @@ class Stock extends Extended * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\ProductAlert\Model\StockFactory $stockFactory - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, \Magento\ProductAlert\Model\StockFactory $stockFactory, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_stockFactory = $stockFactory; @@ -48,6 +48,8 @@ public function __construct( } /** + * Construct. + * * @return void */ protected function _construct() @@ -63,6 +65,8 @@ protected function _construct() } /** + * @inheritDoc + * * @return Grid */ protected function _prepareCollection() @@ -80,6 +84,8 @@ protected function _prepareCollection() } /** + * @inheritDoc + * * @return $this */ protected function _prepareColumns() @@ -103,6 +109,8 @@ protected function _prepareColumns() } /** + * Get grid url. + * * @return string */ public function getGridUrl() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php index 20e12889cae0d..9278b84362e77 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php @@ -18,7 +18,7 @@ class Inventory extends \Magento\Backend\Block\Widget protected $_template = 'Magento_Catalog::catalog/product/tab/inventory.phtml'; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -53,7 +53,7 @@ class Inventory extends \Magento\Backend\Block\Widget * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders * @param \Magento\CatalogInventory\Model\Source\Stock $stock - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry * @param \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration @@ -63,7 +63,7 @@ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Model\Source\Backorders $backorders, \Magento\CatalogInventory\Model\Source\Stock $stock, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Framework\Registry $coreRegistry, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, @@ -79,6 +79,8 @@ public function __construct( } /** + * Get backorder option. + * * @return array */ public function getBackordersOption() @@ -128,6 +130,8 @@ public function getStockItem() } /** + * Get field value. + * * @param string $field * @return string|null */ @@ -145,6 +149,8 @@ public function getFieldValue($field) } /** + * Get config field value. + * * @param string $field * @return string|null */ @@ -163,6 +169,8 @@ public function getConfigFieldValue($field) } /** + * Get default config value. + * * @param string $field * @return string|null */ @@ -182,6 +190,8 @@ public function isReadonly() } /** + * Is new. + * * @return bool */ public function isNew() @@ -193,6 +203,8 @@ public function isNew() } /** + * Get field suffix. + * * @return string */ public function getFieldSuffix() @@ -221,6 +233,8 @@ public function isVirtual() } /** + * Is single store mode enabled. + * * @return bool */ public function isSingleStoreMode() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php index 5ffd3d1dda38d..42990116e933f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php @@ -41,7 +41,7 @@ abstract class AbstractGroup extends Widget implements RendererInterface /** * Catalog data * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -81,7 +81,7 @@ abstract class AbstractGroup extends Widget implements RendererInterface * @param \Magento\Backend\Block\Template\Context $context * @param GroupRepositoryInterface $groupRepository * @param \Magento\Directory\Helper\Data $directoryHelper - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Framework\Registry $registry * @param GroupManagementInterface $groupManagement * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder @@ -92,7 +92,7 @@ public function __construct( \Magento\Backend\Block\Template\Context $context, GroupRepositoryInterface $groupRepository, \Magento\Directory\Helper\Data $directoryHelper, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Framework\Registry $registry, GroupManagementInterface $groupManagement, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php index 37ad3f4bea20e..51c326763b09c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php @@ -14,7 +14,7 @@ use Magento\Catalog\Helper\Data; use Magento\Eav\Model\ResourceModel\Entity\Attribute\Group\CollectionFactory; use Magento\Framework\Json\EncoderInterface; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\Registry; use Magento\Framework\Translate\InlineInterface; @@ -65,7 +65,7 @@ class Tabs extends WidgetTabs protected $_collectionFactory; /** - * @var Manager + * @var ModuleManagerInterface */ protected $_moduleManager; @@ -78,7 +78,7 @@ class Tabs extends WidgetTabs * @param Context $context * @param EncoderInterface $jsonEncoder * @param Session $authSession - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param CollectionFactory $collectionFactory * @param Catalog $helperCatalog * @param Data $catalogData @@ -91,7 +91,7 @@ public function __construct( Context $context, EncoderInterface $jsonEncoder, Session $authSession, - Manager $moduleManager, + ModuleManagerInterface $moduleManager, CollectionFactory $collectionFactory, Catalog $helperCatalog, Data $catalogData, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php index 8f3a0793cc49f..238af3dddf322 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php @@ -8,13 +8,15 @@ use Magento\Store\Model\Store; /** + * Grid. + * * @api * @since 100.0.2 */ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -57,7 +59,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended * @param \Magento\Catalog\Model\Product\Type $type * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $status * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -71,7 +73,7 @@ public function __construct( \Magento\Catalog\Model\Product\Type $type, \Magento\Catalog\Model\Product\Attribute\Source\Status $status, \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_websiteFactory = $websiteFactory; @@ -85,6 +87,8 @@ public function __construct( } /** + * Construct. + * * @return void */ protected function _construct() @@ -99,6 +103,8 @@ protected function _construct() } /** + * Get store. + * * @return Store */ protected function _getStore() @@ -108,6 +114,8 @@ protected function _getStore() } /** + * @inheritDoc + * * @return $this */ protected function _prepareCollection() @@ -136,7 +144,6 @@ protected function _prepareCollection() ); } if ($store->getId()) { - //$collection->setStoreId($store->getId()); $collection->addStoreFilter($store); $collection->joinAttribute( 'name', @@ -187,6 +194,8 @@ protected function _prepareCollection() } /** + * @inheritDoc + * * @param \Magento\Backend\Block\Widget\Grid\Column $column * @return $this */ @@ -208,6 +217,8 @@ protected function _addColumnFilterToCollection($column) } /** + * @inheritDoc + * * @return $this * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ @@ -373,6 +384,8 @@ protected function _prepareColumns() } /** + * @inheritDoc + * * @return $this */ protected function _prepareMassaction() @@ -425,6 +438,8 @@ protected function _prepareMassaction() } /** + * Get grid Url. + * * @return string */ public function getGridUrl() @@ -433,6 +448,8 @@ public function getGridUrl() } /** + * Get row url. + * * @param \Magento\Catalog\Model\Product|\Magento\Framework\DataObject $row * @return string */ diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index 6de70bb971367..088619511545f 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -46,7 +46,7 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct implements protected $_checkoutCart; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -55,7 +55,7 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct implements * @param \Magento\Checkout\Model\ResourceModel\Cart $checkoutCart * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data */ public function __construct( @@ -63,7 +63,7 @@ public function __construct( \Magento\Checkout\Model\ResourceModel\Cart $checkoutCart, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_checkoutCart = $checkoutCart; diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index 24822447ae915..d888f44a6fbfb 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -60,7 +60,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct implements protected $_checkoutCart; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -69,7 +69,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct implements * @param \Magento\Checkout\Model\ResourceModel\Cart $checkoutCart * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param array $data */ public function __construct( @@ -77,7 +77,7 @@ public function __construct( \Magento\Checkout\Model\ResourceModel\Cart $checkoutCart, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, array $data = [] ) { $this->_checkoutCart = $checkoutCart; diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 1e774e45df41f..61544f8fb5766 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -175,7 +175,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements protected $_catalogProduct = null; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -369,7 +369,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel implements * @param Product\Attribute\Source\Status $catalogProductStatus * @param Product\Media\Config $catalogProductMediaConfig * @param Product\Type $catalogProductType - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Helper\Product $catalogProduct * @param ResourceModel\Product $resource * @param ResourceModel\Product\Collection $resourceCollection @@ -410,7 +410,7 @@ public function __construct( \Magento\Catalog\Model\Product\Attribute\Source\Status $catalogProductStatus, \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig, Product\Type $catalogProductType, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Catalog\Model\ResourceModel\Product $resource, \Magento\Catalog\Model\ResourceModel\Product\Collection $resourceCollection, @@ -487,6 +487,7 @@ protected function _construct() /** * Get resource instance + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * * @throws \Magento\Framework\Exception\LocalizedException * @return \Magento\Catalog\Model\ResourceModel\Product @@ -1166,8 +1167,7 @@ public function getFormattedPrice() /** * Get formatted by currency product price * - * @return array|double - * + * @return array|double* * @deprecated * @see getFormattedPrice() */ @@ -1815,9 +1815,9 @@ public function formatUrlKey($str) } /** - * Save current attribute with code $code and assign new value + * Save current attribute with code $code and assign new value. * - * @param string $code Attribute code + * @param string $code Attribute code * @param mixed $value New attribute value * @param int $store Store ID * @return void diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index 384b6ddcefc31..dbd6a7a2e1094 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -191,7 +191,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac /** * Catalog data * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager = null; @@ -315,7 +315,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -344,7 +344,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php index aa6fb8c1f8827..dc3411743a066 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Compare/Item/Collection.php @@ -64,7 +64,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -89,7 +89,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php index 3b4c3408e742b..9643f4c3a7181 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php @@ -40,7 +40,7 @@ class DefaultPrice extends AbstractIndexer implements PriceInterface /** * Core data * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -73,7 +73,7 @@ class DefaultPrice extends AbstractIndexer implements PriceInterface * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param string|null $connectionName * @param IndexTableStructureFactory $indexTableStructureFactory * @param PriceModifierInterface[] $priceModifiers @@ -83,7 +83,7 @@ public function __construct( \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, $connectionName = null, IndexTableStructureFactory $indexTableStructureFactory = null, array $priceModifiers = [] @@ -259,7 +259,8 @@ private function prepareFinalPriceTable() $tableName = $this->_getDefaultFinalPriceTable(); $this->getConnection()->delete($tableName); - $finalPriceTable = $this->indexTableStructureFactory->create([ + $finalPriceTable = $this->indexTableStructureFactory->create( + [ 'tableName' => $tableName, 'entityField' => 'entity_id', 'customerGroupField' => 'customer_group_id', @@ -270,7 +271,8 @@ private function prepareFinalPriceTable() 'minPriceField' => 'min_price', 'maxPriceField' => 'max_price', 'tierPriceField' => 'tier_price', - ]); + ] + ); return $finalPriceTable; } @@ -465,11 +467,13 @@ protected function getSelect($entityIds = null, $type = null) ); $tierPrice = $this->getTotalTierPriceExpression($price); $tierPriceExpr = $connection->getIfNullSql($tierPrice, $maxUnsignedBigint); - $finalPrice = $connection->getLeastSql([ + $finalPrice = $connection->getLeastSql( + [ $price, $specialPriceExpr, $tierPriceExpr, - ]); + ] + ); $select->columns( [ @@ -848,7 +852,8 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression) ] ), 'NULL', - $this->getConnection()->getLeastSql([ + $this->getConnection()->getLeastSql( + [ $this->getConnection()->getIfNullSql( $this->getTierPriceExpressionForTable('tier_price_1', $priceExpression), $maxUnsignedBigint @@ -865,7 +870,8 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression) $this->getTierPriceExpressionForTable('tier_price_4', $priceExpression), $maxUnsignedBigint ), - ]) + ] + ) ); } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php index 499312aadf6a1..a3f463d53e7a8 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php @@ -37,7 +37,7 @@ class BaseFinalPrice private $joinAttributeProcessor; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManager; @@ -69,7 +69,7 @@ class BaseFinalPrice /** * @param \Magento\Framework\App\ResourceConnection $resource * @param JoinAttributeProcessor $joinAttributeProcessor - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool * @param string $connectionName @@ -77,7 +77,7 @@ class BaseFinalPrice public function __construct( \Magento\Framework\App\ResourceConnection $resource, JoinAttributeProcessor $joinAttributeProcessor, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\EntityManager\MetadataPool $metadataPool, $connectionName = 'indexer' @@ -200,11 +200,13 @@ public function getQuery(array $dimensions, string $productType, array $entityId ); $tierPrice = $this->getTotalTierPriceExpression($price); $tierPriceExpr = $connection->getIfNullSql($tierPrice, $maxUnsignedBigint); - $finalPrice = $connection->getLeastSql([ + $finalPrice = $connection->getLeastSql( + [ $price, $specialPriceExpr, $tierPriceExpr, - ]); + ] + ); $select->columns( [ @@ -262,7 +264,8 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression) ] ), 'NULL', - $this->getConnection()->getLeastSql([ + $this->getConnection()->getLeastSql( + [ $this->getConnection()->getIfNullSql( $this->getTierPriceExpressionForTable('tier_price_1', $priceExpression), $maxUnsignedBigint @@ -279,7 +282,8 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression) $this->getTierPriceExpressionForTable('tier_price_4', $priceExpression), $maxUnsignedBigint ), - ]) + ] + ) ); } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/InventoryTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/InventoryTest.php index 19c578e976cdd..2008d0b9414c5 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/InventoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Edit/Tab/InventoryTest.php @@ -85,7 +85,7 @@ protected function setUp() $this->backordersMock = $this->createMock(\Magento\CatalogInventory\Model\Source\Backorders::class); $this->stockMock = $this->createMock(\Magento\CatalogInventory\Model\Source\Stock::class); $this->coreRegistryMock = $this->createMock(\Magento\Framework\Registry::class); - $this->moduleManager = $this->createMock(\Magento\Framework\Module\Manager::class); + $this->moduleManager = $this->createMock(\Magento\Framework\Module\ModuleManagerInterface::class); $this->storeManagerMock = $this->getMockForAbstractClass( \Magento\Store\Model\StoreManagerInterface::class, [], diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php index 22ba6bfa9f7fd..8bf8473080c54 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php @@ -40,7 +40,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase protected $model; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManager; @@ -215,7 +215,7 @@ protected function setUp() $this->categoryIndexerMock = $this->getMockForAbstractClass(\Magento\Framework\Indexer\IndexerInterface::class); $this->moduleManager = $this->createPartialMock( - \Magento\Framework\Module\Manager::class, + \Magento\Framework\Module\ModuleManagerInterface::class, ['isEnabled'] ); $this->extensionAttributes = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class) @@ -484,9 +484,11 @@ public function testGetCategoryCollectionCollectionNull($initCategoryCollection, $abstractDbMock = $this->getMockBuilder(\Magento\Framework\Model\ResourceModel\Db\AbstractDb::class) ->disableOriginalConstructor() - ->setMethods([ + ->setMethods( + [ 'getCategoryCollection', - ]) + ] + ) ->getMockForAbstractClass(); $getCategoryCollectionMock = $this->createMock( \Magento\Framework\Data\Collection::class @@ -1217,8 +1219,10 @@ public function testSetMediaGalleryEntries() public function testGetMediaGalleryImagesMerging() { - $mediaEntries = [ - 'images' => [ + $mediaEntries = + [ + 'images' => + [ [ 'value_id' => 1, 'file' => 'imageFile.jpg', @@ -1233,24 +1237,28 @@ public function testGetMediaGalleryImagesMerging() 'file' => 'smallImageFile.jpg', 'media_type' => 'image', ], - ] - ]; - $expectedImageDataObject = new \Magento\Framework\DataObject([ + ] + ]; + $expectedImageDataObject = new \Magento\Framework\DataObject( + [ 'value_id' => 1, 'file' => 'imageFile.jpg', 'media_type' => 'image', 'url' => 'http://magento.dev/pub/imageFile.jpg', 'id' => 1, 'path' => '/var/www/html/pub/imageFile.jpg', - ]); - $expectedSmallImageDataObject = new \Magento\Framework\DataObject([ + ] + ); + $expectedSmallImageDataObject = new \Magento\Framework\DataObject( + [ 'value_id' => 2, 'file' => 'smallImageFile.jpg', 'media_type' => 'image', 'url' => 'http://magento.dev/pub/smallImageFile.jpg', 'id' => 2, 'path' => '/var/www/html/pub/smallImageFile.jpg', - ]); + ] + ); $directoryMock = $this->createMock(\Magento\Framework\Filesystem\Directory\ReadInterface::class); $directoryMock->method('getAbsolutePath')->willReturnOnConsecutiveCalls( diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php index 0316b2e374d2f..6370a4a7a27e2 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/Product/CollectionTest.php @@ -98,7 +98,7 @@ protected function setUp() ->disableOriginalConstructor() ->setMethods(['getStore', 'getId', 'getWebsiteId']) ->getMockForAbstractClass(); - $moduleManager = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $moduleManager = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); $catalogProductFlatState = $this->getMockBuilder(\Magento\Catalog\Model\Indexer\Product\Flat\State::class) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AdvancedPricingTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AdvancedPricingTest.php index 1a23aaace6e0f..e9f9349100f15 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AdvancedPricingTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AdvancedPricingTest.php @@ -11,7 +11,7 @@ use Magento\Customer\Api\GroupManagementInterface; use Magento\Customer\Api\GroupRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager; use Magento\Directory\Helper\Data as DirectoryHelper; use Magento\Catalog\Model\ResourceModel\Product as ProductResource; use Magento\Catalog\Model\ResourceModel\Eav\Attribute; @@ -106,7 +106,9 @@ protected function setUp() */ protected function createModel() { - return $this->objectManager->getObject(AdvancedPricing::class, [ + return $this->objectManager->getObject( + AdvancedPricing::class, + [ 'locator' => $this->locatorMock, 'storeManager' => $this->storeManagerMock, 'groupRepository' => $this->groupRepositoryMock, @@ -114,7 +116,8 @@ protected function createModel() 'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock, 'moduleManager' => $this->moduleManagerMock, 'directoryHelper' => $this->directoryHelperMock - ]); + ] + ); } public function testModifyMeta() diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php index 00132c6ad89e8..9ad75b5fda923 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php @@ -14,7 +14,7 @@ use Magento\Customer\Api\GroupManagementInterface; use Magento\Customer\Api\GroupRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager; use Magento\Ui\Component\Container; use Magento\Ui\Component\Form\Element\DataType\Number; use Magento\Ui\Component\Form\Element\DataType\Price; diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php index 7791dc761ae39..9bd9a895a2af9 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php @@ -119,7 +119,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param Product\OptionFactory $productOptionFactory @@ -153,7 +153,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, @@ -348,9 +348,11 @@ protected function _renderFiltersBefore() */ private function getTotalRecordsResolver(SearchResultInterface $searchResult): TotalRecordsResolverInterface { - return $this->totalRecordsResolverFactory->create([ + return $this->totalRecordsResolverFactory->create( + [ 'searchResult' => $searchResult, - ]); + ] + ); } /** @@ -360,14 +362,16 @@ private function getTotalRecordsResolver(SearchResultInterface $searchResult): T */ private function getSearchCriteriaResolver(): SearchCriteriaResolverInterface { - return $this->searchCriteriaResolverFactory->create([ + return $this->searchCriteriaResolverFactory->create( + [ 'builder' => $this->getSearchCriteriaBuilder(), 'collection' => $this, 'searchRequestName' => $this->searchRequestName, 'currentPage' => $this->_curPage, 'size' => $this->getPageSize(), 'orders' => $this->searchOrders, - ]); + ] + ); } /** @@ -378,12 +382,14 @@ private function getSearchCriteriaResolver(): SearchCriteriaResolverInterface */ private function getSearchResultApplier(SearchResultInterface $searchResult): SearchResultApplierInterface { - return $this->searchResultApplierFactory->create([ + return $this->searchResultApplierFactory->create( + [ 'collection' => $this, 'searchResult' => $searchResult, /** This variable sets by serOrder method, but doesn't have a getter method. */ 'orders' => $this->_orders - ]); + ] + ); } /** diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php index 59f6cd1c6e7eb..7e4b4f764f64b 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php @@ -146,7 +146,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -185,7 +185,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, @@ -461,9 +461,11 @@ private function isCurrentEngineMysql() */ private function getTotalRecordsResolver(SearchResultInterface $searchResult): TotalRecordsResolverInterface { - return $this->totalRecordsResolverFactory->create([ + return $this->totalRecordsResolverFactory->create( + [ 'searchResult' => $searchResult, - ]); + ] + ); } /** @@ -473,14 +475,16 @@ private function getTotalRecordsResolver(SearchResultInterface $searchResult): T */ private function getSearchCriteriaResolver(): SearchCriteriaResolverInterface { - return $this->searchCriteriaResolverFactory->create([ + return $this->searchCriteriaResolverFactory->create( + [ 'builder' => $this->getSearchCriteriaBuilder(), 'collection' => $this, 'searchRequestName' => $this->searchRequestName, 'currentPage' => $this->_curPage, 'size' => $this->getPageSize(), 'orders' => $this->searchOrders, - ]); + ] + ); } /** @@ -491,12 +495,14 @@ private function getSearchCriteriaResolver(): SearchCriteriaResolverInterface */ private function getSearchResultApplier(SearchResultInterface $searchResult): SearchResultApplierInterface { - return $this->searchResultApplierFactory->create([ + return $this->searchResultApplierFactory->create( + [ 'collection' => $this, 'searchResult' => $searchResult, /** This variable sets by serOrder method, but doesn't have a getter method. */ 'orders' => $this->_orders, - ]); + ] + ); } /** diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php index e625ccbe51fe3..6cdcc7c55a26f 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php @@ -50,7 +50,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -74,7 +74,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php index a43f074d8df67..4941bf8451bf8 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php @@ -85,7 +85,7 @@ class Renderer extends \Magento\Framework\View\Element\Template implements protected $priceCurrency; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ public $moduleManager; @@ -105,7 +105,7 @@ class Renderer extends \Magento\Framework\View\Element\Template implements * @param \Magento\Framework\Url\Helper\Data $urlHelper * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param PriceCurrencyInterface $priceCurrency - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param InterpretationStrategyInterface $messageInterpretationStrategy * @param array $data * @param ItemResolverInterface|null $itemResolver @@ -120,7 +120,7 @@ public function __construct( \Magento\Framework\Url\Helper\Data $urlHelper, \Magento\Framework\Message\ManagerInterface $messageManager, PriceCurrencyInterface $priceCurrency, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, InterpretationStrategyInterface $messageInterpretationStrategy, array $data = [], ItemResolverInterface $itemResolver = null @@ -185,6 +185,8 @@ public function getProductForThumbnail() } /** + * Override product url. + * * @param string $productUrl * @return $this * @codeCoverageIgnore @@ -313,11 +315,7 @@ public function getCheckoutSession() } /** - * Retrieve item messages - * Return array with keys - * - * text => the message text - * type => type of a message + * Retrieve item messages, return array with keys, text => the message text, type => type of a message * * @return array */ @@ -472,6 +470,8 @@ public function getProductPriceHtml(\Magento\Catalog\Model\Product $product) } /** + * Get price renderer. + * * @return \Magento\Framework\Pricing\Render * @codeCoverageIgnore */ diff --git a/app/code/Magento/Checkout/Block/Cart/Link.php b/app/code/Magento/Checkout/Block/Cart/Link.php index abc1ce4e31010..6ea5137521106 100644 --- a/app/code/Magento/Checkout/Block/Cart/Link.php +++ b/app/code/Magento/Checkout/Block/Cart/Link.php @@ -13,7 +13,7 @@ class Link extends \Magento\Framework\View\Element\Html\Link { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; @@ -24,14 +24,14 @@ class Link extends \Magento\Framework\View\Element\Html\Link /** * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Checkout\Helper\Cart $cartHelper * @param array $data * @codeCoverageIgnore */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Checkout\Helper\Cart $cartHelper, array $data = [] ) { @@ -41,6 +41,8 @@ public function __construct( } /** + * Get label. + * * @return string * @codeCoverageIgnore */ @@ -50,6 +52,8 @@ public function getLabel() } /** + * Get href. + * * @return string * @codeCoverageIgnore */ diff --git a/app/code/Magento/Checkout/Block/Link.php b/app/code/Magento/Checkout/Block/Link.php index cb2fb3309b83c..3d0740181f4a5 100644 --- a/app/code/Magento/Checkout/Block/Link.php +++ b/app/code/Magento/Checkout/Block/Link.php @@ -13,7 +13,7 @@ class Link extends \Magento\Framework\View\Element\Html\Link { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; @@ -24,14 +24,14 @@ class Link extends \Magento\Framework\View\Element\Html\Link /** * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Checkout\Helper\Data $checkoutHelper * @param array $data * @codeCoverageIgnore */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Checkout\Helper\Data $checkoutHelper, array $data = [] ) { @@ -41,6 +41,8 @@ public function __construct( } /** + * Get href. + * * @return string * @codeCoverageIgnore */ diff --git a/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php index 350f9954208fa..3cc80e14fd026 100644 --- a/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -43,7 +43,7 @@ protected function setUp() ); $this->checkoutSessionMock = $this->createPartialMock(\Magento\Checkout\Model\Session::class, ['clearStorage']); $this->requestMock = $this->createMock(\Magento\Framework\App\Request\Http::class); - $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\Manager::class); + $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\ModuleManagerInterface::class); $this->cacheConfigMock = $this->createMock(\Magento\PageCache\Model\Config::class); $this->depersonalizeCheckerMock = $this->createMock(\Magento\PageCache\Model\DepersonalizeChecker::class); diff --git a/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php b/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php index 78025587c49ba..db815ec87ed76 100644 --- a/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php +++ b/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php @@ -11,6 +11,8 @@ use Magento\Framework\App\ObjectManager; /** + * Abstract element. + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 */ @@ -38,7 +40,7 @@ abstract class AbstractElement implements StructureElementInterface protected $_storeManager; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -48,11 +50,15 @@ abstract class AbstractElement implements StructureElementInterface private $elementVisibility; /** + * Construct. + * * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager */ - public function __construct(StoreManagerInterface $storeManager, \Magento\Framework\Module\Manager $moduleManager) - { + public function __construct( + StoreManagerInterface $storeManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager + ) { $this->_storeManager = $storeManager; $this->moduleManager = $moduleManager; } diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/AbstractComposite.php b/app/code/Magento/Config/Model/Config/Structure/Element/AbstractComposite.php index 724772622c35b..efb918226aa31 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/AbstractComposite.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/AbstractComposite.php @@ -6,6 +6,9 @@ namespace Magento\Config\Model\Config\Structure\Element; /** + * Abstract Composite. + * + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 */ @@ -20,12 +23,12 @@ abstract class AbstractComposite extends \Magento\Config\Model\Config\Structure\ /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param Iterator $childrenIterator */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, Iterator $childrenIterator ) { parent::__construct($storeManager, $moduleManager); diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Field.php index 0a6a600b41dd4..6a8cc6e767466 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Field.php @@ -8,6 +8,8 @@ namespace Magento\Config\Model\Config\Structure\Element; /** + * Element field. + * * @api * @since 100.0.2 */ @@ -54,7 +56,7 @@ class Field extends \Magento\Config\Model\Config\Structure\AbstractElement /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Config\Model\Config\BackendFactory $backendFactory * @param \Magento\Config\Model\Config\SourceFactory $sourceFactory * @param \Magento\Config\Model\Config\CommentFactory $commentFactory @@ -63,7 +65,7 @@ class Field extends \Magento\Config\Model\Config\Structure\AbstractElement */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Config\Model\Config\BackendFactory $backendFactory, \Magento\Config\Model\Config\SourceFactory $sourceFactory, \Magento\Config\Model\Config\CommentFactory $commentFactory, @@ -243,6 +245,7 @@ public function getSectionId() */ public function getGroupPath() { + // phpcs:ignore Magento2.Functions.DiscouragedFunction return dirname($this->getConfigPath() ?: $this->getPath()); } diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Group.php b/app/code/Magento/Config/Model/Config/Structure/Element/Group.php index 8003132d2b822..db479e8b795a0 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Group.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Group.php @@ -7,6 +7,8 @@ namespace Magento\Config\Model\Config\Structure\Element; /** + * Group element. + * * @api * @since 100.0.2 */ @@ -27,14 +29,14 @@ class Group extends AbstractComposite /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param Iterator\Field $childrenIterator * @param \Magento\Config\Model\Config\BackendClone\Factory $cloneModelFactory * @param Dependency\Mapper $dependencyMapper */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Config\Model\Config\Structure\Element\Iterator\Field $childrenIterator, \Magento\Config\Model\Config\BackendClone\Factory $cloneModelFactory, \Magento\Config\Model\Config\Structure\Element\Dependency\Mapper $dependencyMapper diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Section.php b/app/code/Magento/Config/Model/Config/Structure/Element/Section.php index c3d927a1d6d1b..134411fbd87ca 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Section.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Section.php @@ -6,6 +6,8 @@ namespace Magento\Config\Model\Config\Structure\Element; /** + * Section + * * @api * @since 100.0.2 */ @@ -20,13 +22,13 @@ class Section extends AbstractComposite /** * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param Iterator $childrenIterator * @param \Magento\Framework\AuthorizationInterface $authorization */ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, Iterator $childrenIterator, \Magento\Framework\AuthorizationInterface $authorization ) { diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/AbstractCompositeTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/AbstractCompositeTest.php index 57d6fa28a7822..e448b628ef020 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/AbstractCompositeTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/AbstractCompositeTest.php @@ -8,6 +8,9 @@ use Magento\Config\Model\Config\Structure\ElementVisibilityInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +/** + * Abstract composite test. + */ class AbstractCompositeTest extends \PHPUnit\Framework\TestCase { /** @@ -26,7 +29,7 @@ class AbstractCompositeTest extends \PHPUnit\Framework\TestCase protected $_iteratorMock; /** - * @var \Magento\Framework\Module\Manager | \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface | \PHPUnit_Framework_MockObject_MockObject */ protected $moduleManagerMock; @@ -53,7 +56,7 @@ protected function setUp() ->getMockForAbstractClass(); $this->_iteratorMock = $this->createMock(\Magento\Config\Model\Config\Structure\Element\Iterator::class); $this->_storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManager::class); - $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\Manager::class); + $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\ModuleManagerInterface::class); $this->_model = $this->getMockForAbstractClass( \Magento\Config\Model\Config\Structure\Element\AbstractComposite::class, [$this->_storeManagerMock, $this->moduleManagerMock, $this->_iteratorMock] diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Plugin.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Plugin.php index 16fff36063219..e8b7299a03db9 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Plugin.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Plugin.php @@ -6,19 +6,22 @@ */ namespace Magento\ConfigurableProduct\Model\Product\Type; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; +/** + * Type plugin. + */ class Plugin { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager */ - public function __construct(Manager $moduleManager) + public function __construct(ModuleManagerInterface $moduleManager) { $this->moduleManager = $moduleManager; } diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index 59966768a2eda..a190ccde50b5a 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -23,7 +23,7 @@ class Register extends \Magento\Directory\Block\Data protected $_customerSession; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; @@ -41,7 +41,7 @@ class Register extends \Magento\Directory\Block\Data * @param \Magento\Framework\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory * @param \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\Url $customerUrl * @param array $data @@ -55,7 +55,7 @@ public function __construct( \Magento\Framework\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\ResourceModel\Region\CollectionFactory $regionCollectionFactory, \Magento\Directory\Model\ResourceModel\Country\CollectionFactory $countryCollectionFactory, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Url $customerUrl, array $data = [] diff --git a/app/code/Magento/Customer/Helper/Session/CurrentCustomer.php b/app/code/Magento/Customer/Helper/Session/CurrentCustomer.php index e6082de1da4e7..5cd09aca9f873 100644 --- a/app/code/Magento/Customer/Helper/Session/CurrentCustomer.php +++ b/app/code/Magento/Customer/Helper/Session/CurrentCustomer.php @@ -10,11 +10,12 @@ use Magento\Customer\Model\Session as CustomerSession; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\ViewInterface; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager; use Magento\Framework\View\LayoutInterface; /** * Class CurrentCustomer + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class CurrentCustomer { @@ -44,7 +45,7 @@ class CurrentCustomer protected $request; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; diff --git a/app/code/Magento/Customer/Model/Customer/Source/Group.php b/app/code/Magento/Customer/Model/Customer/Source/Group.php index e4c1d2e75be22..efcc7d0fe93a4 100644 --- a/app/code/Magento/Customer/Model/Customer/Source/Group.php +++ b/app/code/Magento/Customer/Model/Customer/Source/Group.php @@ -6,11 +6,14 @@ namespace Magento\Customer\Model\Customer\Source; use Magento\Customer\Api\Data\GroupSearchResultsInterface; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager; use Magento\Customer\Api\Data\GroupInterface; use Magento\Customer\Api\GroupRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; +/** + * Group. + */ class Group implements GroupSourceInterface { /** diff --git a/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php index d234ebfb334d6..b93b9f40d75b2 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Form/RegisterTest.php @@ -40,7 +40,7 @@ class RegisterTest extends \PHPUnit\Framework\TestCase /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\Session */ private $_customerSession; - /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Module\Manager */ + /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Module\ModuleManagerInterface */ private $_moduleManager; /** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Customer\Model\Url */ diff --git a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php index 364c3700cab26..03158d05db8e4 100644 --- a/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php +++ b/app/code/Magento/Customer/Test/Unit/Helper/Session/CurrentCustomerTest.php @@ -6,6 +6,9 @@ namespace Magento\Customer\Test\Unit\Helper\Session; +/** + * Current customer test. + */ class CurrentCustomerTest extends \PHPUnit\Framework\TestCase { /** @@ -44,7 +47,7 @@ class CurrentCustomerTest extends \PHPUnit\Framework\TestCase protected $requestMock; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManagerMock; @@ -77,7 +80,7 @@ protected function setUp() $this->customerDataMock = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); $this->customerRepositoryMock = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); $this->requestMock = $this->createMock(\Magento\Framework\App\Request\Http::class); - $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\Manager::class); + $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\ModuleManagerInterface::class); $this->viewMock = $this->createMock(\Magento\Framework\App\View::class); $this->currentCustomer = new \Magento\Customer\Helper\Session\CurrentCustomer( diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php index e07f2f0add972..9128d7c675262 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/Source/GroupTest.php @@ -6,12 +6,15 @@ namespace Magento\Customer\Test\Unit\Model\Customer\Source; use Magento\Customer\Model\Customer\Source\Group; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Customer\Api\GroupRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\Api\SearchCriteria; use Magento\Customer\Api\Data\GroupSearchResultsInterface; +/** + * Group test. + */ class GroupTest extends \PHPUnit\Framework\TestCase { /** @@ -20,7 +23,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase private $model; /** - * @var Manager|\PHPUnit_Framework_MockObject_MockObject + * @var ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ private $moduleManagerMock; @@ -46,7 +49,7 @@ class GroupTest extends \PHPUnit\Framework\TestCase protected function setUp() { - $this->moduleManagerMock = $this->getMockBuilder(Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); $this->groupRepositoryMock = $this->getMockBuilder(GroupRepositoryInterface::class) diff --git a/app/code/Magento/Deploy/Collector/Collector.php b/app/code/Magento/Deploy/Collector/Collector.php index 5974297a76cc7..7742f2971a2fe 100644 --- a/app/code/Magento/Deploy/Collector/Collector.php +++ b/app/code/Magento/Deploy/Collector/Collector.php @@ -9,7 +9,7 @@ use Magento\Deploy\Package\Package; use Magento\Deploy\Package\PackageFactory; use Magento\Deploy\Package\PackageFile; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\View\Asset\PreProcessor\FileNameResolver; /** @@ -46,7 +46,7 @@ class Collector implements CollectorInterface */ private $packageFactory; - /** @var \Magento\Framework\Module\Manager */ + /** @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManager; /** @@ -66,19 +66,19 @@ class Collector implements CollectorInterface * @param SourcePool $sourcePool * @param FileNameResolver $fileNameResolver * @param PackageFactory $packageFactory - * @param Manager|null $moduleManager + * @param ModuleManagerInterface|null $moduleManager */ public function __construct( SourcePool $sourcePool, FileNameResolver $fileNameResolver, PackageFactory $packageFactory, - Manager $moduleManager = null + ModuleManagerInterface $moduleManager = null ) { $this->sourcePool = $sourcePool; $this->fileNameResolver = $fileNameResolver; $this->packageFactory = $packageFactory; $this->moduleManager = $moduleManager ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\Module\Manager::class); + ->get(\Magento\Framework\Module\ModuleManagerInterface::class); } /** diff --git a/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php b/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php index 65073f267c859..51efc74738043 100644 --- a/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php @@ -15,6 +15,8 @@ use Magento\Framework\View\Element\Message\InterpretationStrategyInterface; /** + * Item renderer. + * * @api * @since 100.0.2 */ @@ -35,7 +37,7 @@ class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer * @param \Magento\Framework\Url\Helper\Data $urlHelper * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param PriceCurrencyInterface $priceCurrency - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param InterpretationStrategyInterface $messageInterpretationStrategy * @param \Magento\Downloadable\Helper\Catalog\Product\Configuration $downloadableProductConfiguration * @param array $data @@ -49,7 +51,7 @@ public function __construct( \Magento\Framework\Url\Helper\Data $urlHelper, \Magento\Framework\Message\ManagerInterface $messageManager, PriceCurrencyInterface $priceCurrency, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, InterpretationStrategyInterface $messageInterpretationStrategy, \Magento\Downloadable\Helper\Catalog\Product\Configuration $downloadableProductConfiguration, array $data = [] @@ -103,7 +105,8 @@ public function getOptionList() } /** - * Get list of all options for product + * Get list of all options for product. + * * @param \Magento\Catalog\Model\Product\Configuration\Item\ItemInterface $item * @return array */ diff --git a/app/code/Magento/GroupedProduct/Model/Product/Type/Plugin.php b/app/code/Magento/GroupedProduct/Model/Product/Type/Plugin.php index 866a55c265f83..4777b2bae07a5 100644 --- a/app/code/Magento/GroupedProduct/Model/Product/Type/Plugin.php +++ b/app/code/Magento/GroupedProduct/Model/Product/Type/Plugin.php @@ -6,19 +6,22 @@ */ namespace Magento\GroupedProduct\Model\Product\Type; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; +/** + * Plugin. + */ class Plugin { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager */ - public function __construct(Manager $moduleManager) + public function __construct(ModuleManagerInterface $moduleManager) { $this->moduleManager = $moduleManager; } diff --git a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Type/Grouped/AssociatedProductsCollection.php b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Type/Grouped/AssociatedProductsCollection.php index cbe1ef26c54b0..519da20510815 100644 --- a/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Type/Grouped/AssociatedProductsCollection.php +++ b/app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Type/Grouped/AssociatedProductsCollection.php @@ -21,7 +21,6 @@ class AssociatedProductsCollection extends \Magento\Catalog\Model\ResourceModel\ * @var \Magento\Framework\Registry */ protected $_coreRegistry = null; - /** * Product types config * @@ -42,7 +41,7 @@ class AssociatedProductsCollection extends \Magento\Catalog\Model\ResourceModel\ * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -68,7 +67,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php b/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php index 78fa2445ff583..cec7931c1c61f 100644 --- a/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php +++ b/app/code/Magento/GroupedProduct/Test/Unit/Model/ProductTest.php @@ -30,7 +30,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase protected $model; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManager; @@ -159,9 +159,14 @@ class ProductTest extends \PHPUnit\Framework\TestCase */ protected function setUp() { - $this->categoryIndexerMock = $this->getMockForAbstractClass(\Magento\Framework\Indexer\IndexerInterface::class); + $this->categoryIndexerMock = $this->getMockForAbstractClass( + \Magento\Framework\Indexer\IndexerInterface::class + ); - $this->moduleManager = $this->createPartialMock(\Magento\Framework\Module\Manager::class, ['isEnabled']); + $this->moduleManager = $this->createPartialMock( + \Magento\Framework\Module\ModuleManagerInterface::class, + ['isEnabled'] + ); $this->stockItemFactoryMock = $this->createPartialMock( \Magento\CatalogInventory\Api\Data\StockItemInterfaceFactory::class, ['create'] diff --git a/app/code/Magento/ImportExport/Model/Export/Config/Converter.php b/app/code/Magento/ImportExport/Model/Export/Config/Converter.php index 13b7e52c8d5a4..20ab81ec1cd5b 100644 --- a/app/code/Magento/ImportExport/Model/Export/Config/Converter.php +++ b/app/code/Magento/ImportExport/Model/Export/Config/Converter.php @@ -5,20 +5,23 @@ */ namespace Magento\ImportExport\Model\Export\Config; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\App\Utility\Classes; +/** + * Converter. + */ class Converter implements \Magento\Framework\Config\ConverterInterface { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** * @param Manager $moduleManager */ - public function __construct(Manager $moduleManager) + public function __construct(ModuleManagerInterface $moduleManager) { $this->moduleManager = $moduleManager; } diff --git a/app/code/Magento/ImportExport/Model/Import/Config/Converter.php b/app/code/Magento/ImportExport/Model/Import/Config/Converter.php index 8169b8fe63bbd..f2d1596ec3d9d 100644 --- a/app/code/Magento/ImportExport/Model/Import/Config/Converter.php +++ b/app/code/Magento/ImportExport/Model/Import/Config/Converter.php @@ -5,20 +5,23 @@ */ namespace Magento\ImportExport\Model\Import\Config; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\App\Utility\Classes; +/** + * Converter. + */ class Converter implements \Magento\Framework\Config\ConverterInterface { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager */ - public function __construct(Manager $moduleManager) + public function __construct(ModuleManagerInterface $moduleManager) { $this->moduleManager = $moduleManager; } diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php index 2e102d3ae3fab..c888c6b447348 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Export/Config/ConverterTest.php @@ -5,6 +5,9 @@ */ namespace Magento\ImportExport\Test\Unit\Model\Export\Config; +/** + * Converter test + */ class ConverterTest extends \PHPUnit\Framework\TestCase { /** @@ -18,7 +21,7 @@ class ConverterTest extends \PHPUnit\Framework\TestCase protected $filePath; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManager; diff --git a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php index 58f9a81474f25..b29a04322ce4f 100644 --- a/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php +++ b/app/code/Magento/ImportExport/Test/Unit/Model/Import/Config/ConverterTest.php @@ -5,6 +5,9 @@ */ namespace Magento\ImportExport\Test\Unit\Model\Import\Config; +/** + * Converter test + */ class ConverterTest extends \PHPUnit\Framework\TestCase { /** @@ -18,7 +21,7 @@ class ConverterTest extends \PHPUnit\Framework\TestCase protected $filePath; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManager; diff --git a/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php b/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php index ce618f97883b0..0b9cb377d1d08 100644 --- a/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php +++ b/app/code/Magento/LayeredNavigation/Observer/Edit/Tab/Front/ProductAttributeFormBuildFrontTabObserver.php @@ -8,7 +8,7 @@ namespace Magento\LayeredNavigation\Observer\Edit\Tab\Front; use Magento\Config\Model\Config\Source; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\Event\ObserverInterface; /** @@ -22,15 +22,15 @@ class ProductAttributeFormBuildFrontTabObserver implements ObserverInterface protected $optionList; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param Source\Yesno $optionList */ - public function __construct(Manager $moduleManager, Source\Yesno $optionList) + public function __construct(ModuleManagerInterface $moduleManager, Source\Yesno $optionList) { $this->optionList = $optionList; $this->moduleManager = $moduleManager; diff --git a/app/code/Magento/LayeredNavigation/Observer/Grid/ProductAttributeGridBuildObserver.php b/app/code/Magento/LayeredNavigation/Observer/Grid/ProductAttributeGridBuildObserver.php index 0f1c95df5313c..b98230c1ebe3c 100644 --- a/app/code/Magento/LayeredNavigation/Observer/Grid/ProductAttributeGridBuildObserver.php +++ b/app/code/Magento/LayeredNavigation/Observer/Grid/ProductAttributeGridBuildObserver.php @@ -7,25 +7,32 @@ */ namespace Magento\LayeredNavigation\Observer\Grid; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\Event\ObserverInterface; +/** + * Product attribute grid build observer + */ class ProductAttributeGridBuildObserver implements ObserverInterface { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** - * @param Manager $moduleManager + * Construct. + * + * @param ModuleManagerInterface $moduleManager */ - public function __construct(Manager $moduleManager) + public function __construct(ModuleManagerInterface $moduleManager) { $this->moduleManager = $moduleManager; } /** + * Execute. + * * @param \Magento\Framework\Event\Observer $observer * @return void */ diff --git a/app/code/Magento/NewRelicReporting/Model/Module/Collect.php b/app/code/Magento/NewRelicReporting/Model/Module/Collect.php index fe5389e258aa5..0d8a94fbed940 100644 --- a/app/code/Magento/NewRelicReporting/Model/Module/Collect.php +++ b/app/code/Magento/NewRelicReporting/Model/Module/Collect.php @@ -6,7 +6,7 @@ namespace Magento\NewRelicReporting\Model\Module; use Magento\Framework\Module\FullModuleList; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\Module\ModuleListInterface; use Magento\NewRelicReporting\Model\Config; use Magento\NewRelicReporting\Model\Module; @@ -22,7 +22,7 @@ class Collect protected $moduleList; /** - * @var Manager + * @var ModuleManagerInterface */ protected $moduleManager; @@ -46,14 +46,14 @@ class Collect * * @param ModuleListInterface $moduleList * @param FullModuleList $fullModuleList - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param \Magento\NewRelicReporting\Model\ModuleFactory $moduleFactory * @param \Magento\NewRelicReporting\Model\ResourceModel\Module\CollectionFactory $moduleCollectionFactory */ public function __construct( ModuleListInterface $moduleList, FullModuleList $fullModuleList, - Manager $moduleManager, + ModuleManagerInterface $moduleManager, \Magento\NewRelicReporting\Model\ModuleFactory $moduleFactory, \Magento\NewRelicReporting\Model\ResourceModel\Module\CollectionFactory $moduleCollectionFactory ) { diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php index 4286406d6e9ab..3c30d95b77de0 100644 --- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php +++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php @@ -8,7 +8,6 @@ use Magento\NewRelicReporting\Model\Module\Collect; use Magento\Framework\Module\FullModuleList; use Magento\Framework\Module\ModuleListInterface; -use Magento\Framework\Module\Manager; use Magento\NewRelicReporting\Model\Module; /** diff --git a/app/code/Magento/PageCache/Model/DepersonalizeChecker.php b/app/code/Magento/PageCache/Model/DepersonalizeChecker.php index 3023efb7a71a6..4012499d5da5a 100644 --- a/app/code/Magento/PageCache/Model/DepersonalizeChecker.php +++ b/app/code/Magento/PageCache/Model/DepersonalizeChecker.php @@ -20,7 +20,7 @@ class DepersonalizeChecker /** * Module manager * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManager; @@ -33,12 +33,12 @@ class DepersonalizeChecker /** * @param \Magento\Framework\App\RequestInterface $request - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param Config $cacheConfig */ public function __construct( \Magento\Framework\App\RequestInterface $request, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, Config $cacheConfig ) { $this->request = $request; diff --git a/app/code/Magento/PageCache/Test/Unit/Model/DepersonalizeCheckerTest.php b/app/code/Magento/PageCache/Test/Unit/Model/DepersonalizeCheckerTest.php index aeaeba9384129..6857c637bab84 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/DepersonalizeCheckerTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/DepersonalizeCheckerTest.php @@ -7,6 +7,9 @@ use Magento\PageCache\Model\DepersonalizeChecker; +/** + * Depersonalize checker test + */ class DepersonalizeCheckerTest extends \PHPUnit\Framework\TestCase { /** @@ -15,7 +18,7 @@ class DepersonalizeCheckerTest extends \PHPUnit\Framework\TestCase private $requestMock; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ private $moduleManagerMock; @@ -27,7 +30,7 @@ class DepersonalizeCheckerTest extends \PHPUnit\Framework\TestCase public function setup() { $this->requestMock = $this->createMock(\Magento\Framework\App\Request\Http::class); - $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\Manager::class); + $this->moduleManagerMock = $this->createMock(\Magento\Framework\Module\ModuleManagerInterface::class); $this->cacheConfigMock = $this->createMock(\Magento\PageCache\Model\Config::class); } diff --git a/app/code/Magento/Persistent/Test/Unit/Model/Layout/DepersonalizePluginTest.php b/app/code/Magento/Persistent/Test/Unit/Model/Layout/DepersonalizePluginTest.php index 9731811ea8a97..5ba0182ecc57a 100644 --- a/app/code/Magento/Persistent/Test/Unit/Model/Layout/DepersonalizePluginTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Model/Layout/DepersonalizePluginTest.php @@ -46,9 +46,17 @@ protected function setUp() $this->requestMock = $this->createMock(\Magento\Framework\App\Request\Http::class); - $this->moduleManagerMock = $this->createPartialMock(\Magento\Framework\Module\Manager::class, ['isEnabled']); - $this->cacheConfigMock = $this->createPartialMock(\Magento\PageCache\Model\Config::class, ['isEnabled']); - $this->depersonalizeCheckerMock = $this->createMock(\Magento\PageCache\Model\DepersonalizeChecker::class); + $this->moduleManagerMock = $this->createPartialMock( + \Magento\Framework\Module\ModuleManagerInterface::class, + ['isEnabled'] + ); + $this->cacheConfigMock = $this->createPartialMock( + \Magento\PageCache\Model\Config::class, + ['isEnabled'] + ); + $this->depersonalizeCheckerMock = $this->createMock( + \Magento\PageCache\Model\DepersonalizeChecker::class + ); $this->plugin = $this->objectManager->getObject( \Magento\Persistent\Model\Layout\DepersonalizePlugin::class, diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php index 966ee14c2cb64..d81f6c6f362dc 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php @@ -76,7 +76,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -104,7 +104,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Index/Collection/AbstractCollection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Index/Collection/AbstractCollection.php index 5b4cf39d65def..ec514f45ff65a 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Index/Collection/AbstractCollection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Index/Collection/AbstractCollection.php @@ -44,7 +44,7 @@ abstract class AbstractCollection extends \Magento\Catalog\Model\ResourceModel\P * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -69,7 +69,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php index 39d673911111f..c02de01117a74 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Lowstock/Collection.php @@ -63,7 +63,7 @@ class Collection extends \Magento\Reports\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -94,7 +94,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php index 038d37a990442..c8a16c2476824 100644 --- a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php +++ b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php @@ -26,7 +26,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Select; use Magento\Framework\Event\ManagerInterface; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface as Manager; use Magento\Framework\Stdlib\DateTime; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; diff --git a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php index d3bbdf9a7eb40..509e826e6f7d3 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php @@ -29,7 +29,7 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid * @param \Magento\Catalog\Model\Product\Type $type * @param \Magento\Catalog\Model\Product\Attribute\Source\Status $status * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Store\Model\ResourceModel\Website\CollectionFactory $websitesFactory * @param array $data * @@ -44,7 +44,7 @@ public function __construct( \Magento\Catalog\Model\Product\Type $type, \Magento\Catalog\Model\Product\Attribute\Source\Status $status, \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Store\Model\ResourceModel\Website\CollectionFactory $websitesFactory, array $data = [] ) { diff --git a/app/code/Magento/Review/Model/ResourceModel/Rating.php b/app/code/Magento/Review/Model/ResourceModel/Rating.php index 37a93d40b1107..42c14e16a50e2 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Rating.php +++ b/app/code/Magento/Review/Model/ResourceModel/Rating.php @@ -29,7 +29,7 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb protected $_storeManager; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -46,7 +46,7 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb /** * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Review\Summary $reviewSummary * @param string $connectionName @@ -55,7 +55,7 @@ class Rating extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb public function __construct( \Magento\Framework\Model\ResourceModel\Db\Context $context, \Psr\Log\LoggerInterface $logger, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\ResourceModel\Review\Summary $reviewSummary, $connectionName = null, diff --git a/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php b/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php index ab264ef1b6179..7175baa92a2f8 100644 --- a/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php +++ b/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php @@ -75,7 +75,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Framework\Validator\UniversalFactory $universalFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory @@ -103,7 +103,7 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Framework\Validator\UniversalFactory $universalFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Catalog\Model\Indexer\Product\Flat\State $catalogProductFlatState, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, diff --git a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php index f618651930dcd..e1e5503ad475f 100644 --- a/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php +++ b/app/code/Magento/Review/Test/Unit/Ui/DataProvider/Product/Form/Modifier/ReviewTest.php @@ -8,7 +8,7 @@ use Magento\Catalog\Test\Unit\Ui\DataProvider\Product\Form\Modifier\AbstractModifierTest; use Magento\Framework\UrlInterface; use Magento\Review\Ui\DataProvider\Product\Form\Modifier\Review; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\Manager as ModuleManager; use Magento\Ui\DataProvider\Modifier\ModifierInterface; /** @@ -39,10 +39,13 @@ protected function setUp() */ protected function createModel() { - $model = $this->objectManager->getObject(Review::class, [ + $model = $this->objectManager->getObject( + Review::class, + [ 'locator' => $this->locatorMock, 'urlBuilder' => $this->urlBuilderMock, - ]); + ] + ); $reviewClass = new \ReflectionClass(Review::class); $moduleManagerProperty = $reviewClass->getProperty('moduleManager'); diff --git a/app/code/Magento/Review/Ui/DataProvider/Product/Form/Modifier/Review.php b/app/code/Magento/Review/Ui/DataProvider/Product/Form/Modifier/Review.php index 727cd973de32d..433be1c860988 100644 --- a/app/code/Magento/Review/Ui/DataProvider/Product/Form/Modifier/Review.php +++ b/app/code/Magento/Review/Ui/DataProvider/Product/Form/Modifier/Review.php @@ -12,7 +12,7 @@ use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier; use Magento\Ui\Component\Form; use Magento\Framework\UrlInterface; -use Magento\Framework\Module\Manager as ModuleManager; +use \Magento\Framework\Module\ModuleManagerInterface as ModuleManager; use Magento\Framework\App\ObjectManager; /** @@ -59,7 +59,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @since 100.1.0 */ public function modifyMeta(array $meta) @@ -117,7 +117,7 @@ public function modifyMeta(array $meta) } /** - * {@inheritdoc} + * @inheritdoc * @since 100.1.0 */ public function modifyData(array $data) @@ -133,7 +133,6 @@ public function modifyData(array $data) * Retrieve module manager instance using dependency lookup to keep this class backward compatible. * * @return ModuleManager - * * @deprecated 100.2.0 */ private function getModuleManager() diff --git a/app/code/Magento/Search/Block/Adminhtml/Dashboard/Last.php b/app/code/Magento/Search/Block/Adminhtml/Dashboard/Last.php index 5ead8437f943a..ad8d247b2a6fb 100644 --- a/app/code/Magento/Search/Block/Adminhtml/Dashboard/Last.php +++ b/app/code/Magento/Search/Block/Adminhtml/Dashboard/Last.php @@ -24,7 +24,7 @@ class Last extends \Magento\Backend\Block\Dashboard\Grid protected $_queriesFactory; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; @@ -36,14 +36,14 @@ class Last extends \Magento\Backend\Block\Dashboard\Grid /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Search\Model\ResourceModel\Query\CollectionFactory $queriesFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Search\Model\ResourceModel\Query\CollectionFactory $queriesFactory, array $data = [] ) { @@ -53,6 +53,8 @@ public function __construct( } /** + * Construct. + * * @return void */ protected function _construct() @@ -62,6 +64,8 @@ protected function _construct() } /** + * Prepare collection. + * * @return $this * @throws \Magento\Framework\Exception\LocalizedException */ @@ -86,6 +90,8 @@ protected function _prepareCollection() } /** + * Prepare columns. + * * @return $this * @throws \Exception */ diff --git a/app/code/Magento/Search/Block/Adminhtml/Dashboard/Top.php b/app/code/Magento/Search/Block/Adminhtml/Dashboard/Top.php index 120e3121648fc..63893f788673d 100644 --- a/app/code/Magento/Search/Block/Adminhtml/Dashboard/Top.php +++ b/app/code/Magento/Search/Block/Adminhtml/Dashboard/Top.php @@ -24,7 +24,7 @@ class Top extends \Magento\Backend\Block\Dashboard\Grid protected $_queriesFactory; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; @@ -36,14 +36,14 @@ class Top extends \Magento\Backend\Block\Dashboard\Grid /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Search\Model\ResourceModel\Query\CollectionFactory $queriesFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Backend\Helper\Data $backendHelper, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Search\Model\ResourceModel\Query\CollectionFactory $queriesFactory, array $data = [] ) { @@ -53,6 +53,8 @@ public function __construct( } /** + * Construct. + * * @return void */ protected function _construct() @@ -62,7 +64,7 @@ protected function _construct() } /** - * {@inheritdoc} + * @inheritdoc */ protected function _prepareCollection() { @@ -86,7 +88,7 @@ protected function _prepareCollection() } /** - * {@inheritdoc} + * @inheritdoc */ protected function _prepareColumns() { @@ -119,7 +121,7 @@ protected function _prepareColumns() } /** - * {@inheritdoc} + * @inheritdoc */ public function getRowUrl($row) { diff --git a/app/code/Magento/Swatches/Observer/AddFieldsToAttributeObserver.php b/app/code/Magento/Swatches/Observer/AddFieldsToAttributeObserver.php index cfef5ab499e5d..3ef202af95a1a 100644 --- a/app/code/Magento/Swatches/Observer/AddFieldsToAttributeObserver.php +++ b/app/code/Magento/Swatches/Observer/AddFieldsToAttributeObserver.php @@ -6,7 +6,7 @@ namespace Magento\Swatches\Observer; use Magento\Config\Model\Config\Source; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\Event\Observer as EventObserver; use Magento\Framework\Event\ObserverInterface; @@ -21,21 +21,23 @@ class AddFieldsToAttributeObserver implements ObserverInterface protected $yesNo; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param Source\Yesno $yesNo */ - public function __construct(Manager $moduleManager, Source\Yesno $yesNo) + public function __construct(ModuleManagerInterface $moduleManager, Source\Yesno $yesNo) { $this->moduleManager = $moduleManager; $this->yesNo = $yesNo; } /** + * Execute. + * * @param \Magento\Framework\Event\Observer $observer * @return void */ diff --git a/app/code/Magento/Swatches/Observer/AddSwatchAttributeTypeObserver.php b/app/code/Magento/Swatches/Observer/AddSwatchAttributeTypeObserver.php index 3a517bd835146..ca75da3321698 100644 --- a/app/code/Magento/Swatches/Observer/AddSwatchAttributeTypeObserver.php +++ b/app/code/Magento/Swatches/Observer/AddSwatchAttributeTypeObserver.php @@ -6,7 +6,7 @@ namespace Magento\Swatches\Observer; use Magento\Config\Model\Config\Source; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\Event\Observer as EventObserver; use Magento\Framework\Event\ObserverInterface; @@ -16,19 +16,21 @@ class AddSwatchAttributeTypeObserver implements ObserverInterface { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; /** - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager */ - public function __construct(Manager $moduleManager) + public function __construct(ModuleManagerInterface $moduleManager) { $this->moduleManager = $moduleManager; } /** + * Execute. + * * @param \Magento\Framework\Event\Observer $observer * @return void */ diff --git a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php index 45c680366264b..f8ba5c20250ad 100644 --- a/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddFieldsToAttributeObserverTest.php @@ -10,7 +10,7 @@ */ class AddFieldsToAttributeObserverTest extends \PHPUnit\Framework\TestCase { - /** @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManagerMock; /** @var \Magento\Config\Model\Config\Source\Yesno|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php b/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php index f78797d93cb0d..24afa1045e5cb 100644 --- a/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php +++ b/app/code/Magento/Swatches/Test/Unit/Observer/AddSwatchAttributeTypeObserverTest.php @@ -10,7 +10,7 @@ */ class AddSwatchAttributeTypeObserverTest extends \PHPUnit\Framework\TestCase { - /** @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject */ + /** @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManagerMock; /** @var \Magento\Framework\Event\Observer|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/app/code/Magento/Tax/Model/App/Action/ContextPlugin.php b/app/code/Magento/Tax/Model/App/Action/ContextPlugin.php index 299d4db5e0d18..bba9bc3f3ebe7 100644 --- a/app/code/Magento/Tax/Model/App/Action/ContextPlugin.php +++ b/app/code/Magento/Tax/Model/App/Action/ContextPlugin.php @@ -34,7 +34,7 @@ class ContextPlugin /** * Module manager * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManager; @@ -50,7 +50,7 @@ class ContextPlugin * @param \Magento\Framework\App\Http\Context $httpContext * @param \Magento\Tax\Model\Calculation\Proxy $calculation * @param \Magento\Tax\Helper\Data $taxHelper - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\PageCache\Model\Config $cacheConfig */ public function __construct( @@ -58,7 +58,7 @@ public function __construct( \Magento\Framework\App\Http\Context $httpContext, \Magento\Tax\Model\Calculation\Proxy $calculation, \Magento\Tax\Helper\Data $taxHelper, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\PageCache\Model\Config $cacheConfig ) { $this->customerSession = $customerSession; @@ -70,6 +70,8 @@ public function __construct( } /** + * Before dispatch. + * * @param \Magento\Framework\App\ActionInterface $subject * @param \Magento\Framework\App\RequestInterface $request * @return mixed diff --git a/app/code/Magento/Tax/Observer/AfterAddressSaveObserver.php b/app/code/Magento/Tax/Observer/AfterAddressSaveObserver.php index 025a16a1aea55..ef84eac32e95a 100644 --- a/app/code/Magento/Tax/Observer/AfterAddressSaveObserver.php +++ b/app/code/Magento/Tax/Observer/AfterAddressSaveObserver.php @@ -8,11 +8,14 @@ use Magento\Customer\Model\Address; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\PageCache\Model\Config; use Magento\Tax\Api\TaxAddressManagerInterface; use Magento\Tax\Helper\Data; +/** + * After address save observer. + */ class AfterAddressSaveObserver implements ObserverInterface { /** @@ -23,7 +26,7 @@ class AfterAddressSaveObserver implements ObserverInterface /** * Module manager * - * @var Manager + * @var ModuleManagerInterface */ private $moduleManager; @@ -43,13 +46,13 @@ class AfterAddressSaveObserver implements ObserverInterface /** * @param Data $taxHelper - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param Config $cacheConfig * @param TaxAddressManagerInterface $addressManager */ public function __construct( Data $taxHelper, - Manager $moduleManager, + ModuleManagerInterface $moduleManager, Config $cacheConfig, TaxAddressManagerInterface $addressManager ) { @@ -60,6 +63,8 @@ public function __construct( } /** + * Execute. + * * @param Observer $observer * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) diff --git a/app/code/Magento/Tax/Observer/CustomerLoggedInObserver.php b/app/code/Magento/Tax/Observer/CustomerLoggedInObserver.php index eda7898e9a1b2..00b3a9f9e09ad 100644 --- a/app/code/Magento/Tax/Observer/CustomerLoggedInObserver.php +++ b/app/code/Magento/Tax/Observer/CustomerLoggedInObserver.php @@ -9,11 +9,15 @@ use Magento\Customer\Model\Session; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\PageCache\Model\Config; use Magento\Tax\Api\TaxAddressManagerInterface; use Magento\Tax\Helper\Data; +/** + * Customer logged in observer + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) + */ class CustomerLoggedInObserver implements ObserverInterface { /** @@ -29,7 +33,7 @@ class CustomerLoggedInObserver implements ObserverInterface /** * Module manager * - * @var Manager + * @var ModuleManagerInterface */ private $moduleManager; @@ -56,7 +60,7 @@ class CustomerLoggedInObserver implements ObserverInterface * @param GroupRepositoryInterface $groupRepository * @param Session $customerSession * @param Data $taxHelper - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param Config $cacheConfig * @param TaxAddressManagerInterface $addressManager */ @@ -64,7 +68,7 @@ public function __construct( GroupRepositoryInterface $groupRepository, Session $customerSession, Data $taxHelper, - Manager $moduleManager, + ModuleManagerInterface $moduleManager, Config $cacheConfig, TaxAddressManagerInterface $addressManager ) { @@ -77,6 +81,8 @@ public function __construct( } /** + * Execute. + * * @param Observer $observer * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) diff --git a/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php b/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php index 9a85ba0a9089b..020baa0c30ec5 100644 --- a/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php +++ b/app/code/Magento/Tax/Test/Unit/App/Action/ContextPluginTest.php @@ -5,6 +5,9 @@ */ namespace Magento\Tax\Test\Unit\App\Action; +/** + * Context plugin test + */ class ContextPluginTest extends \PHPUnit\Framework\TestCase { /** @@ -35,7 +38,7 @@ class ContextPluginTest extends \PHPUnit\Framework\TestCase /** * Module manager * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManagerMock; @@ -78,13 +81,15 @@ protected function setUp() $this->customerSessionMock = $this->getMockBuilder(\Magento\Customer\Model\Session::class) ->disableOriginalConstructor() - ->setMethods([ + ->setMethods( + [ 'getDefaultTaxBillingAddress', 'getDefaultTaxShippingAddress', 'getCustomerTaxClassId', 'getWebsiteId', 'isLoggedIn' - ]) + ] + ) ->getMock(); - $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php b/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php index 96b4b81ae2817..2e957e528e294 100644 --- a/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php +++ b/app/code/Magento/Tax/Test/Unit/Observer/AfterAddressSaveObserverTest.php @@ -6,7 +6,7 @@ namespace Magento\Tax\Test\Unit\Observer; use Magento\Framework\Event\Observer; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\PageCache\Model\Config; use Magento\Tax\Api\TaxAddressManagerInterface; @@ -31,7 +31,7 @@ class AfterAddressSaveObserverTest extends \PHPUnit\Framework\TestCase /** * Module manager * - * @var Manager|\PHPUnit_Framework_MockObject_MockObject + * @var ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ private $moduleManagerMock; @@ -65,7 +65,7 @@ protected function setUp() ->setMethods(['getCustomerAddress']) ->getMock(); - $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Tax/Test/Unit/Observer/CustomerLoggedInObserverTest.php b/app/code/Magento/Tax/Test/Unit/Observer/CustomerLoggedInObserverTest.php index 9e15e529288eb..facbb6733b5c8 100644 --- a/app/code/Magento/Tax/Test/Unit/Observer/CustomerLoggedInObserverTest.php +++ b/app/code/Magento/Tax/Test/Unit/Observer/CustomerLoggedInObserverTest.php @@ -8,6 +8,9 @@ use Magento\Tax\Api\TaxAddressManagerInterface; use PHPUnit_Framework_MockObject_MockObject as MockObject; +/** + * Customer logged in observer test + */ class CustomerLoggedInObserverTest extends \PHPUnit\Framework\TestCase { /** @@ -28,7 +31,7 @@ class CustomerLoggedInObserverTest extends \PHPUnit\Framework\TestCase /** * Module manager * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManagerMock; @@ -59,9 +62,11 @@ protected function setUp() $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->observerMock = $this->getMockBuilder(\Magento\Framework\Event\Observer::class) ->disableOriginalConstructor() - ->setMethods([ + ->setMethods( + [ 'getCustomerAddress', 'getData' - ]) + ] + ) ->getMock(); $this->groupRepositoryMock = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\GroupRepository::class) @@ -70,12 +75,14 @@ protected function setUp() $this->customerSessionMock = $this->getMockBuilder(\Magento\Customer\Model\Session::class) ->disableOriginalConstructor() - ->setMethods([ + ->setMethods( + [ 'setCustomerTaxClassId', 'setDefaultTaxBillingAddress', 'setDefaultTaxShippingAddress', 'setWebsiteId' - ]) + ] + ) ->getMock(); - $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml b/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml index 0fe801a71b937..5dc1e5c72313d 100644 --- a/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml +++ b/app/code/Magento/Tax/view/frontend/layout/sales_email_item_price.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> - + @@ -16,3 +17,10 @@ + + + + + + + diff --git a/app/code/Magento/Weee/Model/App/Action/ContextPlugin.php b/app/code/Magento/Weee/Model/App/Action/ContextPlugin.php index 8363365372f63..5d5426660d8f1 100644 --- a/app/code/Magento/Weee/Model/App/Action/ContextPlugin.php +++ b/app/code/Magento/Weee/Model/App/Action/ContextPlugin.php @@ -33,7 +33,7 @@ class ContextPlugin protected $weeeHelper; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManager; @@ -63,7 +63,7 @@ class ContextPlugin * @param \Magento\Weee\Model\Tax $weeeTax * @param \Magento\Tax\Helper\Data $taxHelper * @param \Magento\Weee\Helper\Data $weeeHelper - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\PageCache\Model\Config $cacheConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -74,7 +74,7 @@ public function __construct( \Magento\Weee\Model\Tax $weeeTax, \Magento\Tax\Helper\Data $taxHelper, \Magento\Weee\Helper\Data $weeeHelper, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\PageCache\Model\Config $cacheConfig, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig @@ -91,6 +91,8 @@ public function __construct( } /** + * Before dispatch. + * * @param \Magento\Framework\App\ActionInterface $subject * @param \Magento\Framework\App\RequestInterface $request * @return void @@ -159,6 +161,8 @@ public function beforeDispatch( } /** + * Get wee tax region. + * * @param string $basedOn * @return array */ diff --git a/app/code/Magento/Weee/Observer/AfterAddressSave.php b/app/code/Magento/Weee/Observer/AfterAddressSave.php index 1644ce43f86f0..9acea506adf67 100644 --- a/app/code/Magento/Weee/Observer/AfterAddressSave.php +++ b/app/code/Magento/Weee/Observer/AfterAddressSave.php @@ -8,11 +8,14 @@ use Magento\Customer\Model\Address; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\PageCache\Model\Config; use Magento\Tax\Api\TaxAddressManagerInterface; use Magento\Weee\Helper\Data; +/** + * @inheritDoc + */ class AfterAddressSave implements ObserverInterface { /** @@ -23,7 +26,7 @@ class AfterAddressSave implements ObserverInterface /** * Module manager * - * @var Manager + * @var ModuleManagerInterface */ private $moduleManager; @@ -43,13 +46,13 @@ class AfterAddressSave implements ObserverInterface /** * @param Data $weeeHelper - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param Config $cacheConfig * @param TaxAddressManagerInterface $addressManager */ public function __construct( Data $weeeHelper, - Manager $moduleManager, + ModuleManagerInterface $moduleManager, Config $cacheConfig, TaxAddressManagerInterface $addressManager ) { @@ -60,6 +63,8 @@ public function __construct( } /** + * Execute. + * * @param Observer $observer * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) diff --git a/app/code/Magento/Weee/Observer/CustomerLoggedIn.php b/app/code/Magento/Weee/Observer/CustomerLoggedIn.php index 8a498d628dabd..95299d96cabd2 100644 --- a/app/code/Magento/Weee/Observer/CustomerLoggedIn.php +++ b/app/code/Magento/Weee/Observer/CustomerLoggedIn.php @@ -8,12 +8,15 @@ use Magento\Customer\Model\Session; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\PageCache\Model\Config; use Magento\Tax\Api\TaxAddressManagerInterface; use Magento\Weee\Helper\Data; use Magento\Tax\Helper\Data as TaxHelper; +/** + * Customer logged in. + */ class CustomerLoggedIn implements ObserverInterface { /** @@ -49,13 +52,13 @@ class CustomerLoggedIn implements ObserverInterface /** * @param Data $weeeHelper - * @param Manager $moduleManager + * @param ModuleManagerInterface $moduleManager * @param Config $cacheConfig * @param TaxAddressManagerInterface $addressManager */ public function __construct( Data $weeeHelper, - Manager $moduleManager, + ModuleManagerInterface $moduleManager, Config $cacheConfig, TaxAddressManagerInterface $addressManager ) { @@ -66,6 +69,8 @@ public function __construct( } /** + * Execute. + * * @param Observer $observer * @return void * @SuppressWarnings(PHPMD.CyclomaticComplexity) diff --git a/app/code/Magento/Weee/Test/Unit/App/Action/ContextPluginTest.php b/app/code/Magento/Weee/Test/Unit/App/Action/ContextPluginTest.php index 5500350e243ad..b720f42378fa9 100644 --- a/app/code/Magento/Weee/Test/Unit/App/Action/ContextPluginTest.php +++ b/app/code/Magento/Weee/Test/Unit/App/Action/ContextPluginTest.php @@ -39,7 +39,7 @@ class ContextPluginTest extends \PHPUnit\Framework\TestCase protected $taxCalculationMock; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $moduleManagerMock; @@ -85,13 +85,15 @@ protected function setUp() $this->customerSessionMock = $this->getMockBuilder(\Magento\Customer\Model\Session::class) ->disableOriginalConstructor() - ->setMethods([ + ->setMethods( + [ 'getDefaultTaxBillingAddress', 'getDefaultTaxShippingAddress', 'getCustomerTaxClassId', 'getWebsiteId', 'isLoggedIn' - ]) + ] + ) ->getMock(); - $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php b/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php index 6d363847bf9e6..a7b88f5727126 100644 --- a/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php +++ b/app/code/Magento/Weee/Test/Unit/Observer/AfterAddressSaveTest.php @@ -9,6 +9,9 @@ use Magento\Tax\Api\TaxAddressManagerInterface; use PHPUnit_Framework_MockObject_MockObject as MockObject; +/** + * After address save test. + */ class AfterAddressSaveTest extends \PHPUnit\Framework\TestCase { /** @@ -24,7 +27,7 @@ class AfterAddressSaveTest extends \PHPUnit\Framework\TestCase /** * Module manager * - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ private $moduleManagerMock; @@ -58,7 +61,7 @@ protected function setUp() ->setMethods(['getCustomerAddress']) ->getMock(); - $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Weee/Test/Unit/Observer/CustomerLoggedInTest.php b/app/code/Magento/Weee/Test/Unit/Observer/CustomerLoggedInTest.php index aaca1c237aad1..06d1dbedcfd80 100644 --- a/app/code/Magento/Weee/Test/Unit/Observer/CustomerLoggedInTest.php +++ b/app/code/Magento/Weee/Test/Unit/Observer/CustomerLoggedInTest.php @@ -8,6 +8,9 @@ use Magento\Tax\Api\TaxAddressManagerInterface; use PHPUnit_Framework_MockObject_MockObject as MockObject; +/** + * Customer logged in test + */ class CustomerLoggedInTest extends \PHPUnit\Framework\TestCase { /** @@ -18,7 +21,7 @@ class CustomerLoggedInTest extends \PHPUnit\Framework\TestCase /** * Module manager * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManagerMock; @@ -49,12 +52,14 @@ protected function setUp() $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->observerMock = $this->getMockBuilder(\Magento\Framework\Event\Observer::class) ->disableOriginalConstructor() - ->setMethods([ + ->setMethods( + [ 'getCustomerAddress', 'getData' - ]) + ] + ) ->getMock(); - $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Wishlist/Test/Unit/Helper/RssTest.php b/app/code/Magento/Wishlist/Test/Unit/Helper/RssTest.php index d0397be83fac7..b55766d77fee3 100644 --- a/app/code/Magento/Wishlist/Test/Unit/Helper/RssTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/Helper/RssTest.php @@ -46,7 +46,7 @@ class RssTest extends \PHPUnit\Framework\TestCase protected $customerRepositoryMock; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $moduleManagerMock; @@ -80,7 +80,7 @@ protected function setUp() $this->customerRepositoryMock = $this->getMockBuilder(\Magento\Customer\Api\CustomerRepositoryInterface::class) ->getMock(); - $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\Manager::class) + $this->moduleManagerMock = $this->getMockBuilder(\Magento\Framework\Module\ModuleManagerInterface::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/etc/di.xml b/app/etc/di.xml index 200a56201239d..fd685361be92a 100755 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -65,6 +65,7 @@ + diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php index 844325540e407..b159dceadfb77 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Account/Dashboard/AddressTest.php @@ -9,6 +9,9 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\TestFramework\Helper\Bootstrap; +/** + * Class address test. + */ class AddressTest extends \PHPUnit\Framework\TestCase { /** @@ -66,7 +69,7 @@ public function testGetCustomer() public function testGetCustomerMissingCustomer() { - $moduleManager = $this->objectManager->get(\Magento\Framework\Module\Manager::class); + $moduleManager = $this->objectManager->get(\Magento\Framework\Module\ModuleManagerInterface::class); if ($moduleManager->isEnabled('Magento_PageCache')) { $customerDataFactory = $this->objectManager->create( \Magento\Customer\Api\Data\CustomerInterfaceFactory::class diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index ff8e7db0f4260..9417baea67ba9 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -1982,8 +1982,8 @@ ['_escapeDefaultValue', 'Magento\Framework\Code\Generator\EntityAbstract'], ['urlEncode', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Url\EncoderInterface::encode'], ['urlDecode', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Url\DecoderInterface::decode'], - ['isModuleEnabled', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Module\Manager::isEnabled()'], - ['isModuleOutputEnabled', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Module\Manager::isOutputEnabled()'], + ['isModuleEnabled', 'Magento\Framework\App\Helper\AbstractHelper', '\Magento\Framework\Module\ModuleManagerInterface::isEnabled()'], + ['isModuleOutputEnabled', 'Magento\Framework\App\Helper\AbstractHelper', '\Magento\Framework\Module\ModuleManagerInterface::isOutputEnabled()'], ['_packToTar', 'Magento\Framework\Archive\Tar'], ['_parseHeader', 'Magento\Framework\Archive\Tar'], ['getIdentities', 'Magento\Wishlist\Block\Link'], diff --git a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php index 1a76610bc0811..7875e0c8885f5 100644 --- a/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php +++ b/lib/internal/Magento/Framework/App/Helper/AbstractHelper.php @@ -27,7 +27,7 @@ abstract class AbstractHelper protected $_request; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; @@ -125,7 +125,7 @@ protected function _getModuleName() * * @param string $moduleName Full module name * @return boolean - * use \Magento\Framework\Module\Manager::isOutputEnabled() + * use \Magento\Framework\Module\ModuleManagerInterface::isOutputEnabled() */ public function isModuleOutputEnabled($moduleName = null) { diff --git a/lib/internal/Magento/Framework/App/Helper/Context.php b/lib/internal/Magento/Framework/App/Helper/Context.php index dc8afd061cba1..cc57f109cc8ec 100644 --- a/lib/internal/Magento/Framework/App/Helper/Context.php +++ b/lib/internal/Magento/Framework/App/Helper/Context.php @@ -21,7 +21,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface { /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ protected $_moduleManager; @@ -79,7 +79,7 @@ class Context implements \Magento\Framework\ObjectManager\ContextInterface * @param \Magento\Framework\Url\EncoderInterface $urlEncoder * @param \Magento\Framework\Url\DecoderInterface $urlDecoder * @param \Psr\Log\LoggerInterface $logger - * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Module\ModuleManagerInterface $moduleManager * @param \Magento\Framework\App\RequestInterface $httpRequest * @param \Magento\Framework\Cache\ConfigInterface $cacheConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager @@ -94,7 +94,7 @@ public function __construct( \Magento\Framework\Url\EncoderInterface $urlEncoder, \Magento\Framework\Url\DecoderInterface $urlDecoder, \Psr\Log\LoggerInterface $logger, - \Magento\Framework\Module\Manager $moduleManager, + \Magento\Framework\Module\ModuleManagerInterface $moduleManager, \Magento\Framework\App\RequestInterface $httpRequest, \Magento\Framework\Cache\ConfigInterface $cacheConfig, \Magento\Framework\Event\ManagerInterface $eventManager, @@ -117,7 +117,9 @@ public function __construct( } /** - * @return \Magento\Framework\Module\Manager + * Get module manager. + * + * @return \Magento\Framework\Module\ModuleManagerInterface */ public function getModuleManager() { @@ -125,6 +127,8 @@ public function getModuleManager() } /** + * Get url builder. + * * @return \Magento\Framework\UrlInterface */ public function getUrlBuilder() @@ -133,6 +137,8 @@ public function getUrlBuilder() } /** + * Get request. + * * @return \Magento\Framework\App\RequestInterface */ public function getRequest() @@ -141,6 +147,8 @@ public function getRequest() } /** + * Get cache configs. + * * @return \Magento\Framework\Cache\ConfigInterface */ public function getCacheConfig() @@ -149,6 +157,8 @@ public function getCacheConfig() } /** + * Get event manager. + * * @return \Magento\Framework\Event\ManagerInterface */ public function getEventManager() @@ -157,6 +167,8 @@ public function getEventManager() } /** + * Get logger. + * * @return \Psr\Log\LoggerInterface */ public function getLogger() @@ -165,6 +177,8 @@ public function getLogger() } /** + * Get http header. + * * @return \Magento\Framework\HTTP\Header */ public function getHttpHeader() @@ -173,6 +187,8 @@ public function getHttpHeader() } /** + * Get remote address. + * * @return \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress */ public function getRemoteAddress() @@ -181,6 +197,8 @@ public function getRemoteAddress() } /** + * Get url encoder. + * * @return \Magento\Framework\Url\EncoderInterface */ public function getUrlEncoder() @@ -189,6 +207,8 @@ public function getUrlEncoder() } /** + * Get url decoder. + * * @return \Magento\Framework\Url\DecoderInterface */ public function getUrlDecoder() @@ -197,6 +217,8 @@ public function getUrlDecoder() } /** + * Get scope config. + * * @return \Magento\Framework\App\Config\ScopeConfigInterface */ public function getScopeConfig() diff --git a/lib/internal/Magento/Framework/Module/Manager.php b/lib/internal/Magento/Framework/Module/Manager.php index a9a3d2294a90f..659ada3c20ac8 100644 --- a/lib/internal/Magento/Framework/Module/Manager.php +++ b/lib/internal/Magento/Framework/Module/Manager.php @@ -4,20 +4,17 @@ * See COPYING.txt for license details. */ +declare(strict_types=1); + /** * Module statuses manager */ namespace Magento\Framework\Module; /** - * Module status manager. - * - * Usage: - * ```php - * $manager->isEnabled('Vendor_Module'); - * ``` + * @inheritdoc */ -class Manager +class Manager implements ModuleManagerInterface { /** * @var Output\ConfigInterface @@ -52,12 +49,9 @@ public function __construct( } /** - * Whether a module is enabled in the configuration or not - * - * @param string $moduleName Fully-qualified module name - * @return boolean + * @inheritdoc */ - public function isEnabled($moduleName) + public function isEnabled(string $moduleName): bool { return $this->moduleList->has($moduleName); } diff --git a/lib/internal/Magento/Framework/Module/ModuleManagerInterface.php b/lib/internal/Magento/Framework/Module/ModuleManagerInterface.php new file mode 100644 index 0000000000000..decc91200354d --- /dev/null +++ b/lib/internal/Magento/Framework/Module/ModuleManagerInterface.php @@ -0,0 +1,26 @@ +isEnabled('Vendor_Module'); + * ``` + */ +interface ModuleManagerInterface +{ + /** + * Retrieve whether or not a module is enabled by configuration + * + * @param string $moduleName Fully-qualified module name, e.g. Magento_Config + * @return boolean Whether or not the module is enabled in the configuration + */ + public function isEnabled(string $moduleName): bool; +} diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php index 255f5783dbc60..e4cf4c41599e9 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/ManagerTest.php @@ -5,6 +5,9 @@ */ namespace Magento\Framework\Module\Test\Unit; +/** + * Manager test + */ class ManagerTest extends \PHPUnit\Framework\TestCase { /** @@ -13,7 +16,7 @@ class ManagerTest extends \PHPUnit\Framework\TestCase const XML_PATH_OUTPUT_ENABLED = 'custom/is_module_output_enabled'; /** - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $_model; @@ -35,11 +38,15 @@ protected function setUp() $this->_moduleList = $this->getMockForAbstractClass(\Magento\Framework\Module\ModuleListInterface::class); $this->_moduleList->expects($this->any()) ->method('getOne') - ->will($this->returnValueMap([ - ['Module_One', ['name' => 'One_Module', 'setup_version' => '1']], - ['Module_Two', ['name' => 'Two_Module', 'setup_version' => '2']], - ['Module_Three', ['name' => 'Two_Three']], - ])); + ->will( + $this->returnValueMap( + [ + ['Module_One', ['name' => 'One_Module', 'setup_version' => '1']], + ['Module_Two', ['name' => 'Two_Module', 'setup_version' => '2']], + ['Module_Three', ['name' => 'Two_Three']], + ] + ) + ); $this->_outputConfig = $this->getMockForAbstractClass(\Magento\Framework\Module\Output\ConfigInterface::class); $this->_model = new \Magento\Framework\Module\Manager( $this->_outputConfig, @@ -52,16 +59,21 @@ protected function setUp() public function testIsEnabled() { - $this->_moduleList->expects($this->exactly(2))->method('has')->will($this->returnValueMap([ - ['Module_Exists', true], - ['Module_NotExists', false], - ])); + $this->_moduleList->expects($this->exactly(2))->method('has')->will( + $this->returnValueMap( + [ + ['Module_Exists', true], + ['Module_NotExists', false], + ] + ) + ); $this->assertTrue($this->_model->isEnabled('Module_Exists')); $this->assertFalse($this->_model->isEnabled('Module_NotExists')); } public function testIsOutputEnabledReturnsFalseForDisabledModule() { + $this->_moduleList->expects($this->once())->method('has')->with('Disabled_Module')->willReturn(false); $this->_outputConfig->expects($this->any())->method('isSetFlag')->will($this->returnValue(true)); $this->assertFalse($this->_model->isOutputEnabled('Disabled_Module')); } diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/Plugin/DbStatusValidatorTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/Plugin/DbStatusValidatorTest.php index 72a9ba7df0e77..7a631eed1adbf 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/Plugin/DbStatusValidatorTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/Plugin/DbStatusValidatorTest.php @@ -9,6 +9,9 @@ use Magento\Framework\Module\DbVersionInfo; +/** + * DbStatus validator test. + */ class DbStatusValidatorTest extends \PHPUnit\Framework\TestCase { /** @@ -32,7 +35,7 @@ class DbStatusValidatorTest extends \PHPUnit\Framework\TestCase protected $requestMock; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\ModuleManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ private $moduleManager; diff --git a/lib/internal/Magento/Framework/View/File/Collector/Decorator/ModuleOutput.php b/lib/internal/Magento/Framework/View/File/Collector/Decorator/ModuleOutput.php index 34f32b2f6b7b2..71fa8d2c0ae6b 100644 --- a/lib/internal/Magento/Framework/View/File/Collector/Decorator/ModuleOutput.php +++ b/lib/internal/Magento/Framework/View/File/Collector/Decorator/ModuleOutput.php @@ -6,7 +6,7 @@ namespace Magento\Framework\View\File\Collector\Decorator; -use Magento\Framework\Module\Manager; +use Magento\Framework\Module\ModuleManagerInterface; use Magento\Framework\View\Design\ThemeInterface; use Magento\Framework\View\File; use Magento\Framework\View\File\CollectorInterface; @@ -26,7 +26,7 @@ class ModuleOutput implements CollectorInterface /** * Module manager * - * @var \Magento\Framework\Module\Manager + * @var \Magento\Framework\Module\ModuleManagerInterface */ private $moduleManager; @@ -38,7 +38,7 @@ class ModuleOutput implements CollectorInterface */ public function __construct( CollectorInterface $subject, - Manager $moduleManager + ModuleManagerInterface $moduleManager ) { $this->subject = $subject; $this->moduleManager = $moduleManager;