Skip to content

Commit cf1a716

Browse files
authored
Update ConfigSetCommand.php
fix static tests failures: ``` /var/www/html/setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php:76 The method execute() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. ``` ``` FILE: ...tml/setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php ---------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ---------------------------------------------------------------------- 20 | WARNING | [ ] Class description should contain additional | | information beyond the name already supplies. 87 | WARNING | [x] Expected 0 spaces after opening bracket; newline | | found ---------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY ---------------------------------------------------------------------- ```
1 parent 5f98975 commit cf1a716

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
8484
$commandOptions[$option->getName()] = false;
8585

8686
$currentValue = $this->deploymentConfig->get($option->getConfigPath());
87-
if (
88-
($currentValue !== null) &&
87+
$needOverwrite = ($currentValue !== null) &&
8988
($inputOptions[$option->getName()] !== null) &&
90-
($inputOptions[$option->getName()] !== $currentValue)
91-
) {
89+
($inputOptions[$option->getName()] !== $currentValue);
90+
if ($needOverwrite) {
9291
$dialog = $this->getHelperSet()->get('question');
9392
$question = new Question(
9493
'<question>Overwrite the existing configuration for ' . $option->getName() . '?[Y/n]</question>',

0 commit comments

Comments
 (0)