Skip to content

Commit e2f2805

Browse files
author
joweecaquicla
committed
magento/adobe-stock-integration#1712: Remove DataObject usage from OpenDialogUrl provider - apply requested changes
1 parent 0192ca5 commit e2f2805

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,21 @@ class OpenDialogUrl
2020
*/
2121
private $openDialogUrl;
2222

23+
/**
24+
* @param string $url
25+
*/
26+
public function __construct(string $url = null)
27+
{
28+
$this->openDialogUrl = $url ?? self::DEFAULT_OPEN_DIALOG_URL;
29+
}
30+
2331
/**
2432
* Returns open dialog url for media browser
2533
*
2634
* @return string
2735
*/
2836
public function get(): string
2937
{
30-
if ($this->openDialogUrl) {
31-
return $this->openDialogUrl;
32-
}
33-
return self::DEFAULT_OPEN_DIALOG_URL;
38+
return $this->openDialogUrl;
3439
}
3540
}

0 commit comments

Comments
 (0)