Skip to content

Commit 58651f9

Browse files
committed
Use optional argument in constructor
1 parent fe28e23 commit 58651f9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/Catalog/Model/Category/DataProvider.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ public function __construct(
222222
Config $eavConfig,
223223
RequestInterface $request,
224224
CategoryFactory $categoryFactory,
225-
DataInterfaceFactory $uiConfigFactory,
226225
array $meta = [],
227226
array $data = [],
228227
PoolInterface $pool = null,
@@ -231,7 +230,8 @@ public function __construct(
231230
ScopeOverriddenValue $scopeOverriddenValue = null,
232231
ArrayManager $arrayManager = null,
233232
FileInfo $fileInfo = null,
234-
?Image $categoryImage = null
233+
?Image $categoryImage = null,
234+
?DataInterfaceFactory $uiConfigFactory = null
235235
) {
236236
$this->eavValidationRules = $eavValidationRules;
237237
$this->collection = $categoryCollectionFactory->create();
@@ -241,14 +241,17 @@ public function __construct(
241241
$this->storeManager = $storeManager;
242242
$this->request = $request;
243243
$this->categoryFactory = $categoryFactory;
244-
$this->uiConfigFactory = $uiConfigFactory;
245244
$this->auth = $auth ?? ObjectManager::getInstance()->get(AuthorizationInterface::class);
246245
$this->arrayUtils = $arrayUtils ?? ObjectManager::getInstance()->get(ArrayUtils::class);
247246
$this->scopeOverriddenValue = $scopeOverriddenValue ?:
248247
ObjectManager::getInstance()->get(ScopeOverriddenValue::class);
249248
$this->arrayManager = $arrayManager ?: ObjectManager::getInstance()->get(ArrayManager::class);
250249
$this->fileInfo = $fileInfo ?: ObjectManager::getInstance()->get(FileInfo::class);
251250
$this->categoryImage = $categoryImage ?? ObjectManager::getInstance()->get(Image::class);
251+
$this->uiConfigFactory = $uiConfigFactory ?? ObjectManager::getInstance()->create(
252+
DataInterfaceFactory::class,
253+
['instanceName' => \Magento\Ui\Config\Data::class]
254+
);
252255

253256
parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data, $pool);
254257
}

0 commit comments

Comments
 (0)