Skip to content
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/ProductRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ private function getCollectionProcessor()
{
if (!$this->collectionProcessor) {
$this->collectionProcessor = \Magento\Framework\App\ObjectManager::getInstance()->get(
// phpstan:ignore "Class Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor not found."
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
\Magento\Catalog\Model\Api\SearchCriteria\ProductCollectionProcessor::class
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
/**
* @category Magento
* @package Magento_CatalogInventory
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
Expand All @@ -11,25 +9,24 @@
namespace Magento\CatalogInventory\Model\Indexer\Stock\Action;

use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Model\Product\Type as ProductType;
use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher;
use Magento\CatalogInventory\Model\Indexer\Stock\BatchSizeManagement;
use Magento\CatalogInventory\Model\Indexer\Stock\AbstractAction;
use Magento\CatalogInventory\Model\Indexer\Stock\Processor;
use Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\DefaultStock;
use Magento\Framework\App\ResourceConnection;
use Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\StockInterface;
use Magento\CatalogInventory\Model\ResourceModel\Indexer\StockFactory;
use Magento\Catalog\Model\Product\Type as ProductType;
use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\ResourceConnection;
use Magento\Framework\DB\Query\BatchIteratorInterface;
use Magento\Framework\DB\Query\Generator as QueryGenerator;
use Magento\Framework\Indexer\CacheContext;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Indexer\BatchSizeManagementInterface;
use Magento\Framework\Indexer\BatchProviderInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Framework\Exception\LocalizedException;
use Magento\CatalogInventory\Model\Indexer\Stock\AbstractAction;
use Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\StockInterface;
use Magento\Framework\App\DeploymentConfig;
use Magento\CatalogInventory\Model\Indexer\Stock\Processor;
use Magento\Framework\Indexer\BatchProviderInterface;
use Magento\Framework\Indexer\BatchSizeManagementInterface;
use Magento\Framework\Indexer\CacheContext;

/**
* Class Full reindex action
Expand All @@ -41,7 +38,7 @@ class Full extends AbstractAction
/**
* Action type representation
*/
const ACTION_TYPE = 'full';
public const ACTION_TYPE = 'full';

/**
* @var MetadataPool
Expand Down Expand Up @@ -125,7 +122,7 @@ public function __construct(
$this->metadataPool = $metadataPool ?: ObjectManager::getInstance()->get(MetadataPool::class);
$this->batchProvider = $batchProvider ?: ObjectManager::getInstance()->get(BatchProviderInterface::class);
$this->batchSizeManagement = $batchSizeManagement ?: ObjectManager::getInstance()->get(
BatchSizeManagement::class
BatchSizeManagementInterface::class
);
$this->batchRowsCount = $batchRowsCount;
$this->activeTableSwitcher = $activeTableSwitcher ?: ObjectManager::getInstance()
Expand All @@ -151,6 +148,7 @@ public function execute($ids = null): void
$entityMetadata = $this->metadataPool->getMetadata(ProductInterface::class);

$columns = array_keys($this->_getConnection()->describeTable($this->_getIdxTable()));
$indexerTables = [];

/** @var DefaultStock $indexer */
foreach ($this->_getTypeIndexers() as $indexer) {
Expand All @@ -165,7 +163,7 @@ public function execute($ids = null): void
)
);

if (is_null($batchRowCount)) {
if ($batchRowCount === null) {
$batchRowCount = isset($this->batchRowsCount[$indexer->getTypeId()])
? $this->batchRowsCount[$indexer->getTypeId()]
: $this->batchRowsCount['default'];
Expand Down Expand Up @@ -202,8 +200,12 @@ public function execute($ids = null): void
$connection->query($query);
}
}

$indexerTables[] = $indexer->getMainTable();
}
$this->activeTableSwitcher->switchTable($indexer->getConnection(), [$indexer->getMainTable()]);

$indexerTables = array_unique($indexerTables);
$this->activeTableSwitcher->switchTable($this->_getConnection(), $indexerTables);
} catch (\Exception $e) {
throw new LocalizedException(__($e->getMessage()), $e);
}
Expand Down
9 changes: 3 additions & 6 deletions app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ public function __construct(
$this->priceCurrency = $priceCurrency;
$this->entityManager = $entityManager ?? ObjectManager::getInstance()->get(EntityManager::class);
$this->_associatedEntitiesMap = $associatedEntityMap ?? ObjectManager::getInstance()
// phpstan:ignore this is a virtual class
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
->get(\Magento\CatalogRule\Model\ResourceModel\Rule\AssociatedEntityMap::class)
->getData();

parent::__construct($context, $connectionName);
}

Expand Down Expand Up @@ -216,12 +217,8 @@ public function getRulesFromProduct($date, $websiteId, $customerGroupId, $produc
}

/**
* Load an object
* @inheritDoc
*
* @param \Magento\Framework\Model\AbstractModel $object
* @param mixed $value
* @param string $field
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function load(\Magento\Framework\Model\AbstractModel $object, $value, $field = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ public function addCustomerGroupFilter($customerGroupId)
*
* @return array
* @deprecated 100.1.0
* @see https://github.com/magento/magento2/commit/d063251cf0ce6717795fdb646a534cc0c2b22c05
*/
private function getAssociatedEntitiesMap()
{
if (!$this->_associatedEntitiesMap) {
$this->_associatedEntitiesMap = \Magento\Framework\App\ObjectManager::getInstance()
// phpstan:ignore
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
->get(\Magento\CatalogRule\Model\ResourceModel\Rule\AssociatedEntityMap::class)
->getData();
}
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Cms/Model/PageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ public function deleteById($pageId)
*
* @deprecated 102.0.0
* @return CollectionProcessorInterface
* @see https://github.com/magento/magento2/commit/eacac63d35b97961e3304dc007cd6b78519a93d0
*/
private function getCollectionProcessor()
{
if (!$this->collectionProcessor) {
// phpstan:ignore "Class Magento\Cms\Model\Api\SearchCriteria\PageCollectionProcessor not found."
$this->collectionProcessor = ObjectManager::getInstance()
->get(PageCollectionProcessor::class);
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
$this->collectionProcessor = ObjectManager::getInstance()->get(PageCollectionProcessor::class);
}
return $this->collectionProcessor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ public function execute(EventObserver $observer)
SmartButton::class => PaypalConfig::METHOD_WPS_EXPRESS,
\Magento\Paypal\Block\Express\Shortcut::class => PaypalConfig::METHOD_WPP_EXPRESS,
\Magento\Paypal\Block\Bml\Shortcut::class => PaypalConfig::METHOD_WPP_EXPRESS,
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
\Magento\Paypal\Block\WpsExpress\Shortcut::class => PaypalConfig::METHOD_WPS_EXPRESS,
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
\Magento\Paypal\Block\WpsBml\Shortcut::class => PaypalConfig::METHOD_WPS_EXPRESS,
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
\Magento\Paypal\Block\PayflowExpress\Shortcut::class => PaypalConfig::METHOD_WPP_PE_EXPRESS,
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
\Magento\Paypal\Block\Payflow\Bml\Shortcut::class => PaypalConfig::METHOD_WPP_PE_EXPRESS
];
foreach ($blocks as $blockInstanceName => $paymentMethodCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
*/
namespace Magento\Sales\Controller\Adminhtml\Creditmemo\AbstractCreditmemo;

use Magento\Framework\App\ResponseInterface;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\App\ResponseInterface;
use Magento\Sales\Api\CreditmemoRepositoryInterface;

class PrintAction extends \Magento\Backend\App\Action
class PrintAction extends \Magento\Backend\App\Action implements HttpGetActionInterface
{
/**
* Authorization level of a basic admin session
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo';
public const ADMIN_RESOURCE = 'Magento_Sales::sales_creditmemo';

/**
* @var \Magento\Framework\App\Response\Http\FileFactory
Expand Down Expand Up @@ -52,6 +53,8 @@ public function __construct(
}

/**
* Execute action based on request and return result
*
* @return ResponseInterface|\Magento\Backend\Model\View\Result\Forward
* @throws \Exception
*/
Expand All @@ -73,7 +76,7 @@ public function execute()
$fileContent = ['type' => 'string', 'value' => $pdf->render(), 'rm' => true];

return $this->_fileFactory->create(
\creditmemo::class . $date . '.pdf',
'creditmemo' . $date . '.pdf',
$fileContent,
DirectoryList::VAR_DIR,
'application/pdf'
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Sales/Test/Unit/Helper/ReorderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ReorderTest extends TestCase
protected $scopeConfigMock;

/**
* @var MockObject|\Magento\Sales\Model\Store
* @var MockObject|\Magento\Store\Model\Store
*/
protected $storeParam;

Expand Down Expand Up @@ -78,7 +78,7 @@ protected function setUp(): void
$this->repositoryMock
);

$this->storeParam = $this->getMockBuilder(\Magento\Sales\Model\Store::class)
$this->storeParam = $this->getMockBuilder(\Magento\Store\Model\Store::class)
->disableOriginalConstructor()
->getMock();

Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/SalesRule/Model/ResourceModel/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function __construct(
$this->string = $string;
$this->_resourceCoupon = $resourceCoupon;
$associatedEntitiesMapInstance = $associatedEntityMapInstance ?: ObjectManager::getInstance()->get(
// phpstan:ignore "Class Magento\SalesRule\Model\ResourceModel\Rule\AssociatedEntityMap not found."
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
\Magento\SalesRule\Model\ResourceModel\Rule\AssociatedEntityMap::class
);
$this->_associatedEntitiesMap = $associatedEntitiesMapInstance->getData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ private function getAssociatedEntitiesMap()
{
if (!$this->_associatedEntitiesMap) {
$this->_associatedEntitiesMap = \Magento\Framework\App\ObjectManager::getInstance()
// phpstan:ignore "Class Magento\SalesRule\Model\ResourceModel\Rule\AssociatedEntityMap not found."
// @phpstan-ignore-next-line - this is a virtual type defined in di.xml
->get(\Magento\SalesRule\Model\ResourceModel\Rule\AssociatedEntityMap::class)
->getData();
}
Expand Down