Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/ArcanistPrompt.php
Show First 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | private function saveResponse($scope, $response_value) { | ||||
foreach ($response_list as $key => $response) { | foreach ($response_list as $key => $response) { | ||||
if ($response->getPrompt() === $this->getKey()) { | if ($response->getPrompt() === $this->getKey()) { | ||||
unset($response_list[$key]); | unset($response_list[$key]); | ||||
} | } | ||||
} | } | ||||
if ($response_value !== null) { | if ($response_value !== null) { | ||||
$response_list[] = id(new ArcanistPromptResponse()) | $response_list[] = (new ArcanistPromptResponse()) | ||||
->setPrompt($this->getKey()) | ->setPrompt($this->getKey()) | ||||
->setResponse($response_value); | ->setResponse($response_value); | ||||
} | } | ||||
$option = $source_list->getConfigOption($config_key); | $option = $source_list->getConfigOption($config_key); | ||||
$option->writeValue($source, $response_list); | $option->writeValue($source, $response_list); | ||||
} | } | ||||
} | } |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0