Differential D18160 Diff 43696 src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | if ($type) { | ||||
} | } | ||||
} else { | } else { | ||||
$type = $option->getType(); | $type = $option->getType(); | ||||
switch ($type) { | switch ($type) { | ||||
default: | default: | ||||
$value = json_decode($value, true); | $value = json_decode($value, true); | ||||
if (!is_array($value)) { | if (!is_array($value)) { | ||||
switch ($type) { | switch ($type) { | ||||
case 'set': | |||||
$command = csprintf( | |||||
'./bin/config set %R %s', | |||||
$key, | |||||
'{"value1": true, "value2": true}'); | |||||
$message = sprintf( | |||||
"%s\n\n %s\n", | |||||
pht( | |||||
'Config key "%s" is of type "%s". Specify it in JSON. '. | |||||
'For example:', | |||||
$key, | |||||
$type), | |||||
$command); | |||||
break; | |||||
default: | default: | ||||
$message = pht( | $message = pht( | ||||
'Config key "%s" is of type "%s". Specify it in JSON.', | 'Config key "%s" is of type "%s". Specify it in JSON.', | ||||
$key, | $key, | ||||
$type); | $type); | ||||
break; | break; | ||||
} | } | ||||
throw new PhutilArgumentUsageException($message); | throw new PhutilArgumentUsageException($message); | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |