Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / settings / controller / PhabricatorSettingsAdjustController.php
blob277835a9ef6eaa2be0fefb922e97cb635ecfcf3c
1 <?php
3 final class PhabricatorSettingsAdjustController
4 extends PhabricatorController {
6 public function handleRequest(AphrontRequest $request) {
7 $viewer = $this->getViewer();
9 $preferences = PhabricatorUserPreferences::loadUserPreferences($viewer);
11 $editor = id(new PhabricatorUserPreferencesEditor())
12 ->setActor($viewer)
13 ->setContentSourceFromRequest($request)
14 ->setContinueOnNoEffect(true)
15 ->setContinueOnMissingFields(true);
17 $key = $request->getStr('key');
18 $value = $request->getStr('value');
20 $xactions = array();
21 $xactions[] = $preferences->newTransaction($key, $value);
23 $editor->applyTransactions($preferences, $xactions);
25 return id(new AphrontAjaxResponse())->setContent(array());