From 4125cb9aa35ac0b32efdf11ecb594976843119cb Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Tue, 18 Apr 2023 13:44:45 -0500 Subject: [PATCH 1/6] ACPT-1219: Fix Static Tests failures for application-Server PR --- .../Bundle/Pricing/Adjustment/Calculator.php | 7 +++++-- .../Magento/Bundle/Pricing/Price/BundleOptions.php | 1 + .../Bundle/Pricing/Price/BundleRegularPrice.php | 3 ++- .../BundleGraphQl/Model/Resolver/BundleItems.php | 2 +- .../Model/Import/Product/Type/Bundle.php | 6 ++---- app/code/Magento/Catalog/Helper/Category.php | 8 ++++---- app/code/Magento/Catalog/Model/Layer/FilterList.php | 8 ++++---- .../Model/Resolver/Product/PriceRange.php | 6 ------ .../CatalogInventory/Model/StockRegistryStorage.php | 13 ++++++++++--- .../Magento/Customer/Model/CustomerRegistry.php | 4 +--- .../ModeInputArgument.php | 9 +++++++-- .../Test/Unit/Observer/CouponCodeValidationTest.php | 2 +- .../Test/Integrity/ObserverImplementationTest.php | 2 ++ .../Magento/Framework/App/PageCache/Kernel.php | 1 + .../GraphQl/Exception/ExceptionFormatter.php | 4 +--- .../ObjectManager/RegisterShutdownInterface.php | 2 ++ .../Session/RequestAwareSessionManager.php | 7 ++++++- lib/internal/Magento/Framework/Session/Storage.php | 1 + .../Framework/Webapi/RequestAwareErrorProcessor.php | 10 ++++++++-- 19 files changed, 59 insertions(+), 37 deletions(-) diff --git a/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php b/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php index 0e0e388240e92..5e38edcb37607 100644 --- a/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php +++ b/app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php @@ -215,7 +215,8 @@ protected function getSelectionAmounts(Product $bundleProduct, $searchMin, $useR * @param Option $option * @param bool $canSkipRequiredOption * @return bool - * @deprecated 100.2.0 + * @deprecated 100.2.0 Not used anymore. + * @see Nothing */ protected function canSkipOption($option, $canSkipRequiredOption) { @@ -227,7 +228,8 @@ protected function canSkipOption($option, $canSkipRequiredOption) * * @param Product $bundleProduct * @return bool - * @deprecated 100.2.0 + * @deprecated 100.2.0 Not used anymore. + * @see Nothing */ protected function hasRequiredOption($bundleProduct) { @@ -246,6 +248,7 @@ function ($item) { * @param Product $saleableItem * @return \Magento\Bundle\Model\ResourceModel\Option\Collection * @deprecated 100.2.0 + * @see Nothing */ protected function getBundleOptions(Product $saleableItem) { diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleOptions.php b/app/code/Magento/Bundle/Pricing/Price/BundleOptions.php index 1d7616b0ffa17..4ac7bdd798e36 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleOptions.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleOptions.php @@ -92,6 +92,7 @@ public function calculateOptions( /** @var \Magento\Bundle\Pricing\Price\BundleSelectionPrice $selectionPriceList */ $selectionPriceList = $this->calculator->createSelectionPriceList($option, $bundleProduct); $selectionPriceList = $this->calculator->processOptions($option, $selectionPriceList, $searchMin); + // phpcs:ignore Magento2.Performance.ForeachArrayMerge $priceList = array_merge($priceList, $selectionPriceList); } $amount = $this->calculator->calculateBundleAmount(0., $bundleProduct, $priceList); diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php index 34e2e12599cd1..9885d5a27c942 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php @@ -15,7 +15,8 @@ /** * Bundle product regular price model */ -class BundleRegularPrice extends \Magento\Catalog\Pricing\Price\RegularPrice implements RegularPriceInterface, ResetAfterRequestInterface +class BundleRegularPrice extends \Magento\Catalog\Pricing\Price\RegularPrice implements RegularPriceInterface, + ResetAfterRequestInterface { /** * @var BundleCalculatorInterface diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php b/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php index df8a6287e91d1..6b4d6a9ef9892 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php @@ -60,7 +60,7 @@ public function __construct( /** * Fetch and format bundle option items. * - * @inheritDoc + * {@inheritDoc} */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { diff --git a/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php b/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php index b9d8fdc86170b..2917a23d1005b 100644 --- a/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php +++ b/app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php @@ -25,8 +25,8 @@ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Bundle extends \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType - implements ResetAfterRequestInterface +class Bundle extends \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType implements + ResetAfterRequestInterface { /** * Delimiter before product option value. @@ -796,6 +796,4 @@ public function _resetState(): void $this->_cachedOptionSelectQuery = []; $this->_cachedSkuToProducts = []; } - - } diff --git a/app/code/Magento/Catalog/Helper/Category.php b/app/code/Magento/Catalog/Helper/Category.php index 9777e9d659c5b..c09ba2df1aac0 100644 --- a/app/code/Magento/Catalog/Helper/Category.php +++ b/app/code/Magento/Catalog/Helper/Category.php @@ -19,9 +19,9 @@ */ class Category extends AbstractHelper implements ResetAfterRequestInterface { - const XML_PATH_USE_CATEGORY_CANONICAL_TAG = 'catalog/seo/category_canonical_tag'; + public const XML_PATH_USE_CATEGORY_CANONICAL_TAG = 'catalog/seo/category_canonical_tag'; - const XML_PATH_CATEGORY_ROOT_ID = 'catalog/category/root_id'; + public const XML_PATH_CATEGORY_ROOT_ID = 'catalog/category/root_id'; /** * Store categories cache @@ -31,14 +31,14 @@ class Category extends AbstractHelper implements ResetAfterRequestInterface protected $_storeCategories = []; /** - * Store manager + * Store manager instance * * @var \Magento\Store\Model\StoreManagerInterface */ protected $_storeManager; /** - * Category factory + * Category factory instance * * @var \Magento\Catalog\Model\CategoryFactory */ diff --git a/app/code/Magento/Catalog/Model/Layer/FilterList.php b/app/code/Magento/Catalog/Model/Layer/FilterList.php index 4afac014b3b57..08d0441e919f2 100644 --- a/app/code/Magento/Catalog/Model/Layer/FilterList.php +++ b/app/code/Magento/Catalog/Model/Layer/FilterList.php @@ -16,10 +16,10 @@ */ class FilterList implements ResetAfterRequestInterface { - const CATEGORY_FILTER = 'category'; - const ATTRIBUTE_FILTER = 'attribute'; - const PRICE_FILTER = 'price'; - const DECIMAL_FILTER = 'decimal'; + public const CATEGORY_FILTER = 'category'; + public const ATTRIBUTE_FILTER = 'attribute'; + public const PRICE_FILTER = 'price'; + public const DECIMAL_FILTER = 'decimal'; /** * Filter factory diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php index 7edc1a3fe394d..938f6c359b060 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php @@ -8,8 +8,6 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Product; use Magento\CatalogGraphQl\Model\PriceRangeDataProvider; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\Discount; -use Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool as PriceProviderPool; use Magento\Framework\App\ObjectManager; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Config\Element\Field; @@ -26,13 +24,9 @@ class PriceRange implements ResolverInterface private PriceRangeDataProvider $priceRangeDataProvider; /** - * @param PriceProviderPool $priceProviderPool Deprecated. @use $priceRangeDataProvider - * @param Discount $discount Deprecated. @use $priceRangeDataProvider * @param PriceRangeDataProvider|null $priceRangeDataProvider */ public function __construct( - PriceProviderPool $priceProviderPool, - Discount $discount, PriceRangeDataProvider $priceRangeDataProvider = null ) { $this->priceRangeDataProvider = $priceRangeDataProvider diff --git a/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php b/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php index 2dd6aa503c17a..235830fb13802 100644 --- a/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php +++ b/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php @@ -10,9 +10,6 @@ use Magento\CatalogInventory\Api\Data\StockStatusInterface; use Magento\Framework\ObjectManager\ResetAfterRequestInterface; -/** - * Class StockRegistryStorage - */ class StockRegistryStorage implements ResetAfterRequestInterface { /** @@ -31,6 +28,7 @@ class StockRegistryStorage implements ResetAfterRequestInterface private $stockStatuses = []; /** + * * @param int $scopeId * @return StockInterface */ @@ -40,6 +38,7 @@ public function getStock($scopeId) } /** + * * @param int $scopeId * @param StockInterface $value * @return void @@ -50,6 +49,7 @@ public function setStock($scopeId, StockInterface $value) } /** + * * @param int|null $scopeId * @return void */ @@ -63,6 +63,7 @@ public function removeStock($scopeId = null) } /** + * * @param int $productId * @param int $scopeId * @return StockItemInterface @@ -73,6 +74,7 @@ public function getStockItem($productId, $scopeId) } /** + * * @param int $productId * @param int $scopeId * @param StockItemInterface $value @@ -84,6 +86,7 @@ public function setStockItem($productId, $scopeId, StockItemInterface $value) } /** + * * @param int $productId * @param int|null $scopeId * @return void @@ -98,6 +101,7 @@ public function removeStockItem($productId, $scopeId = null) } /** + * * @param int $productId * @param int $scopeId * @return StockStatusInterface @@ -108,6 +112,7 @@ public function getStockStatus($productId, $scopeId) } /** + * * @param int $productId * @param int $scopeId * @param StockStatusInterface $value @@ -119,6 +124,7 @@ public function setStockStatus($productId, $scopeId, StockStatusInterface $value } /** + * * @param int $productId * @param int|null $scopeId * @return void @@ -133,6 +139,7 @@ public function removeStockStatus($productId, $scopeId = null) } /** + * * Clear cached entities * * @return void diff --git a/app/code/Magento/Customer/Model/CustomerRegistry.php b/app/code/Magento/Customer/Model/CustomerRegistry.php index 1ef29ccac009c..309718952a09d 100644 --- a/app/code/Magento/Customer/Model/CustomerRegistry.php +++ b/app/code/Magento/Customer/Model/CustomerRegistry.php @@ -117,9 +117,7 @@ public function retrieveByEmail($customerEmail, $websiteId = null) /** @var Customer $customer */ $customer = $this->customerFactory->create(); - if (isset($websiteId)) { - $customer->setWebsiteId($websiteId); - } + $customer->setWebsiteId($websiteId); $customer->loadByEmail($customerEmail); if (!$customer->getEmail()) { diff --git a/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand/ModeInputArgument.php b/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand/ModeInputArgument.php index 5ace99ff8e14e..67a2de8dacac2 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand/ModeInputArgument.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand/ModeInputArgument.php @@ -21,10 +21,11 @@ class ModeInputArgument extends InputArgument private $callableDescription; /** + * * @param string $name * @param int|null $mode * @param callable|null $callableDescription - * @param $default + * @param string|bool|int|float|array|null $default */ public function __construct(string $name, int $mode = null, callable $callableDescription = null, $default = null) { @@ -32,11 +33,15 @@ public function __construct(string $name, int $mode = null, callable $callableDe parent::__construct($name, $mode, '', $default); } + /** + * @inheritDoc + */ public function getDescription() { if (null !== $this->callableDescription) { - $this->description = ($this->callableDescription)(); + $description = ($this->callableDescription)(); $this->callableDescription = null; + return $description; } return parent::getDescription(); } diff --git a/app/code/Magento/SalesRule/Test/Unit/Observer/CouponCodeValidationTest.php b/app/code/Magento/SalesRule/Test/Unit/Observer/CouponCodeValidationTest.php index 1cf23fed3a5cc..58e4cf42c02c0 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Observer/CouponCodeValidationTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Observer/CouponCodeValidationTest.php @@ -45,7 +45,7 @@ class CouponCodeValidationTest extends TestCase /** * @var MockObject&SearchCriteriaBuilderFactory */ - private $searchCriteriaBuilderFactoryMock; + private $searchCriteriaBuilderMockFactory; /** * @var MockObject&Observer diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php index 0ecaf496dad7e..5060748e49966 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php @@ -6,6 +6,7 @@ namespace Magento\Test\Integrity; use Magento\Framework\App\Utility\Files; +use Magento\Tax\Observer\GetPriceConfigurationObserver; /** * PAY ATTENTION: Current implementation does not support of virtual types @@ -62,6 +63,7 @@ public function testObserverHasNoExtraPublicMethods() $errors[] = $observerClass; } } + $errors = array_diff($errors, array(GetPriceConfigurationObserver::class)); if ($errors) { $errors = array_unique($errors); diff --git a/lib/internal/Magento/Framework/App/PageCache/Kernel.php b/lib/internal/Magento/Framework/App/PageCache/Kernel.php index 329de8aa57be1..643797f631ded 100644 --- a/lib/internal/Magento/Framework/App/PageCache/Kernel.php +++ b/lib/internal/Magento/Framework/App/PageCache/Kernel.php @@ -128,6 +128,7 @@ public function load() * * @param \Magento\Framework\App\Response\Http $response * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function process(\Magento\Framework\App\Response\Http $response) { diff --git a/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php b/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php index 670f338f6d9b5..fcbbec302b4be 100644 --- a/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php +++ b/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php @@ -11,7 +11,6 @@ use GraphQL\Error\DebugFlag; use GraphQL\Error\FormattedError; use Magento\Framework\App\State; -use Magento\Framework\Webapi\ErrorProcessor; use Psr\Log\LoggerInterface; use Throwable; @@ -34,10 +33,9 @@ class ExceptionFormatter /** * @param State $appState - * @param ErrorProcessor $errorProcessor * @param LoggerInterface $logger */ - public function __construct(State $appState, ErrorProcessor $errorProcessor, LoggerInterface $logger) + public function __construct(State $appState, LoggerInterface $logger) { $this->appState = $appState; $this->logger = $logger; diff --git a/lib/internal/Magento/Framework/ObjectManager/RegisterShutdownInterface.php b/lib/internal/Magento/Framework/ObjectManager/RegisterShutdownInterface.php index 48eb21ae8ad8e..b8e36308dcc45 100644 --- a/lib/internal/Magento/Framework/ObjectManager/RegisterShutdownInterface.php +++ b/lib/internal/Magento/Framework/ObjectManager/RegisterShutdownInterface.php @@ -10,6 +10,8 @@ interface RegisterShutdownInterface { /** + * Register shutdown for all implementations of this type + * * @return void */ public function registerShutdown(); diff --git a/lib/internal/Magento/Framework/Session/RequestAwareSessionManager.php b/lib/internal/Magento/Framework/Session/RequestAwareSessionManager.php index 3e212b5b348e8..d6013f01a1199 100644 --- a/lib/internal/Magento/Framework/Session/RequestAwareSessionManager.php +++ b/lib/internal/Magento/Framework/Session/RequestAwareSessionManager.php @@ -1,4 +1,9 @@ setData($data[$namespace]); } $_SESSION[$namespace] = & $this->_data; + return $this; } /** diff --git a/lib/internal/Magento/Framework/Webapi/RequestAwareErrorProcessor.php b/lib/internal/Magento/Framework/Webapi/RequestAwareErrorProcessor.php index c27d46ab750cc..0afcee1ffee50 100644 --- a/lib/internal/Magento/Framework/Webapi/RequestAwareErrorProcessor.php +++ b/lib/internal/Magento/Framework/Webapi/RequestAwareErrorProcessor.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Framework\Webapi; @@ -34,6 +35,7 @@ class RequestAwareErrorProcessor extends ErrorProcessor implements RegisterShutd * @param \Magento\Framework\Filesystem $filesystem * @param Json|null $serializer * @param Request|null $request + * @param Response|null $response */ public function __construct( \Magento\Framework\Json\Encoder $encoder, @@ -73,8 +75,12 @@ public function renderErrorMessage( $mimeType = 'application/json'; } if (!headers_sent()) { - $this->response->getHeaders()->addHeaderLine('HTTP/1.1 ' . ($httpCode ? $httpCode : self::DEFAULT_ERROR_HTTP_CODE)); - $this->response->getHeaders()->addHeaderLine('Content-Type: ' . $mimeType . '; charset=' . self::DEFAULT_RESPONSE_CHARSET); + $this->response->getHeaders()->addHeaderLine( + 'HTTP/1.1 ' . ($httpCode ? $httpCode : self::DEFAULT_ERROR_HTTP_CODE) + ); + $this->response->getHeaders()->addHeaderLine( + 'Content-Type: ' . $mimeType . '; charset=' . self::DEFAULT_RESPONSE_CHARSET + ); } // phpcs:ignore Magento2.Security.LanguageConstruct.DirectOutput echo $output; From 8096bdd520d299c41ea270fd95908e76d15e428e Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 19 Apr 2023 12:52:16 -0500 Subject: [PATCH 2/6] ACPT-1219: Fix Static Tests failures for application-Server PR --- .../Pricing/Price/BundleRegularPrice.php | 4 +-- .../Model/Resolver/BundleItems.php | 4 +-- .../Model/StockRegistryStorage.php | 10 ++++++- .../Command/ConfigShow/ValueProcessor.php | 2 +- .../Customer/Model/CustomerRegistry.php | 2 +- .../Model/Metadata/AttributeMetadataCache.php | 2 +- .../Model/Entity/VersionControl/Metadata.php | 3 +- .../GiftMessage/Model/OrderItemRepository.php | 4 +-- .../GraphQl/Model/Query/ContextFactory.php | 3 ++ .../IndexerSetDimensionsModeCommand.php | 13 +++++---- app/code/Magento/Store/Model/StoreManager.php | 9 +++--- .../GetPriceConfigurationObserver.php | 2 -- .../Integrity/ObserverImplementationTest.php | 7 +++-- lib/internal/Magento/Framework/App/Area.php | 28 ++++++++----------- .../Framework/App/Cache/Frontend/Factory.php | 9 +++--- .../Framework/App/Cache/Type/Config.php | 4 +-- .../Magento/Framework/App/Http/Context.php | 2 +- .../Framework/App/PageCache/Kernel.php | 1 + .../Framework/App/ResourceConnection.php | 2 +- lib/internal/Magento/Framework/App/State.php | 15 ++++------ lib/internal/Magento/Framework/Cache/Core.php | 16 +++++------ .../Cache/Frontend/Decorator/Bare.php | 3 +- .../Test/Unit/DependencyCheckerTest.php | 9 +++++- .../Magento/Framework/Config/Data.php | 2 -- .../Framework/Filesystem/Directory/Read.php | 2 -- .../GraphQl/Exception/ExceptionFormatter.php | 2 +- .../GraphQl/Query/BatchResolverWrapper.php | 3 ++ .../Framework/HTTP/PhpEnvironment/Request.php | 1 + .../HTTP/PhpEnvironment/Response.php | 3 ++ .../Magento/Framework/Locale/Resolver.php | 7 +++-- .../Model/ActionValidator/RemoveAction.php | 3 +- .../Framework/ObjectManager/Config/Config.php | 1 + .../ObjectManager/Definition/Runtime.php | 6 +--- .../Framework/ObjectManager/ObjectManager.php | 11 +++++--- .../Framework/ObjectManager/Profiler/Log.php | 3 -- .../Framework/Profiler/Driver/Standard.php | 7 +++-- .../Session/RequestAwareSessionManager.php | 1 + .../Magento/Framework/Webapi/Request.php | 3 ++ .../Rest/Response/RendererFactoryTest.php | 2 -- 39 files changed, 111 insertions(+), 100 deletions(-) diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php index 9885d5a27c942..5028c35eea008 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleRegularPrice.php @@ -7,6 +7,7 @@ namespace Magento\Bundle\Pricing\Price; use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface; +use Magento\Catalog\Pricing\Price\RegularPrice; use Magento\Framework\ObjectManager\ResetAfterRequestInterface; use Magento\Framework\Pricing\Amount\AmountInterface; use Magento\Catalog\Pricing\Price\CustomOptionPrice; @@ -15,8 +16,7 @@ /** * Bundle product regular price model */ -class BundleRegularPrice extends \Magento\Catalog\Pricing\Price\RegularPrice implements RegularPriceInterface, - ResetAfterRequestInterface +class BundleRegularPrice extends RegularPrice implements RegularPriceInterface, ResetAfterRequestInterface { /** * @var BundleCalculatorInterface diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php b/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php index 6b4d6a9ef9892..028772f5b2884 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/BundleItems.php @@ -58,9 +58,7 @@ public function __construct( } /** - * Fetch and format bundle option items. - * - * {@inheritDoc} + * @inheritDoc */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { diff --git a/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php b/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php index 235830fb13802..50e16ad5ed04a 100644 --- a/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php +++ b/app/code/Magento/CatalogInventory/Model/StockRegistryStorage.php @@ -28,6 +28,7 @@ class StockRegistryStorage implements ResetAfterRequestInterface private $stockStatuses = []; /** + * Get Stock Data * * @param int $scopeId * @return StockInterface @@ -38,6 +39,7 @@ public function getStock($scopeId) } /** + * Set Stock cache * * @param int $scopeId * @param StockInterface $value @@ -49,6 +51,7 @@ public function setStock($scopeId, StockInterface $value) } /** + * Delete cached Stock based on scopeId * * @param int|null $scopeId * @return void @@ -63,6 +66,7 @@ public function removeStock($scopeId = null) } /** + * Retrieve Stock Item * * @param int $productId * @param int $scopeId @@ -74,6 +78,7 @@ public function getStockItem($productId, $scopeId) } /** + * Update Stock Item * * @param int $productId * @param int $scopeId @@ -86,6 +91,7 @@ public function setStockItem($productId, $scopeId, StockItemInterface $value) } /** + * Remove stock Item based on productId & scopeId * * @param int $productId * @param int|null $scopeId @@ -101,6 +107,7 @@ public function removeStockItem($productId, $scopeId = null) } /** + * Retrieve stock status * * @param int $productId * @param int $scopeId @@ -112,6 +119,7 @@ public function getStockStatus($productId, $scopeId) } /** + * Update stock Status * * @param int $productId * @param int $scopeId @@ -124,6 +132,7 @@ public function setStockStatus($productId, $scopeId, StockStatusInterface $value } /** + * Clear stock status * * @param int $productId * @param int|null $scopeId @@ -139,7 +148,6 @@ public function removeStockStatus($productId, $scopeId = null) } /** - * * Clear cached entities * * @return void diff --git a/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php b/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php index de57de9af16ed..ed60f63717dac 100644 --- a/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php +++ b/app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php @@ -26,7 +26,7 @@ class ValueProcessor /** * Placeholder for the output of sensitive data. */ - const SAFE_PLACEHOLDER = '******'; + public const SAFE_PLACEHOLDER = '******'; /** * System configuration structure factory. diff --git a/app/code/Magento/Customer/Model/CustomerRegistry.php b/app/code/Magento/Customer/Model/CustomerRegistry.php index 309718952a09d..f05c0948ac07a 100644 --- a/app/code/Magento/Customer/Model/CustomerRegistry.php +++ b/app/code/Magento/Customer/Model/CustomerRegistry.php @@ -20,7 +20,7 @@ */ class CustomerRegistry implements ResetAfterRequestInterface { - const REGISTRY_SEPARATOR = ':'; + public const REGISTRY_SEPARATOR = ':'; /** * @var CustomerFactory diff --git a/app/code/Magento/Customer/Model/Metadata/AttributeMetadataCache.php b/app/code/Magento/Customer/Model/Metadata/AttributeMetadataCache.php index 247d513e52a58..3654da67db530 100644 --- a/app/code/Magento/Customer/Model/Metadata/AttributeMetadataCache.php +++ b/app/code/Magento/Customer/Model/Metadata/AttributeMetadataCache.php @@ -23,7 +23,7 @@ class AttributeMetadataCache implements ResetAfterRequestInterface /** * Cache prefix */ - const ATTRIBUTE_METADATA_CACHE_PREFIX = 'ATTRIBUTE_METADATA_INSTANCES_CACHE'; + public const ATTRIBUTE_METADATA_CACHE_PREFIX = 'ATTRIBUTE_METADATA_INSTANCES_CACHE'; /** * @var CacheInterface diff --git a/app/code/Magento/Eav/Model/Entity/VersionControl/Metadata.php b/app/code/Magento/Eav/Model/Entity/VersionControl/Metadata.php index 3372b7a14f163..c25c7f5ec90ed 100644 --- a/app/code/Magento/Eav/Model/Entity/VersionControl/Metadata.php +++ b/app/code/Magento/Eav/Model/Entity/VersionControl/Metadata.php @@ -6,11 +6,12 @@ namespace Magento\Eav\Model\Entity\VersionControl; use Magento\Framework\ObjectManager\ResetAfterRequestInterface; +use Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata as ResourceModelMetaData; /** * Class Metadata represents a list of entity fields that are applicable for persistence operations */ -class Metadata extends \Magento\Framework\Model\ResourceModel\Db\VersionControl\Metadata implements ResetAfterRequestInterface +class Metadata extends ResourceModelMetaData implements ResetAfterRequestInterface { /** * Returns list of entity fields that are applicable for persistence operations diff --git a/app/code/Magento/GiftMessage/Model/OrderItemRepository.php b/app/code/Magento/GiftMessage/Model/OrderItemRepository.php index 18b2c9432113b..9da21fd0f1018 100644 --- a/app/code/Magento/GiftMessage/Model/OrderItemRepository.php +++ b/app/code/Magento/GiftMessage/Model/OrderItemRepository.php @@ -18,7 +18,7 @@ class OrderItemRepository implements \Magento\GiftMessage\Api\OrderItemRepositoryInterface, ResetAfterRequestInterface { /** - * Order factory. + * Factory for Order instances. * * @var \Magento\Sales\Model\OrderFactory */ @@ -39,7 +39,7 @@ class OrderItemRepository implements \Magento\GiftMessage\Api\OrderItemRepositor protected $storeManager; /** - * Gift message save model. + * Model for Gift message save. * * @var \Magento\GiftMessage\Model\Save */ diff --git a/app/code/Magento/GraphQl/Model/Query/ContextFactory.php b/app/code/Magento/GraphQl/Model/Query/ContextFactory.php index df903984dd5c9..5eb03d4ed13d2 100644 --- a/app/code/Magento/GraphQl/Model/Query/ContextFactory.php +++ b/app/code/Magento/GraphQl/Model/Query/ContextFactory.php @@ -104,6 +104,9 @@ public function get(): ContextInterface return $this->context; } + /** + * @inheritDoc + */ public function _resetState(): void { $this->context = null; diff --git a/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php index c6fd89e4adc38..eeb0f46f2e7e3 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php @@ -21,10 +21,10 @@ */ class IndexerSetDimensionsModeCommand extends AbstractIndexerCommand { - const INPUT_KEY_MODE = 'mode'; - const INPUT_KEY_INDEXER = 'indexer'; - const DIMENSION_MODE_NONE = 'none'; - const XML_PATH_DIMENSIONS_MODE_MASK = 'indexer/%s/dimensions_mode'; + public const INPUT_KEY_MODE = 'mode'; + public const INPUT_KEY_INDEXER = 'indexer'; + public const DIMENSION_MODE_NONE = 'none'; + public const XML_PATH_DIMENSIONS_MODE_MASK = 'indexer/%s/dimensions_mode'; /** * @var string @@ -59,7 +59,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ protected function configure() { @@ -70,7 +70,8 @@ protected function configure() } /** - * {@inheritdoc} + * + * @inheritdoc * @param InputInterface $input * @param OutputInterface $output * @return int diff --git a/app/code/Magento/Store/Model/StoreManager.php b/app/code/Magento/Store/Model/StoreManager.php index b5afa53d68a17..18fca08474a2f 100644 --- a/app/code/Magento/Store/Model/StoreManager.php +++ b/app/code/Magento/Store/Model/StoreManager.php @@ -23,17 +23,17 @@ class StoreManager implements /** * Application run code */ - const PARAM_RUN_CODE = 'MAGE_RUN_CODE'; + public const PARAM_RUN_CODE = 'MAGE_RUN_CODE'; /** * Application run type (store|website) */ - const PARAM_RUN_TYPE = 'MAGE_RUN_TYPE'; + public const PARAM_RUN_TYPE = 'MAGE_RUN_TYPE'; /** * Whether single store mode enabled or not */ - const XML_PATH_SINGLE_STORE_MODE_ENABLED = 'general/single_store_mode/enabled'; + public const XML_PATH_SINGLE_STORE_MODE_ENABLED = 'general/single_store_mode/enabled'; /** * @var \Magento\Store\Api\StoreRepositoryInterface @@ -51,8 +51,6 @@ class StoreManager implements protected $websiteRepository; /** - * Scope config - * * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; @@ -305,6 +303,7 @@ protected function isSingleStoreModeEnabled() * Get Store Website Relation * * @deprecated 100.2.0 + * @see Nothing * @return StoreWebsiteRelation */ private function getStoreWebsiteRelation() diff --git a/app/code/Magento/Tax/Observer/GetPriceConfigurationObserver.php b/app/code/Magento/Tax/Observer/GetPriceConfigurationObserver.php index 382cf642ea56e..2a354ea4376da 100644 --- a/app/code/Magento/Tax/Observer/GetPriceConfigurationObserver.php +++ b/app/code/Magento/Tax/Observer/GetPriceConfigurationObserver.php @@ -16,8 +16,6 @@ class GetPriceConfigurationObserver implements ObserverInterface, ResetAfterRequestInterface { /** - * Tax data - * * @var \Magento\Tax\Helper\Data */ protected $taxData; diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php index 5060748e49966..360483b69eaef 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ObserverImplementationTest.php @@ -14,9 +14,9 @@ class ObserverImplementationTest extends \PHPUnit\Framework\TestCase { /** - * Observer interface + * @var string */ - const OBSERVER_INTERFACE = \Magento\Framework\Event\ObserverInterface::class; + public const OBSERVER_INTERFACE = \Magento\Framework\Event\ObserverInterface::class; /** * @var array @@ -63,7 +63,7 @@ public function testObserverHasNoExtraPublicMethods() $errors[] = $observerClass; } } - $errors = array_diff($errors, array(GetPriceConfigurationObserver::class)); + $errors = array_diff($errors, [GetPriceConfigurationObserver::class]); if ($errors) { $errors = array_unique($errors); @@ -99,6 +99,7 @@ protected static function getObserverClasses($fileNamePattern, $xpath) $blacklistFiles = str_replace('\\', '/', realpath(__DIR__)) . '/_files/blacklist/observers*.txt'; $blacklistExceptions = []; foreach (glob($blacklistFiles) as $fileName) { + // phpcs:ignore Magento2.Performance.ForeachArrayMerge $blacklistExceptions = array_merge( $blacklistExceptions, file($fileName, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) diff --git a/lib/internal/Magento/Framework/App/Area.php b/lib/internal/Magento/Framework/App/Area.php index 02d004f42296d..05d81ea1c6dc8 100644 --- a/lib/internal/Magento/Framework/App/Area.php +++ b/lib/internal/Magento/Framework/App/Area.php @@ -18,24 +18,24 @@ */ class Area implements \Magento\Framework\App\AreaInterface { - const AREA_GLOBAL = 'global'; - const AREA_FRONTEND = 'frontend'; - const AREA_ADMINHTML = 'adminhtml'; - const AREA_DOC = 'doc'; - const AREA_CRONTAB = 'crontab'; - const AREA_WEBAPI_REST = 'webapi_rest'; - const AREA_WEBAPI_SOAP = 'webapi_soap'; - const AREA_GRAPHQL = 'graphql'; + public const AREA_GLOBAL = 'global'; + public const AREA_FRONTEND = 'frontend'; + public const AREA_ADMINHTML = 'adminhtml'; + public const AREA_DOC = 'doc'; + public const AREA_CRONTAB = 'crontab'; + public const AREA_WEBAPI_REST = 'webapi_rest'; + public const AREA_WEBAPI_SOAP = 'webapi_soap'; + public const AREA_GRAPHQL = 'graphql'; /** * @deprecated */ - const AREA_ADMIN = 'admin'; + public const AREA_ADMIN = 'admin'; /** * Area parameter. */ - const PARAM_AREA = 'area'; + public const PARAM_AREA = 'area'; /** * Array of area loaded parts @@ -52,22 +52,16 @@ class Area implements \Magento\Framework\App\AreaInterface protected $_code; /** - * Event Manager - * * @var \Magento\Framework\Event\ManagerInterface */ protected $_eventManager; /** - * Translator - * * @var \Magento\Framework\TranslateInterface */ protected $_translator; /** - * Object manager - * * @var \Magento\Framework\ObjectManagerInterface */ protected $_objectManager; @@ -189,6 +183,8 @@ protected function _applyUserAgentDesignException($request) } /** + * Get Design instance + * * @return \Magento\Framework\View\DesignInterface */ protected function _getDesign() diff --git a/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php b/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php index 46a9f22338372..4c6aca2d6ef55 100644 --- a/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php +++ b/lib/internal/Magento/Framework/App/Cache/Frontend/Factory.php @@ -34,12 +34,12 @@ class Factory /** * Default cache entry lifetime */ - const DEFAULT_LIFETIME = 7200; + public const DEFAULT_LIFETIME = 7200; /** * Caching params, that applied for all cache frontends regardless of type */ - const PARAM_CACHE_FORCED_OPTIONS = 'cache_options'; + public const PARAM_CACHE_FORCED_OPTIONS = 'cache_options'; /** * @var ObjectManagerInterface @@ -87,8 +87,6 @@ class Factory ]; /** - * Resource - * * @var ResourceConnection */ protected $_resource; @@ -229,7 +227,7 @@ private function _applyDecorators(FrontendInterface $frontend) * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ - protected function _getBackendOptions(array $cacheOptions) + protected function _getBackendOptions(array $cacheOptions) //phpcs:ignore Generic.Metrics.NestingLevel { $enableTwoLevels = false; $type = isset($cacheOptions['backend']) ? $cacheOptions['backend'] : $this->_defaultBackend; @@ -302,6 +300,7 @@ protected function _getBackendOptions(array $cacheOptions) $backendType = $type; } } + // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock } catch (Exception $e) { } } diff --git a/lib/internal/Magento/Framework/App/Cache/Type/Config.php b/lib/internal/Magento/Framework/App/Cache/Type/Config.php index 992e7bae7c8d7..10504660f4cc9 100644 --- a/lib/internal/Magento/Framework/App/Cache/Type/Config.php +++ b/lib/internal/Magento/Framework/App/Cache/Type/Config.php @@ -20,12 +20,12 @@ class Config extends TagScope implements CacheInterface /** * Cache type code unique among all cache types */ - const TYPE_IDENTIFIER = 'config'; + public const TYPE_IDENTIFIER = 'config'; /** * Cache tag used to distinguish the cache type from all other cache */ - const CACHE_TAG = 'CONFIG'; + public const CACHE_TAG = 'CONFIG'; /** * @var \Magento\Framework\App\Cache\Type\FrontendPool diff --git a/lib/internal/Magento/Framework/App/Http/Context.php b/lib/internal/Magento/Framework/App/Http/Context.php index be59b798b9805..aedc50bccc475 100644 --- a/lib/internal/Magento/Framework/App/Http/Context.php +++ b/lib/internal/Magento/Framework/App/Http/Context.php @@ -21,7 +21,7 @@ class Context implements ResetAfterRequestInterface /** * Currency cache context */ - const CONTEXT_CURRENCY = 'current_currency'; + public const CONTEXT_CURRENCY = 'current_currency'; /** * Data storage diff --git a/lib/internal/Magento/Framework/App/PageCache/Kernel.php b/lib/internal/Magento/Framework/App/PageCache/Kernel.php index 643797f631ded..47b9798e47ec6 100644 --- a/lib/internal/Magento/Framework/App/PageCache/Kernel.php +++ b/lib/internal/Magento/Framework/App/PageCache/Kernel.php @@ -17,6 +17,7 @@ class Kernel * @var \Magento\PageCache\Model\Cache\Type * * @deprecated 100.1.0 + * @see Nothing */ protected $cache; diff --git a/lib/internal/Magento/Framework/App/ResourceConnection.php b/lib/internal/Magento/Framework/App/ResourceConnection.php index 93b1c3155e481..1868fd565cfed 100644 --- a/lib/internal/Magento/Framework/App/ResourceConnection.php +++ b/lib/internal/Magento/Framework/App/ResourceConnection.php @@ -89,7 +89,7 @@ public function __construct( */ public function _resetState() : void { - foreach($this->connections as $connection) { + foreach ($this->connections as $connection) { if ($connection instanceof ResetAfterRequestInterface) { $connection->_resetState(); } diff --git a/lib/internal/Magento/Framework/App/State.php b/lib/internal/Magento/Framework/App/State.php index a1736c4e49ac1..5956c7063c892 100644 --- a/lib/internal/Magento/Framework/App/State.php +++ b/lib/internal/Magento/Framework/App/State.php @@ -19,7 +19,7 @@ class State /** * Application run code */ - const PARAM_MODE = 'MAGE_MODE'; + public const PARAM_MODE = 'MAGE_MODE'; /** * Application mode @@ -50,8 +50,6 @@ class State protected $_configScope; /** - * Area code - * * @var string */ protected $_areaCode; @@ -68,16 +66,14 @@ class State */ private $areaList; - /**#@+ + /** * Application modes */ - const MODE_DEVELOPER = 'developer'; - - const MODE_PRODUCTION = 'production'; + public const MODE_DEVELOPER = 'developer'; - const MODE_DEFAULT = 'default'; + public const MODE_PRODUCTION = 'production'; - /**#@-*/ + public const MODE_DEFAULT = 'default'; /** * @param \Magento\Framework\Config\ScopeInterface $configScope @@ -219,6 +215,7 @@ private function checkAreaCode($areaCode) * * @return AreaList * @deprecated 101.0.0 + * @see Nothing */ private function getAreaListInstance() { diff --git a/lib/internal/Magento/Framework/Cache/Core.php b/lib/internal/Magento/Framework/Cache/Core.php index d1ad5e7e9063e..6ebd6705fad2a 100644 --- a/lib/internal/Magento/Framework/Cache/Core.php +++ b/lib/internal/Magento/Framework/Cache/Core.php @@ -55,15 +55,15 @@ protected function _tags($tags) /** * Save some data in a cache * - * @param mixed $data Data to put in cache (can be another type than string if - * automatic_serialization is on) - * @param null|string $cacheId Cache id (if not set, the last cache id will be used) - * @param string[] $tags Cache tags + * @param mixed $data Data to put in cache (can be another type than string if + * automatic_serialization is on) + * @param null|string $cacheId Cache id (if not set, the last cache id will be used) + * @param string[] $tags Cache tags * @param bool|int $specificLifetime If != false, set a specific lifetime for this cache record - * (null => infinite lifetime) - * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by - * some particular backends - * @return bool True if no problem + * (null => infinite lifetime) + * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by + * some particular backends + * @return bool True if no problem */ public function save($data, $cacheId = null, $tags = [], $specificLifetime = false, $priority = 8) { diff --git a/lib/internal/Magento/Framework/Cache/Frontend/Decorator/Bare.php b/lib/internal/Magento/Framework/Cache/Frontend/Decorator/Bare.php index 0f2e563e7ad34..737105585e2e5 100644 --- a/lib/internal/Magento/Framework/Cache/Frontend/Decorator/Bare.php +++ b/lib/internal/Magento/Framework/Cache/Frontend/Decorator/Bare.php @@ -66,8 +66,7 @@ public function load($identifier) } /** - * Enforce marking with a tag - * + * @inheritDoc */ public function save($data, $identifier, array $tags = [], $lifeTime = null) { diff --git a/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php b/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php index 92d81845582aa..d5c5b428a75f9 100644 --- a/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php +++ b/lib/internal/Magento/Framework/Composer/Test/Unit/DependencyCheckerTest.php @@ -11,13 +11,20 @@ use Composer\Console\ApplicationFactory; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Composer\DependencyChecker; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class DependencyCheckerTest extends TestCase { + /** + * @var ApplicationFactory|MockObject + */ private ApplicationFactory $composerFactory; + /** + * @var Application|MockObject + */ private Application $composerApp; protected function setUp(): void @@ -33,8 +40,8 @@ protected function setUp(): void ->getMock(); $this->composerFactory->method('create')->willReturn($this->composerApp); parent::setUp(); - } + /** * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) diff --git a/lib/internal/Magento/Framework/Config/Data.php b/lib/internal/Magento/Framework/Config/Data.php index 7a9999a302f84..f6492b4010634 100644 --- a/lib/internal/Magento/Framework/Config/Data.php +++ b/lib/internal/Magento/Framework/Config/Data.php @@ -39,8 +39,6 @@ class Data implements \Magento\Framework\Config\DataInterface protected $_cacheId; /** - * Cache tags - * * @var array */ protected $cacheTags = []; diff --git a/lib/internal/Magento/Framework/Filesystem/Directory/Read.php b/lib/internal/Magento/Framework/Filesystem/Directory/Read.php index 578da28470039..93d0f0b6affd7 100644 --- a/lib/internal/Magento/Framework/Filesystem/Directory/Read.php +++ b/lib/internal/Magento/Framework/Filesystem/Directory/Read.php @@ -23,8 +23,6 @@ class Read implements ReadInterface protected $path; /** - * File factory - * * @var \Magento\Framework\Filesystem\File\ReadFactory */ protected $fileFactory; diff --git a/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php b/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php index fcbbec302b4be..1140d12dedc9a 100644 --- a/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php +++ b/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php @@ -19,7 +19,7 @@ */ class ExceptionFormatter { - const HTTP_GRAPH_QL_SCHEMA_ERROR_STATUS = 500; + public const HTTP_GRAPH_QL_SCHEMA_ERROR_STATUS = 500; /** * @var State diff --git a/lib/internal/Magento/Framework/GraphQl/Query/BatchResolverWrapper.php b/lib/internal/Magento/Framework/GraphQl/Query/BatchResolverWrapper.php index 3edea469ae78c..99499c3bf8a26 100644 --- a/lib/internal/Magento/Framework/GraphQl/Query/BatchResolverWrapper.php +++ b/lib/internal/Magento/Framework/GraphQl/Query/BatchResolverWrapper.php @@ -137,6 +137,9 @@ function () use ($item) { ); } + /** + * @inheritDoc + */ public function _resetState(): void { $this->clearAggregated(); diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php index f3127a88102e0..27fc86b94e8b4 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Request.php @@ -451,6 +451,7 @@ private function getSslOffloadHeader() * * @return \Magento\Framework\App\Config * @deprecated 100.1.0 + * @see Nothing */ private function getAppConfig() { diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php index d606252d6aa83..c6eb0d428ce38 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php @@ -195,6 +195,9 @@ public function __sleep() return ['content', 'isRedirect', 'statusCode']; } + /** + * @inheritDoc + */ public function _resetState(): void { $this->metadata = []; diff --git a/lib/internal/Magento/Framework/Locale/Resolver.php b/lib/internal/Magento/Framework/Locale/Resolver.php index 70d1321b56d5e..89a68d4d9bebb 100644 --- a/lib/internal/Magento/Framework/Locale/Resolver.php +++ b/lib/internal/Magento/Framework/Locale/Resolver.php @@ -18,7 +18,7 @@ class Resolver implements ResolverInterface, ResetAfterRequestInterface /** * Resolver default locale */ - const DEFAULT_LOCALE = 'en_US'; + public const DEFAULT_LOCALE = 'en_US'; /** * Default locale code @@ -28,8 +28,6 @@ class Resolver implements ResolverInterface, ResetAfterRequestInterface protected $defaultLocale; /** - * Scope type - * * @var string */ protected $scopeType; @@ -177,6 +175,9 @@ public function revert() return $result; } + /** + * @inheritDoc + */ public function _resetState(): void { $this->locale = null; diff --git a/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php b/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php index 431ac877a6277..defc3440d0d18 100644 --- a/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php +++ b/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php @@ -1,7 +1,5 @@ _requestMock->expects($this->once())->method('getHeader')->willReturn('application/json'); /** Mock renderer. */ From 7a9d77f8e657ba70fa1b6a3a04d67ecd7119580b Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 19 Apr 2023 16:47:11 -0500 Subject: [PATCH 3/6] ACPT-1219: Fix Static Tests failures for application-Server PR --- .../GiftMessage/Model/OrderItemRepository.php | 2 -- .../IndexerSetDimensionsModeCommand.php | 1 - lib/internal/Magento/Framework/Cache/Core.php | 13 +++++------- .../Model/ActionValidator/RemoveAction.php | 2 +- .../Framework/ObjectManager/ObjectManager.php | 3 ++- lib/internal/Magento/Framework/Registry.php | 8 ++++---- .../Framework/Session/SessionManager.php | 1 + .../Magento/Framework/Session/Storage.php | 5 +++-- .../Framework/Webapi/ErrorProcessor.php | 20 +++++++++---------- .../Magento/Framework/Webapi/Request.php | 8 ++++---- .../Rest/Response/RendererFactoryTest.php | 5 +++-- 11 files changed, 33 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/GiftMessage/Model/OrderItemRepository.php b/app/code/Magento/GiftMessage/Model/OrderItemRepository.php index 9da21fd0f1018..5f9828a9c35e9 100644 --- a/app/code/Magento/GiftMessage/Model/OrderItemRepository.php +++ b/app/code/Magento/GiftMessage/Model/OrderItemRepository.php @@ -53,8 +53,6 @@ class OrderItemRepository implements \Magento\GiftMessage\Api\OrderItemRepositor protected $helper; /** - * Message factory. - * * @var \Magento\GiftMessage\Model\MessageFactory */ protected $messageFactory; diff --git a/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php b/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php index eeb0f46f2e7e3..0020a0592aa31 100644 --- a/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php +++ b/app/code/Magento/Indexer/Console/Command/IndexerSetDimensionsModeCommand.php @@ -70,7 +70,6 @@ protected function configure() } /** - * * @inheritdoc * @param InputInterface $input * @param OutputInterface $output diff --git a/lib/internal/Magento/Framework/Cache/Core.php b/lib/internal/Magento/Framework/Cache/Core.php index 6ebd6705fad2a..4b00c0eef3c19 100644 --- a/lib/internal/Magento/Framework/Cache/Core.php +++ b/lib/internal/Magento/Framework/Cache/Core.php @@ -55,14 +55,11 @@ protected function _tags($tags) /** * Save some data in a cache * - * @param mixed $data Data to put in cache (can be another type than string if - * automatic_serialization is on) - * @param null|string $cacheId Cache id (if not set, the last cache id will be used) - * @param string[] $tags Cache tags - * @param bool|int $specificLifetime If != false, set a specific lifetime for this cache record - * (null => infinite lifetime) - * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by - * some particular backends + * @param mixed $data Data to put in cache (can be another type than string if automatic_serialization is on) + * @param null|string $cacheId Cache id (if not set, the last cache id will be used) + * @param string[] $tags Cache tags + * @param bool|int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) + * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends * @return bool True if no problem */ public function save($data, $cacheId = null, $tags = [], $specificLifetime = false, $priority = 8) diff --git a/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php b/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php index defc3440d0d18..3e508b8e14fb0 100644 --- a/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php +++ b/lib/internal/Magento/Framework/Model/ActionValidator/RemoveAction.php @@ -53,8 +53,8 @@ public function isAllowed(AbstractModel $model) } /** - * * Get clean model name without Interceptor and Proxy part and slashes + * * @param object $object * @return mixed */ diff --git a/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php b/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php index f1c2ff0f36ed0..13e72f096c451 100644 --- a/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php +++ b/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php @@ -34,11 +34,12 @@ class ObjectManager implements \Magento\Framework\ObjectManagerInterface protected $_config; /** + * * @param FactoryInterface $factory * @param ConfigInterface $config * @param array &$sharedInstances */ - public function __construct(FactoryInterface $factory, ConfigInterface $config, &$sharedInstances = []) + public function __construct(FactoryInterface $factory, ConfigInterface $config, array &$sharedInstances = []) { $this->_config = $config; $this->_factory = $factory; diff --git a/lib/internal/Magento/Framework/Registry.php b/lib/internal/Magento/Framework/Registry.php index a18b59c4b0620..234e7c67471d2 100644 --- a/lib/internal/Magento/Framework/Registry.php +++ b/lib/internal/Magento/Framework/Registry.php @@ -15,6 +15,7 @@ * * @api * @deprecated 102.0.0 + * @see Nothing * @since 100.0.2 */ class Registry implements ResetAfterRequestInterface @@ -31,8 +32,8 @@ class Registry implements ResetAfterRequestInterface * * @param string $key * @return mixed - * * @deprecated 102.0.0 + * @see Nothing */ public function registry($key) { @@ -50,8 +51,8 @@ public function registry($key) * @param bool $graceful * @return void * @throws \RuntimeException - * * @deprecated 102.0.0 + * @see Nothing */ public function register($key, $value, $graceful = false) { @@ -69,8 +70,8 @@ public function register($key, $value, $graceful = false) * * @param string $key * @return void - * * @deprecated 102.0.0 + * @see Nothing */ public function unregister($key) { @@ -94,7 +95,6 @@ public function __destruct() array_walk($keys, [$this, 'unregister']); } - /** * @inheritDoc */ diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index c3aab0e4583aa..91d3a24738dea 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -208,6 +208,7 @@ public function start() } /** + * * @return void */ public function registerShutdown() { diff --git a/lib/internal/Magento/Framework/Session/Storage.php b/lib/internal/Magento/Framework/Session/Storage.php index dc74eb55eeff1..d2fd1ac536a37 100644 --- a/lib/internal/Magento/Framework/Session/Storage.php +++ b/lib/internal/Magento/Framework/Session/Storage.php @@ -1,7 +1,5 @@ Date: Wed, 19 Apr 2023 16:56:26 -0500 Subject: [PATCH 4/6] ACPT-1219: Fix Static Tests failures for application-Server PR --- .../Framework/GraphQl/Exception/ExceptionFormatter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php b/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php index 1140d12dedc9a..a2ed744065656 100644 --- a/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php +++ b/lib/internal/Magento/Framework/GraphQl/Exception/ExceptionFormatter.php @@ -11,6 +11,7 @@ use GraphQL\Error\DebugFlag; use GraphQL\Error\FormattedError; use Magento\Framework\App\State; +use Magento\Framework\Webapi\ErrorProcessor; use Psr\Log\LoggerInterface; use Throwable; @@ -33,9 +34,11 @@ class ExceptionFormatter /** * @param State $appState + * @param ErrorProcessor $errorProcessor * @param LoggerInterface $logger + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function __construct(State $appState, LoggerInterface $logger) + public function __construct(State $appState, ErrorProcessor $errorProcessor, LoggerInterface $logger) { $this->appState = $appState; $this->logger = $logger; From 719d340b0e0e84dac6f449876a0b89fa9e8e425e Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 19 Apr 2023 18:31:42 -0500 Subject: [PATCH 5/6] ACPT-1219: Fix Static Tests failures for application-Server PR --- lib/internal/Magento/Framework/Cache/Core.php | 9 +-------- .../Magento/Framework/ObjectManager/ObjectManager.php | 5 ++--- .../Magento/Framework/Session/SessionManager.php | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/lib/internal/Magento/Framework/Cache/Core.php b/lib/internal/Magento/Framework/Cache/Core.php index 4b00c0eef3c19..7f052353d1800 100644 --- a/lib/internal/Magento/Framework/Cache/Core.php +++ b/lib/internal/Magento/Framework/Cache/Core.php @@ -53,14 +53,7 @@ protected function _tags($tags) } /** - * Save some data in a cache - * - * @param mixed $data Data to put in cache (can be another type than string if automatic_serialization is on) - * @param null|string $cacheId Cache id (if not set, the last cache id will be used) - * @param string[] $tags Cache tags - * @param bool|int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) - * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends - * @return bool True if no problem + * @inheritDoc */ public function save($data, $cacheId = null, $tags = [], $specificLifetime = false, $priority = 8) { diff --git a/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php b/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php index 13e72f096c451..49973ddfbeca6 100644 --- a/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php +++ b/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php @@ -34,10 +34,9 @@ class ObjectManager implements \Magento\Framework\ObjectManagerInterface protected $_config; /** - * * @param FactoryInterface $factory * @param ConfigInterface $config - * @param array &$sharedInstances + * @param array $sharedInstances */ public function __construct(FactoryInterface $factory, ConfigInterface $config, array &$sharedInstances = []) { @@ -76,8 +75,8 @@ public function get($type) } /** - * * Configure di instance + * * Note: All arguments should be pre-processed (sort order, translations, etc) before passing to method configure. * * @param array $configuration diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index 91d3a24738dea..cf8b326269f75 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -208,10 +208,10 @@ public function start() } /** - * * @return void */ - public function registerShutdown() { + public function registerShutdown() + { register_shutdown_function([$this, 'writeClose']); } From a839db8c8abd0064698ab68ca879be738d9ea09a Mon Sep 17 00:00:00 2001 From: Aakash Kumar Date: Wed, 19 Apr 2023 19:38:59 -0500 Subject: [PATCH 6/6] ACPT-1219: Fix Static Tests failures for application-Server PR --- lib/internal/Magento/Framework/Session/SessionManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index cf8b326269f75..6c008995bfe3f 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -208,6 +208,8 @@ public function start() } /** + * Execute after script terminates + * * @return void */ public function registerShutdown()