Skip to content

Commit 8c762ed

Browse files
committed
7241 Restore old @api method "process" and add a new method
This new method contains the new parameter and will be called from the old method.
1 parent 2d72ea0 commit 8c762ed

File tree

5 files changed

+30
-12
lines changed

5 files changed

+30
-12
lines changed

app/code/Magento/Config/Console/Command/ConfigSet/ProcessorFacade.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,31 @@ public function __construct(
9797
* @param string $scope The configuration scope (default, website, or store)
9898
* @param string $scopeCode The scope code
9999
* @param boolean $lock The lock flag
100-
* @param string $lockTarget
101100
* @return string Processor response message
102101
* @throws ValidatorException If some validation is wrong
103-
* @internal param bool $share The share flag
104102
* @since 100.2.0
103+
* @deprecated
104+
* @see processWithLockTarget()
105+
*/
106+
public function process($path, $value, $scope, $scopeCode, $lock)
107+
{
108+
return $this->processWithLockTarget($path, $value, $scope, $scopeCode, $lock);
109+
}
110+
111+
112+
/**
113+
* Processes config:set command with the option to set a target file.
114+
*
115+
* @param string $path The configuration path in format section/group/field_name
116+
* @param string $value The configuration value
117+
* @param string $scope The configuration scope (default, website, or store)
118+
* @param string $scopeCode The scope code
119+
* @param boolean $lock The lock flag
120+
* @param string $lockTarget
121+
* @return string Processor response message
122+
* @throws ValidatorException If some validation is wrong
105123
*/
106-
public function process($path, $value, $scope, $scopeCode, $lock, $lockTarget = ConfigFilePool::APP_ENV)
124+
public function processWithLockTarget($path, $value, $scope, $scopeCode, $lock, $lockTarget = ConfigFilePool::APP_ENV)
107125
{
108126
try {
109127
$this->scopeValidator->isValid($scope, $scopeCode);

app/code/Magento/Config/Console/Command/ConfigSetCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
173173
$lockTargetPath = ConfigFilePool::APP_CONFIG;
174174
}
175175

176-
return $this->processorFacadeFactory->create()->process(
176+
return $this->processorFacadeFactory->create()->processWithLockTarget(
177177
$input->getArgument(static::ARG_PATH),
178178
$input->getArgument(static::ARG_VALUE),
179179
$input->getOption(static::OPTION_SCOPE),

app/code/Magento/Config/Test/Unit/Console/Command/ConfigSet/ProcessorFacadeTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testProcess()
123123

124124
$this->assertSame(
125125
'Value was saved.',
126-
$this->model->process('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false)
126+
$this->model->processWithLockTarget('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false)
127127
);
128128
}
129129

@@ -138,7 +138,7 @@ public function testProcessWithValidatorException(LocalizedException $exception)
138138
->method('isValid')
139139
->willThrowException($exception);
140140

141-
$this->model->process('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false);
141+
$this->model->processWithLockTarget('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false);
142142
}
143143

144144
/**
@@ -173,7 +173,7 @@ public function testProcessWithConfigurationMismatchException()
173173
$this->configMock->expects($this->never())
174174
->method('clean');
175175

176-
$this->model->process('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false);
176+
$this->model->processWithLockTarget('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false);
177177
}
178178

179179
/**
@@ -199,7 +199,7 @@ public function testProcessWithCouldNotSaveException()
199199
$this->configMock->expects($this->never())
200200
->method('clean');
201201

202-
$this->model->process('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false);
202+
$this->model->processWithLockTarget('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, false);
203203
}
204204

205205
public function testExecuteLockEnv()
@@ -219,7 +219,7 @@ public function testExecuteLockEnv()
219219

220220
$this->assertSame(
221221
'Value was saved in app/etc/env.php and locked.',
222-
$this->model->process('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, true)
222+
$this->model->processWithLockTarget('test/test/test', 'test', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, true)
223223
);
224224
}
225225

@@ -240,7 +240,7 @@ public function testExecuteLockConfig()
240240

241241
$this->assertSame(
242242
'Value was saved in app/etc/config.php and locked.',
243-
$this->model->process(
243+
$this->model->processWithLockTarget(
244244
'test/test/test',
245245
'test',
246246
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,

app/code/Magento/Config/Test/Unit/Console/Command/ConfigSetCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function testExecute()
9494
->method('create')
9595
->willReturn($this->processorFacadeMock);
9696
$this->processorFacadeMock->expects($this->once())
97-
->method('process')
97+
->method('processWithLockTarget')
9898
->willReturn('Some message');
9999
$this->emulatedAreProcessorMock->expects($this->once())
100100
->method('process')

app/code/Magento/Deploy/Model/Mode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private function saveAppConfigs($mode)
207207
$configs = $this->configProvider->getConfigs($this->getMode(), $mode);
208208
foreach ($configs as $path => $value) {
209209
$this->emulatedAreaProcessor->process(function () use ($path, $value) {
210-
$this->processorFacadeFactory->create()->process(
210+
$this->processorFacadeFactory->create()->processWithLockTarget(
211211
$path,
212212
$value,
213213
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,

0 commit comments

Comments
 (0)