Skip to content

Commit 25e5df1

Browse files
committed
refactor pre review comments static test fix
1 parent 67c2c0c commit 25e5df1

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

app/code/Magento/Ui/Component/Form/Element/DataType/Media/Image.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,40 @@ class Image extends Media
3434
/**
3535
* @var OpednDialogUrl
3636
*/
37-
private $openDialogConfig;
37+
private $openDialogUrl;
3838

3939
/**
4040
* @param ContextInterface $context
4141
* @param StoreManagerInterface $storeManager
4242
* @param Size $fileSize
43-
* @param OpenDialogUrl $openDialogConfig
43+
* @param OpenDialogUrl $openDialogUrl
4444
* @param UiComponentInterface[] $components
4545
* @param array $data
4646
*/
4747
public function __construct(
4848
ContextInterface $context,
4949
StoreManagerInterface $storeManager,
5050
Size $fileSize,
51-
OpenDialogUrl $openDialogConfig,
51+
OpenDialogUrl $openDialogUrl,
5252
array $components = [],
5353
array $data = []
5454
) {
5555
$this->storeManager = $storeManager;
5656
$this->fileSize = $fileSize;
57-
$this->openDialogConfig = $openDialogConfig;
57+
$this->openDialogUrl = $openDialogUrl;
5858
parent::__construct($context, $components, $data);
5959
}
6060

6161
/**
62-
* {@inheritdoc}
62+
* @inheritdoc
6363
*/
6464
public function getComponentName()
6565
{
6666
return static::NAME;
6767
}
6868

6969
/**
70-
* {@inheritdoc}
70+
* @inheritdoc
7171
*/
7272
public function prepare()
7373
{
@@ -84,7 +84,7 @@ public function prepare()
8484
'maxFileSize' => $maxFileSize,
8585
'mediaGallery' => [
8686
'openDialogUrl' => $this->getContext()->getUrl(
87-
$this->openDialogConfig->getOpenDialogUrl(),
87+
$this->openDialogUrl->get(),
8888
['_secure' => true]
8989
),
9090
'openDialogTitle' => $this->getConfiguration()['openDialogTitle'] ?? __('Insert Images...'),

app/code/Magento/Ui/Component/Form/Element/DataType/Media/OpenDialogUrl.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@ class OpenDialogUrl
2121
private $openDialogUrl;
2222

2323
/**
24-
* @param string $openDialog
24+
* @param string $url
2525
*/
26-
public function __construct(string $openDialog = null)
26+
public function __construct(string $url = null)
2727
{
28-
$this->openDialogUrl = $openDialog ?? self::DEFAULT_OPEN_DIALOG_URL;
28+
$this->openDialogUrl = $url ?? self::DEFAULT_OPEN_DIALOG_URL;
2929
}
3030

3131
/**
3232
* Returns open dialog url for media browser
33+
*
34+
* @return string
3335
*/
34-
public function getOpenDialogUrl(): string
36+
public function get(): string
3537
{
3638
return $this->openDialogUrl;
3739
}

0 commit comments

Comments
 (0)