Skip to content

Commit 7429a63

Browse files
authored
fix: Optional parameter for constructor (backwards compatible)
1 parent b0655ff commit 7429a63

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

app/code/Magento/Csp/Model/Mode/ConfigManager.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ class ConfigManager implements ModeConfigManagerInterface
2828
*/
2929
private $config;
3030

31-
/**
32-
* @var ModeConfiguredFactory
33-
*/
34-
private $modeConfiguredFactory;
35-
3631
/**
3732
* @var Store
3833
*/
@@ -48,27 +43,33 @@ class ConfigManager implements ModeConfigManagerInterface
4843
*/
4944
private Http $request;
5045

46+
/**
47+
* @var ModeConfiguredFactory
48+
*/
49+
private $modeConfiguredFactory;
50+
5151
/**
5252
* @param ScopeConfigInterface $config
53-
* @param ModeConfiguredFactory $modeConfiguredFactory
5453
* @param Store $store
5554
* @param State $state
5655
* @param Http|null $request
56+
* @param ModeConfiguredFactory|null $modeConfiguredFactory
5757
*/
5858
public function __construct(
5959
ScopeConfigInterface $config,
60-
ModeConfiguredFactory $modeConfiguredFactory,
6160
Store $store,
6261
State $state,
63-
?Http $request = null
62+
?Http $request = null,
63+
?ModeConfiguredFactory $modeConfiguredFactory = null
6464
) {
6565
$this->config = $config;
66-
$this->modeConfiguredFactory = $modeConfiguredFactory;
6766
$this->storeModel = $store;
6867
$this->state = $state;
6968

7069
$this->request = $request
7170
?? ObjectManager::getInstance()->get(Http::class);
71+
$this->modeConfiguredFactory = $modeConfiguredFactory
72+
?? ObjectManager::getInstance()->get(ModeConfiguredFactory::class);
7273
}
7374

7475
/**

0 commit comments

Comments
 (0)