Skip to content

Commit 81f3152

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 01ebf97 commit 81f3152

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

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

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

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

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

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

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

206206
public function testExecuteLockEnv()
@@ -220,7 +220,7 @@ public function testExecuteLockEnv()
220220

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

@@ -241,7 +241,7 @@ public function testExecuteLockConfig()
241241

242242
$this->assertSame(
243243
'Value was saved in app/etc/config.php and locked.',
244-
$this->model->process(
244+
$this->model->processWithLockTarget(
245245
'test/test/test',
246246
'test',
247247
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
@@ -217,7 +217,7 @@ private function saveAppConfigs($mode)
217217
$configs = $this->configProvider->getConfigs($this->getMode(), $mode);
218218
foreach ($configs as $path => $item) {
219219
$this->emulatedAreaProcessor->process(function () use ($path, $item) {
220-
$this->processorFacadeFactory->create()->process(
220+
$this->processorFacadeFactory->create()->processWithLockTarget(
221221
$path,
222222
$item['value'],
223223
ScopeConfigInterface::SCOPE_TYPE_DEFAULT,

0 commit comments

Comments
 (0)