Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / nuance / controller / NuanceSourceActionController.php
bloba9fb41bccd0fc29d13643492312367fe8cf97351
1 <?php
3 final class NuanceSourceActionController extends NuanceController {
5 public function handleRequest(AphrontRequest $request) {
6 $viewer = $this->getViewer();
8 $source = id(new NuanceSourceQuery())
9 ->setViewer($viewer)
10 ->withIDs(array($request->getURIData('id')))
11 ->executeOne();
12 if (!$source) {
13 return new Aphront404Response();
16 $def = $source->getDefinition();
18 $def
19 ->setViewer($viewer)
20 ->setSource($source);
22 $response = $def->handleActionRequest($request);
23 if ($response instanceof AphrontResponse) {
24 return $response;
27 $title = $source->getName();
28 $crumbs = $this->buildApplicationCrumbs();
29 $crumbs->addTextCrumb($title);
31 return $this->newPage()
32 ->setTitle($title)
33 ->setCrumbs($crumbs)
34 ->appendChild($response);