From 1db34ccb3b790428a6d813d36e1606c5f5759bd6 Mon Sep 17 00:00:00 2001 From: Karyna Tsymbal Date: Fri, 29 Oct 2021 03:27:25 -0500 Subject: [PATCH 1/4] Fixes to launch Magento with PHP 8.1 --- .../Magento/Analytics/Model/ReportXml/ModuleIterator.php | 1 + app/code/Magento/Analytics/ReportXml/Query.php | 1 + app/code/Magento/Backend/Model/Menu.php | 2 ++ app/code/Magento/Backend/Model/Menu/Filter/Iterator.php | 1 + app/code/Magento/Backend/Model/Menu/Iterator.php | 1 + .../ResourceModel/Product/Collection/ProductLimitation.php | 4 ++++ .../Config/Model/Config/Structure/Element/Iterator.php | 5 +++++ app/code/Magento/Customer/Model/Indexer/Source.php | 2 ++ .../Customer/Ui/Component/MassAction/Group/Options.php | 1 + .../Magento/ImportExport/Model/Import/AbstractSource.php | 6 ++++++ .../ImportExport/Model/ResourceModel/Import/Data.php | 1 + app/code/Magento/Shipping/Model/Simplexml/Element.php | 2 ++ app/code/Magento/Ui/DataProvider/AbstractDataProvider.php | 1 + app/code/Magento/Ui/Model/Export/SearchResultIterator.php | 5 +++++ 14 files changed, 33 insertions(+) diff --git a/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php b/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php index fecbf2033c1ba..2057c52efed17 100644 --- a/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php +++ b/app/code/Magento/Analytics/Model/ReportXml/ModuleIterator.php @@ -34,6 +34,7 @@ public function __construct( * * @return array */ + #[\ReturnTypeWillChange] public function current() { $current = parent::current(); diff --git a/app/code/Magento/Analytics/ReportXml/Query.php b/app/code/Magento/Analytics/ReportXml/Query.php index b7c31d4334e20..29b5cbf73c32b 100644 --- a/app/code/Magento/Analytics/ReportXml/Query.php +++ b/app/code/Magento/Analytics/ReportXml/Query.php @@ -82,6 +82,7 @@ public function getConfig() * @return mixed data which can be serialized by json_encode, * which is a value of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return [ diff --git a/app/code/Magento/Backend/Model/Menu.php b/app/code/Magento/Backend/Model/Menu.php index 0246346ec4d97..00b9427a015bc 100644 --- a/app/code/Magento/Backend/Model/Menu.php +++ b/app/code/Magento/Backend/Model/Menu.php @@ -267,6 +267,7 @@ protected function _findParentItems($menu, $itemId, &$parents) * * @return string */ + #[\ReturnTypeWillChange] public function serialize() { return $this->serializer->serialize($this->toArray()); @@ -294,6 +295,7 @@ public function toArray() * @return void * @since 100.2.0 */ + #[\ReturnTypeWillChange] public function unserialize($serialized) { $data = $this->serializer->unserialize($serialized); diff --git a/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php b/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php index b6c61a1362edd..860a7f4bba330 100644 --- a/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php +++ b/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php @@ -27,6 +27,7 @@ public function __construct(\Iterator $iterator) * * @return bool true if the current element is acceptable, otherwise false. */ + #[\ReturnTypeWillChange] public function accept() { return !($this->current()->isDisabled() || !$this->current()->isAllowed()); diff --git a/app/code/Magento/Backend/Model/Menu/Iterator.php b/app/code/Magento/Backend/Model/Menu/Iterator.php index 7e98da0571263..ac6b57a438af5 100644 --- a/app/code/Magento/Backend/Model/Menu/Iterator.php +++ b/app/code/Magento/Backend/Model/Menu/Iterator.php @@ -17,6 +17,7 @@ class Iterator extends \ArrayIterator * * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->ksort(); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php index 3a42d8ad7dd0b..b767249bc281f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php @@ -35,6 +35,7 @@ class ProductLimitation implements \ArrayAccess * @return bool * @since 101.0.0 */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return array_key_exists($offset, $this->productLimitationFilters); @@ -45,6 +46,7 @@ public function offsetExists($offset) * @return mixed * @since 101.0.0 */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->productLimitationFilters[$offset]; @@ -56,6 +58,7 @@ public function offsetGet($offset) * @return void * @since 101.0.0 */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->productLimitationFilters[$offset] = $value; @@ -66,6 +69,7 @@ public function offsetSet($offset, $value) * @return void * @since 101.0.0 */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->productLimitationFilters[$offset]); diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Iterator.php b/app/code/Magento/Config/Model/Config/Structure/Element/Iterator.php index f53ecd710b28c..5f85ebcc7d2fa 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Iterator.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Iterator.php @@ -69,6 +69,7 @@ public function setElements(array $elements, $scope) * * @return \Magento\Config\Model\Config\StructureElementInterface */ + #[\ReturnTypeWillChange] public function current() { return $this->_flyweight; @@ -79,6 +80,7 @@ public function current() * * @return void Any returned value is ignored. */ + #[\ReturnTypeWillChange] public function next() { next($this->_elements); @@ -106,6 +108,7 @@ protected function _initFlyweight(array $element) * * @return void */ + #[\ReturnTypeWillChange] public function key() { key($this->_elements); @@ -117,6 +120,7 @@ public function key() * @return bool The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ + #[\ReturnTypeWillChange] public function valid() { return (bool)current($this->_elements); @@ -127,6 +131,7 @@ public function valid() * * @return void Any returned value is ignored. */ + #[\ReturnTypeWillChange] public function rewind() { reset($this->_elements); diff --git a/app/code/Magento/Customer/Model/Indexer/Source.php b/app/code/Magento/Customer/Model/Indexer/Source.php index 89e17e01bb48e..b48e7e5ad9d05 100644 --- a/app/code/Magento/Customer/Model/Indexer/Source.php +++ b/app/code/Magento/Customer/Model/Indexer/Source.php @@ -82,6 +82,7 @@ public function addFieldToFilter($attribute, $condition = null) /** * @inheritdoc */ + #[\ReturnTypeWillChange] public function count() { return $this->customerCollection->getSize(); @@ -92,6 +93,7 @@ public function count() * * @return Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { $this->customerCollection->setPageSize($this->batchSize); diff --git a/app/code/Magento/Customer/Ui/Component/MassAction/Group/Options.php b/app/code/Magento/Customer/Ui/Component/MassAction/Group/Options.php index 16caf346c808c..edc15bc60b4dd 100644 --- a/app/code/Magento/Customer/Ui/Component/MassAction/Group/Options.php +++ b/app/code/Magento/Customer/Ui/Component/MassAction/Group/Options.php @@ -81,6 +81,7 @@ public function __construct( * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { if ($this->options === null) { diff --git a/app/code/Magento/ImportExport/Model/Import/AbstractSource.php b/app/code/Magento/ImportExport/Model/Import/AbstractSource.php index 41665a71341c1..adee6fb9c6b7b 100644 --- a/app/code/Magento/ImportExport/Model/Import/AbstractSource.php +++ b/app/code/Magento/ImportExport/Model/Import/AbstractSource.php @@ -83,6 +83,7 @@ public function getColNames() * * @return array */ + #[\ReturnTypeWillChange] public function current() { $row = $this->_row; @@ -101,6 +102,7 @@ public function current() * * @return void */ + #[\ReturnTypeWillChange] public function next() { $this->_key++; @@ -127,6 +129,7 @@ abstract protected function _getNextRow(); * * @return int -1 if out of bounds, 0 or more otherwise */ + #[\ReturnTypeWillChange] public function key() { return $this->_key; @@ -137,6 +140,7 @@ public function key() * * @return bool */ + #[\ReturnTypeWillChange] public function valid() { return -1 !== $this->_key; @@ -147,6 +151,7 @@ public function valid() * * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->_key = -1; @@ -161,6 +166,7 @@ public function rewind() * @return void * @throws \OutOfBoundsException */ + #[\ReturnTypeWillChange] public function seek($position) { if ($position == $this->_key) { diff --git a/app/code/Magento/ImportExport/Model/ResourceModel/Import/Data.php b/app/code/Magento/ImportExport/Model/ResourceModel/Import/Data.php index 6e77016adf361..254050bfb1dc1 100644 --- a/app/code/Magento/ImportExport/Model/ResourceModel/Import/Data.php +++ b/app/code/Magento/ImportExport/Model/ResourceModel/Import/Data.php @@ -56,6 +56,7 @@ protected function _construct() * * @return \Iterator */ + #[\ReturnTypeWillChange] public function getIterator() { $connection = $this->getConnection(); diff --git a/app/code/Magento/Shipping/Model/Simplexml/Element.php b/app/code/Magento/Shipping/Model/Simplexml/Element.php index a0ca9caf1d659..878a875c969be 100644 --- a/app/code/Magento/Shipping/Model/Simplexml/Element.php +++ b/app/code/Magento/Shipping/Model/Simplexml/Element.php @@ -20,6 +20,7 @@ class Element extends \Magento\Framework\Simplexml\Element * @param string $namespace If specified, the namespace to which the attribute belongs. * @return void */ + #[\ReturnTypeWillChange] public function addAttribute($name, $value = null, $namespace = null) { $value = $value !== null ? $this->xmlentities($value) : ''; @@ -34,6 +35,7 @@ public function addAttribute($name, $value = null, $namespace = null) * @param string $namespace If specified, the namespace to which the child element belongs. * @return \Magento\Shipping\Model\Simplexml\Element */ + #[\ReturnTypeWillChange] public function addChild($name, $value = null, $namespace = null) { if ($value !== null) { diff --git a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php index 6e4e488619e86..7045f281f87f6 100644 --- a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php +++ b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php @@ -267,6 +267,7 @@ public function getData() * * @return int */ + #[\ReturnTypeWillChange] public function count() { return $this->getCollection()->count(); diff --git a/app/code/Magento/Ui/Model/Export/SearchResultIterator.php b/app/code/Magento/Ui/Model/Export/SearchResultIterator.php index e84a628e6699e..7277fe84c9853 100644 --- a/app/code/Magento/Ui/Model/Export/SearchResultIterator.php +++ b/app/code/Magento/Ui/Model/Export/SearchResultIterator.php @@ -24,6 +24,7 @@ public function __construct( /** * @return array|mixed */ + #[\ReturnTypeWillChange] public function current() { return current($this->items); @@ -32,6 +33,7 @@ public function current() /** * @return int|mixed */ + #[\ReturnTypeWillChange] public function key() { return key($this->items); @@ -40,6 +42,7 @@ public function key() /** * @return void */ + #[\ReturnTypeWillChange] public function next() { next($this->items); @@ -48,6 +51,7 @@ public function next() /** * @return void */ + #[\ReturnTypeWillChange] public function rewind() { reset($this->items); @@ -56,6 +60,7 @@ public function rewind() /** * @return bool */ + #[\ReturnTypeWillChange] public function valid() { return $this->key() !== null; From 59b324abf76baa8a8164baf18746db671b362901 Mon Sep 17 00:00:00 2001 From: Karyna Date: Thu, 18 Nov 2021 21:30:14 +0100 Subject: [PATCH 2/4] Fix static tests failures --- .../Magento/Analytics/ReportXml/Query.php | 11 +++++--- app/code/Magento/Backend/Model/Menu.php | 2 +- .../Product/Collection/ProductLimitation.php | 26 ++++++++++++++++--- .../Model/Import/AbstractSource.php | 1 + .../Ui/DataProvider/AbstractDataProvider.php | 4 ++- .../Ui/Model/Export/SearchResultIterator.php | 10 ++++--- 6 files changed, 42 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Analytics/ReportXml/Query.php b/app/code/Magento/Analytics/ReportXml/Query.php index 29b5cbf73c32b..bc56a01cbc94b 100644 --- a/app/code/Magento/Analytics/ReportXml/Query.php +++ b/app/code/Magento/Analytics/ReportXml/Query.php @@ -53,6 +53,8 @@ public function __construct( } /** + * Returns query select + * * @return Select */ public function getSelect() @@ -61,6 +63,8 @@ public function getSelect() } /** + * Returns Connection name + * * @return string */ public function getConnectionName() @@ -69,6 +73,8 @@ public function getConnectionName() } /** + * Returns configuration + * * @return array */ public function getConfig() @@ -77,10 +83,7 @@ public function getConfig() } /** - * Specify data which should be serialized to JSON - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php - * @return mixed data which can be serialized by json_encode, - * which is a value of any type other than a resource. + * @inheritDoc */ #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/app/code/Magento/Backend/Model/Menu.php b/app/code/Magento/Backend/Model/Menu.php index 00b9427a015bc..9506ac3dc36c9 100644 --- a/app/code/Magento/Backend/Model/Menu.php +++ b/app/code/Magento/Backend/Model/Menu.php @@ -242,7 +242,7 @@ public function getParentItems($itemId) * * @param \Magento\Backend\Model\Menu $menu * @param string $itemId - * @param array &$parents + * @param array $parents * @return bool */ protected function _findParentItems($menu, $itemId, &$parents) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php index b767249bc281f..e2558a2737499 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php @@ -6,8 +6,6 @@ namespace Magento\Catalog\Model\ResourceModel\Product\Collection; /** - * Class ProductLimitation - * * @api * @since 101.0.0 */ @@ -31,6 +29,8 @@ class ProductLimitation implements \ArrayAccess private $productLimitationFilters = []; /** + * Check if the value is set for the given offset. + * * @param string $offset * @return bool * @since 101.0.0 @@ -42,6 +42,8 @@ public function offsetExists($offset) } /** + * Get the value by provided offset. + * * @param string $offset * @return mixed * @since 101.0.0 @@ -53,6 +55,8 @@ public function offsetGet($offset) } /** + * Set the given offset to filters. + * * @param string $offset * @param mixed $value * @return void @@ -65,6 +69,8 @@ public function offsetSet($offset, $value) } /** + * Unset the given offset from filters. + * * @param string $offset * @return void * @since 101.0.0 @@ -76,6 +82,8 @@ public function offsetUnset($offset) } /** + * Returns Store ID. + * * @return int|null * @since 101.0.0 */ @@ -85,6 +93,8 @@ public function getStoreId() } /** + * Returns category ID. + * * @return int|null * @since 101.0.0 */ @@ -94,6 +104,8 @@ public function getCategoryId() } /** + * Returns is category an anchor. + * * @return int|null * @since 101.0.0 */ @@ -103,6 +115,8 @@ public function getCategoryIsAnchor() } /** + * Returns visibility value. + * * @return array|int|null * @since 101.0.0 */ @@ -112,6 +126,8 @@ public function getVisibility() } /** + * Returns website IDs. + * * @return array|int|null * @since 101.0.0 */ @@ -121,6 +137,8 @@ public function getWebsiteIds() } /** + * Returns Store table. + * * @return string|null * @since 101.0.0 */ @@ -141,13 +159,15 @@ public function isUsingPriceIndex() } /** + * Sets 'Use Price' index flaf. + * * @param bool $value * @return void * @since 101.0.0 */ public function setUsePriceIndex($value) { - $this->offsetSet('use_price_index', (bool)$value); + $this->offsetSet('use_price_index', (bool) $value); } /** diff --git a/app/code/Magento/ImportExport/Model/Import/AbstractSource.php b/app/code/Magento/ImportExport/Model/Import/AbstractSource.php index adee6fb9c6b7b..57fa361ab2f63 100644 --- a/app/code/Magento/ImportExport/Model/Import/AbstractSource.php +++ b/app/code/Magento/ImportExport/Model/Import/AbstractSource.php @@ -7,6 +7,7 @@ use Magento\ImportExport\Model\Import\AbstractEntity; +// phpcs:disable Magento2.Classes.AbstractApi /** * Data source with columns for Magento_ImportExport * diff --git a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php index 7045f281f87f6..6699c5c6c3d33 100644 --- a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php +++ b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php @@ -8,7 +8,7 @@ use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; use Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface; - // phpcs:disable Magento2.Classes.AbstractApi +// phpcs:disable Magento2.Classes.AbstractApi /** * @inheritdoc * @@ -162,6 +162,8 @@ public function getFieldMetaInfo($fieldSetName, $fieldName) /** * @inheritdoc + * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint + * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint */ public function addFilter(\Magento\Framework\Api\Filter $filter) { diff --git a/app/code/Magento/Ui/Model/Export/SearchResultIterator.php b/app/code/Magento/Ui/Model/Export/SearchResultIterator.php index 7277fe84c9853..02a9c2ee57dd3 100644 --- a/app/code/Magento/Ui/Model/Export/SearchResultIterator.php +++ b/app/code/Magento/Ui/Model/Export/SearchResultIterator.php @@ -22,6 +22,8 @@ public function __construct( } /** + * @inheritDoc + * * @return array|mixed */ #[\ReturnTypeWillChange] @@ -31,6 +33,8 @@ public function current() } /** + * @inheritDoc + * * @return int|mixed */ #[\ReturnTypeWillChange] @@ -40,7 +44,7 @@ public function key() } /** - * @return void + * @inheritDoc */ #[\ReturnTypeWillChange] public function next() @@ -49,7 +53,7 @@ public function next() } /** - * @return void + * @inheritDoc */ #[\ReturnTypeWillChange] public function rewind() @@ -58,7 +62,7 @@ public function rewind() } /** - * @return bool + * @inheritDoc */ #[\ReturnTypeWillChange] public function valid() From 9f0f96784c6ded332c1a87e62bfb30f1dc344c65 Mon Sep 17 00:00:00 2001 From: Karyna Date: Fri, 19 Nov 2021 15:02:52 +0100 Subject: [PATCH 3/4] Fixes after code review --- .../Product/Collection/ProductLimitation.php | 2 +- .../Ui/DataProvider/AbstractDataProvider.php | 1 - .../Ui/Model/Export/SearchResultIterator.php | 14 +++++--------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php index e2558a2737499..1a3912b71437f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection/ProductLimitation.php @@ -159,7 +159,7 @@ public function isUsingPriceIndex() } /** - * Sets 'Use Price' index flaf. + * Sets 'Use Price' index flag. * * @param bool $value * @return void diff --git a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php index 6699c5c6c3d33..f369b50a958bd 100644 --- a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php +++ b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php @@ -162,7 +162,6 @@ public function getFieldMetaInfo($fieldSetName, $fieldName) /** * @inheritdoc - * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint */ public function addFilter(\Magento\Framework\Api\Filter $filter) diff --git a/app/code/Magento/Ui/Model/Export/SearchResultIterator.php b/app/code/Magento/Ui/Model/Export/SearchResultIterator.php index 02a9c2ee57dd3..da0004f405ca5 100644 --- a/app/code/Magento/Ui/Model/Export/SearchResultIterator.php +++ b/app/code/Magento/Ui/Model/Export/SearchResultIterator.php @@ -22,9 +22,7 @@ public function __construct( } /** - * @inheritDoc - * - * @return array|mixed + * @inheritdoc */ #[\ReturnTypeWillChange] public function current() @@ -33,9 +31,7 @@ public function current() } /** - * @inheritDoc - * - * @return int|mixed + * @inheritdoc */ #[\ReturnTypeWillChange] public function key() @@ -44,7 +40,7 @@ public function key() } /** - * @inheritDoc + * @inheritdoc */ #[\ReturnTypeWillChange] public function next() @@ -53,7 +49,7 @@ public function next() } /** - * @inheritDoc + * @inheritdoc */ #[\ReturnTypeWillChange] public function rewind() @@ -62,7 +58,7 @@ public function rewind() } /** - * @inheritDoc + * @inheritdoc */ #[\ReturnTypeWillChange] public function valid() From d809e46c6e65d0f11b93eebd20ec697cd75930ee Mon Sep 17 00:00:00 2001 From: Karyna Date: Mon, 22 Nov 2021 17:28:52 +0100 Subject: [PATCH 4/4] 34505: fix failed static tests --- app/code/Magento/Backend/Model/Menu/Filter/Iterator.php | 2 +- app/code/Magento/Ui/DataProvider/AbstractDataProvider.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php b/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php index 860a7f4bba330..1655c89e5c299 100644 --- a/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php +++ b/app/code/Magento/Backend/Model/Menu/Filter/Iterator.php @@ -17,7 +17,7 @@ class Iterator extends \FilterIterator * * @param \Iterator $iterator */ - public function __construct(\Iterator $iterator) + public function __construct(\Iterator $iterator) // phpcs:ignore Generic.CodeAnalysis.UselessOverridingMethod { parent::__construct($iterator); } diff --git a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php index f369b50a958bd..c8a483d26d80c 100644 --- a/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php +++ b/app/code/Magento/Ui/DataProvider/AbstractDataProvider.php @@ -162,10 +162,10 @@ public function getFieldMetaInfo($fieldSetName, $fieldName) /** * @inheritdoc - * @phpcsSuppress SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint */ public function addFilter(\Magento\Framework\Api\Filter $filter) { + // @phpstan-ignore-next-line as adding return statement cause of backward compatibility issue $this->getCollection()->addFieldToFilter( $filter->getField(), [$filter->getConditionType() => $filter->getValue()]