Skip to content

Commit f33b038

Browse files
author
Graham Wharton
committed
Initialise Database Helper from Object Manager if not passed by DI.
Increases backwards compatability.
1 parent 76e74ca commit f33b038

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/Theme/Model/Design/Backend

1 file changed

+4
-4
lines changed

app/code/Magento/Theme/Model/Design/Backend/File.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class File extends BackendFile
5454
* @param RequestDataInterface $requestData
5555
* @param Filesystem $filesystem
5656
* @param UrlInterface $urlBuilder
57-
* @param Database $databaseHelper
5857
* @param AbstractResource|null $resource
5958
* @param AbstractDb|null $resourceCollection
6059
* @param array $data
60+
* @param Database $databaseHelper
6161
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6262
*/
6363
public function __construct(
@@ -69,10 +69,10 @@ public function __construct(
6969
RequestDataInterface $requestData,
7070
Filesystem $filesystem,
7171
UrlInterface $urlBuilder,
72-
Database $databaseHelper,
7372
AbstractResource $resource = null,
7473
AbstractDb $resourceCollection = null,
75-
array $data = []
74+
array $data = [],
75+
Database $databaseHelper = null
7676
) {
7777
parent::__construct(
7878
$context,
@@ -87,7 +87,7 @@ public function __construct(
8787
$data
8888
);
8989
$this->urlBuilder = $urlBuilder;
90-
$this->databaseHelper = $databaseHelper;
90+
$this->databaseHelper = $databaseHelper ?: ObjectManager::getInstance()->get(Database::class);
9191
}
9292

9393
/**

0 commit comments

Comments
 (0)