From 36ad18af62f3d434b3a08eb6358217ff43cd1bce Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Fri, 1 Feb 2019 13:50:24 +0200 Subject: [PATCH] magento/magento2#15775: [Forwardport] Incorrect return type getList() in CustomerRepository. --- .../Model/OperationSearchResults.php | 18 +++++ .../Magento/AsynchronousOperations/etc/di.xml | 2 +- .../Model/CategoryAttributeSearchResults.php | 18 +++++ .../Catalog/Model/CategorySearchResults.php | 18 +++++ .../Model/ProductAttributeSearchResults.php | 18 +++++ .../Catalog/Model/ProductSearchResults.php | 18 +++++ app/code/Magento/Catalog/etc/di.xml | 8 +-- .../Magento/Cms/Model/BlockSearchResults.php | 18 +++++ .../Magento/Cms/Model/PageSearchResults.php | 18 +++++ app/code/Magento/Cms/etc/di.xml | 5 +- .../Customer/Model/AddressSearchResults.php | 18 +++++ .../Customer/Model/CustomerSearchResults.php | 18 +++++ .../Customer/Model/GroupSearchResults.php | 18 +++++ app/code/Magento/Customer/etc/di.xml | 6 +- .../Eav/Model/AttributeGroupSearchResults.php | 18 +++++ .../Eav/Model/AttributeSearchResults.php | 18 +++++ .../Eav/Model/AttributeSetSearchResults.php | 18 +++++ app/code/Magento/Eav/etc/di.xml | 6 +- .../Api/Data/CartSearchResultsInterface.php | 2 + .../Magento/Quote/Model/CartSearchResults.php | 65 +++++++++++++++++++ app/code/Magento/Quote/etc/di.xml | 2 +- .../SalesRule/Model/CouponSearchResult.php | 27 ++++++++ .../SalesRule/Model/RuleSearchResult.php | 27 ++++++++ app/code/Magento/SalesRule/etc/di.xml | 4 +- .../Signifyd/Model/CaseSearchResults.php | 18 +++++ app/code/Magento/Signifyd/etc/di.xml | 2 +- .../Tax/Model/TaxClassSearchResults.php | 18 +++++ .../Tax/Model/TaxRateSearchResults.php | 18 +++++ .../Tax/Model/TaxRuleSearchResults.php | 18 +++++ app/code/Magento/Tax/etc/di.xml | 6 +- .../Ui/Model/BookmarkSearchResults.php | 18 +++++ app/code/Magento/Ui/etc/di.xml | 2 +- .../Vault/Model/PaymentTokenSearchResults.php | 18 +++++ app/code/Magento/Vault/etc/di.xml | 2 +- .../Magento/Framework/Api/SearchResults.php | 3 + .../Framework/Api/SearchResultsInterface.php | 1 + 36 files changed, 489 insertions(+), 23 deletions(-) create mode 100644 app/code/Magento/AsynchronousOperations/Model/OperationSearchResults.php create mode 100644 app/code/Magento/Catalog/Model/CategoryAttributeSearchResults.php create mode 100644 app/code/Magento/Catalog/Model/CategorySearchResults.php create mode 100644 app/code/Magento/Catalog/Model/ProductAttributeSearchResults.php create mode 100644 app/code/Magento/Catalog/Model/ProductSearchResults.php create mode 100644 app/code/Magento/Cms/Model/BlockSearchResults.php create mode 100644 app/code/Magento/Cms/Model/PageSearchResults.php create mode 100644 app/code/Magento/Customer/Model/AddressSearchResults.php create mode 100644 app/code/Magento/Customer/Model/CustomerSearchResults.php create mode 100644 app/code/Magento/Customer/Model/GroupSearchResults.php create mode 100644 app/code/Magento/Eav/Model/AttributeGroupSearchResults.php create mode 100644 app/code/Magento/Eav/Model/AttributeSearchResults.php create mode 100644 app/code/Magento/Eav/Model/AttributeSetSearchResults.php create mode 100644 app/code/Magento/Quote/Model/CartSearchResults.php create mode 100644 app/code/Magento/SalesRule/Model/CouponSearchResult.php create mode 100644 app/code/Magento/SalesRule/Model/RuleSearchResult.php create mode 100644 app/code/Magento/Signifyd/Model/CaseSearchResults.php create mode 100644 app/code/Magento/Tax/Model/TaxClassSearchResults.php create mode 100644 app/code/Magento/Tax/Model/TaxRateSearchResults.php create mode 100644 app/code/Magento/Tax/Model/TaxRuleSearchResults.php create mode 100644 app/code/Magento/Ui/Model/BookmarkSearchResults.php create mode 100644 app/code/Magento/Vault/Model/PaymentTokenSearchResults.php diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationSearchResults.php b/app/code/Magento/AsynchronousOperations/Model/OperationSearchResults.php new file mode 100644 index 0000000000000..84f0952a836c2 --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Model/OperationSearchResults.php @@ -0,0 +1,18 @@ + - + diff --git a/app/code/Magento/Catalog/Model/CategoryAttributeSearchResults.php b/app/code/Magento/Catalog/Model/CategoryAttributeSearchResults.php new file mode 100644 index 0000000000000..db1b84ed27772 --- /dev/null +++ b/app/code/Magento/Catalog/Model/CategoryAttributeSearchResults.php @@ -0,0 +1,18 @@ + - - - + + + - + diff --git a/app/code/Magento/Cms/Model/BlockSearchResults.php b/app/code/Magento/Cms/Model/BlockSearchResults.php new file mode 100644 index 0000000000000..2fa5dbb40139e --- /dev/null +++ b/app/code/Magento/Cms/Model/BlockSearchResults.php @@ -0,0 +1,18 @@ + + type="Magento\Cms\Model\PageSearchResults" /> + type="Magento\Cms\Model\BlockSearchResults" /> @@ -234,4 +234,3 @@ - diff --git a/app/code/Magento/Customer/Model/AddressSearchResults.php b/app/code/Magento/Customer/Model/AddressSearchResults.php new file mode 100644 index 0000000000000..7e83aa8f8d8df --- /dev/null +++ b/app/code/Magento/Customer/Model/AddressSearchResults.php @@ -0,0 +1,18 @@ + + type="Magento\Customer\Model\GroupSearchResults" /> + type="Magento\Customer\Model\CustomerSearchResults" /> + type="Magento\Customer\Model\AddressSearchResults" /> - - - + + + diff --git a/app/code/Magento/Quote/Api/Data/CartSearchResultsInterface.php b/app/code/Magento/Quote/Api/Data/CartSearchResultsInterface.php index 5da776091f7f1..48818e5d253e6 100644 --- a/app/code/Magento/Quote/Api/Data/CartSearchResultsInterface.php +++ b/app/code/Magento/Quote/Api/Data/CartSearchResultsInterface.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Quote\Api\Data; /** diff --git a/app/code/Magento/Quote/Model/CartSearchResults.php b/app/code/Magento/Quote/Model/CartSearchResults.php new file mode 100644 index 0000000000000..5c505bec121f2 --- /dev/null +++ b/app/code/Magento/Quote/Model/CartSearchResults.php @@ -0,0 +1,65 @@ +setData(self::KEY_ITEMS, $items); + } + + /** + * @inheritdoc + */ + public function getItems() + { + return $this->_get(self::KEY_ITEMS) === null ? [] : $this->_get(self::KEY_ITEMS); + } + + /** + * @inheritdoc + */ + public function getSearchCriteria() + { + return $this->_get(self::KEY_SEARCH_CRITERIA); + } + + /** + * @inheritdoc + */ + public function setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria) + { + return $this->setData(self::KEY_SEARCH_CRITERIA, $searchCriteria); + } + + /** + * @inheritdoc + */ + public function getTotalCount() + { + return $this->_get(self::KEY_TOTAL_COUNT); + } + + /** + * @inheritdoc + */ + public function setTotalCount($count) + { + return $this->setData(self::KEY_TOTAL_COUNT, $count); + } +} diff --git a/app/code/Magento/Quote/etc/di.xml b/app/code/Magento/Quote/etc/di.xml index cd5e62307fdca..f66001e7789cf 100644 --- a/app/code/Magento/Quote/etc/di.xml +++ b/app/code/Magento/Quote/etc/di.xml @@ -18,7 +18,7 @@ - + diff --git a/app/code/Magento/SalesRule/Model/CouponSearchResult.php b/app/code/Magento/SalesRule/Model/CouponSearchResult.php new file mode 100644 index 0000000000000..cba57900cf605 --- /dev/null +++ b/app/code/Magento/SalesRule/Model/CouponSearchResult.php @@ -0,0 +1,27 @@ + + type="Magento\SalesRule\Model\RuleSearchResult" /> + type="Magento\SalesRule\Model\CouponSearchResult" /> - + diff --git a/app/code/Magento/Tax/Model/TaxClassSearchResults.php b/app/code/Magento/Tax/Model/TaxClassSearchResults.php new file mode 100644 index 0000000000000..4e92fd10a3dec --- /dev/null +++ b/app/code/Magento/Tax/Model/TaxClassSearchResults.php @@ -0,0 +1,18 @@ + - - + + @@ -47,7 +47,7 @@ - + diff --git a/app/code/Magento/Ui/Model/BookmarkSearchResults.php b/app/code/Magento/Ui/Model/BookmarkSearchResults.php new file mode 100644 index 0000000000000..2171a5c0084e2 --- /dev/null +++ b/app/code/Magento/Ui/Model/BookmarkSearchResults.php @@ -0,0 +1,18 @@ + - + diff --git a/app/code/Magento/Vault/Model/PaymentTokenSearchResults.php b/app/code/Magento/Vault/Model/PaymentTokenSearchResults.php new file mode 100644 index 0000000000000..39dcf503779b9 --- /dev/null +++ b/app/code/Magento/Vault/Model/PaymentTokenSearchResults.php @@ -0,0 +1,18 @@ + - + diff --git a/lib/internal/Magento/Framework/Api/SearchResults.php b/lib/internal/Magento/Framework/Api/SearchResults.php index ad58d0a752653..cf1f11463f6ad 100644 --- a/lib/internal/Magento/Framework/Api/SearchResults.php +++ b/lib/internal/Magento/Framework/Api/SearchResults.php @@ -3,11 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Framework\Api; /** * SearchResults Service Data Object used for the search service requests + * + * @SuppressWarnings(PHPMD.NumberOfChildren) */ class SearchResults extends AbstractSimpleObject implements SearchResultsInterface { diff --git a/lib/internal/Magento/Framework/Api/SearchResultsInterface.php b/lib/internal/Magento/Framework/Api/SearchResultsInterface.php index d2bc3053b8d6e..ba72685a80f49 100644 --- a/lib/internal/Magento/Framework/Api/SearchResultsInterface.php +++ b/lib/internal/Magento/Framework/Api/SearchResultsInterface.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Framework\Api;