Skip to content

Commit b53a369

Browse files
authored
MDEE-943: Fix deprecation on DataExporter (#463)
1 parent 39d401a commit b53a369

File tree

13 files changed

+22
-22
lines changed

13 files changed

+22
-22
lines changed

CatalogDataExporter/Model/Provider/Product/CustomOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function __construct(
6969
public function get(
7070
array $productIds,
7171
array $optionTypes,
72-
string $storeViewCode = null,
72+
?string $storeViewCode = null,
7373
bool $addOptionValues = true
7474
): array {
7575
$connection = $this->resourceConnection->getConnection();

CatalogDataExporter/Model/Query/ProductAttributeQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class ProductAttributeQuery
6363
public function __construct(
6464
ResourceConnection $resourceConnection,
6565
string $mainTable = 'catalog_product_entity',
66-
EavAttributeQueryBuilderFactory $attributeQueryFactory = null,
66+
?EavAttributeQueryBuilderFactory $attributeQueryFactory = null,
6767
array $systemAttributes = []
6868
) {
6969
$this->resourceConnection = $resourceConnection;

CatalogDataExporter/Model/Query/ProductLinksQuery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function __construct(
8181
*
8282
* @return Select
8383
*/
84-
public function getQuery(array $productIds, string $storeViewCode, int $linkTypeId = null) : Select
84+
public function getQuery(array $productIds, string $storeViewCode, ?int $linkTypeId = null) : Select
8585
{
8686
$connection = $this->resourceConnection->getConnection();
8787
$catalogProductTable = $this->resourceConnection->getTableName('catalog_product_entity');
@@ -171,7 +171,7 @@ public function getQuery(array $productIds, string $storeViewCode, int $linkType
171171
* @param int|null $linkTypeId
172172
* @return array
173173
*/
174-
private function getProductLinkAttributesData(int $linkTypeId = null) : array
174+
private function getProductLinkAttributesData(?int $linkTypeId = null) : array
175175
{
176176
if (null === $this->productLinkAttributesCache) {
177177
$connection = $this->resourceConnection->getConnection();

DataExporter/Export/DataProcessorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function execute(
3636
array $arguments,
3737
callable $dataProcessorCallback,
3838
FeedIndexMetadata $metadata,
39-
Node $node = null,
40-
Info $info = null
39+
?Node $node = null,
40+
?Info $info = null
4141
): void;
4242
}

DataExporter/Export/Processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function processWithCallback(
118118
* @param null|array $proxyData - added for backward compatibility with originally `processWithCallback` is called
119119
* @return array
120120
*/
121-
public function process(string $fieldName, array $arguments = [], array $proxyData = null) : array
121+
public function process(string $fieldName, array $arguments = [], ?array $proxyData = null) : array
122122
{
123123
if ($proxyData !== null) {
124124
return $proxyData;

DataExporter/Model/Batch/BatchTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct(
8787
* @throws \Zend_Db_Exception
8888
* @throws \Zend_Db_Statement_Exception
8989
*/
90-
public function create(string $insertDataQuery, bool $initializeCreate = null): int
90+
public function create(string $insertDataQuery, ?bool $initializeCreate = null): int
9191
{
9292
$connection = $this->resourceConnection->getConnection();
9393
$batchTable = $connection->newTable()

DataExporter/Model/Batch/FeedSource/Generator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ private function getSelect(
272272
string $sourceTableField,
273273
string $batchNumField,
274274
int $batchNumberIncrement = 0,
275-
int $startFrom = null,
276-
int $maxLimit = null
275+
?int $startFrom = null,
276+
?int $maxLimit = null
277277
): Select {
278278
$connection = $this->resourceConnection->getConnection();
279279
$tableFeed = $this->resourceConnection->getTableName($metadata->getFeedTableName());

DataExporter/Model/Provider/QueryDataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class QueryDataProvider
4949
*/
5050
public function __construct(
5151
QueryProcessor $queryProcessor,
52-
string $queryName = null,
52+
?string $queryName = null,
5353
array $queryArguments = []
5454
) {
5555
$this->queryProcessor = $queryProcessor;

ProductPriceDataExporter/Model/Provider/ProductPrice.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ private function buildKey(int|string $productId, int|string $websiteId, int|stri
611611
private function addDiscountPrice(
612612
array &$priceFeedItem,
613613
string $code,
614-
string $price = null,
615-
string $percentage = null
614+
?string $price = null,
615+
?string $percentage = null
616616
): void {
617617
foreach ($priceFeedItem['discounts'] as &$discount) {
618618
if ($discount['code'] === $code) {
@@ -686,7 +686,7 @@ private function buildCustomerGroupCode(string $customerGroupId): string
686686
* @param ?string $percent
687687
* @return void
688688
*/
689-
private function setPriceOrPercentageDiscount(array &$discount, string $price = null, string $percent = null): void
689+
private function setPriceOrPercentageDiscount(array &$discount, ?string $price = null, ?string $percent = null): void
690690
{
691691
if (null !== $percent) {
692692
$discount['percentage'] = (float)$percent;

ProductPriceDataExporter/Model/Query/ProductPricesQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ProductPricesQuery
5353
public function __construct(
5454
ResourceConnection $resourceConnection,
5555
MetadataPool $metadataPool,
56-
Config $eavConfig = null
56+
?Config $eavConfig = null
5757
) {
5858
$this->resourceConnection = $resourceConnection;
5959
$this->metadataPool = $metadataPool;

SalesOrdersDataExporter/Console/Command/Link.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
152152
*/
153153
public function assignUuidsToOrderEntities(
154154
int $batchSize,
155-
string $from = null,
156-
string $to = null,
155+
?string $from = null,
156+
?string $to = null,
157157
string $state = ''
158158
): int {
159159
return $this->orderUuidManager->assignByDate($batchSize, $from, $to, $state);

SalesOrdersDataExporter/Model/OrderUuidManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public function __construct(
100100
*/
101101
public function assignByDate(
102102
int $batchSize,
103-
string $from = null,
104-
string $to = null,
103+
?string $from = null,
104+
?string $to = null,
105105
string $state = ''
106106
): int {
107107
$updatedEntities = 0;
@@ -141,8 +141,8 @@ public function assignByOrderIds(int $batchSize, array $orderIds): int
141141
*/
142142
private function getOrders(
143143
int $batchSize,
144-
string $from = null,
145-
string $to = null,
144+
?string $from = null,
145+
?string $to = null,
146146
string $state = '',
147147
array $orderIds = []
148148
): Generator {

SalesOrdersDataExporter/Model/Provider/Orders.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class Orders extends \Magento\DataExporter\Model\Provider\QueryDataProvider
4343
public function __construct(
4444
CommerceDataExportLoggerInterface $logger,
4545
QueryProcessor $queryProcessor,
46-
string $queryName = null,
46+
?string $queryName = null,
4747
array $queryArguments = []
4848
) {
4949
parent::__construct($queryProcessor, $queryName, $queryArguments);

0 commit comments

Comments
 (0)