Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/PhabricatorChangesetResponse.php
| <?php | <?php | ||||
| final class PhabricatorChangesetResponse extends AphrontProxyResponse { | final class PhabricatorChangesetResponse extends AphrontProxyResponse { | ||||
| private $renderedChangeset; | private $renderedChangeset; | ||||
| private $coverage; | private $coverage; | ||||
| private $undoTemplates; | private $changesetState; | ||||
| public function setRenderedChangeset($rendered_changeset) { | public function setRenderedChangeset($rendered_changeset) { | ||||
| $this->renderedChangeset = $rendered_changeset; | $this->renderedChangeset = $rendered_changeset; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setCoverage($coverage) { | public function getRenderedChangeset() { | ||||
| $this->coverage = $coverage; | return $this->renderedChangeset; | ||||
| return $this; | |||||
| } | } | ||||
| public function setUndoTemplates($undo_templates) { | public function setCoverage($coverage) { | ||||
| $this->undoTemplates = $undo_templates; | $this->coverage = $coverage; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| protected function buildProxy() { | protected function buildProxy() { | ||||
| return new AphrontAjaxResponse(); | return new AphrontAjaxResponse(); | ||||
| } | } | ||||
| public function reduceProxyResponse() { | public function reduceProxyResponse() { | ||||
| $content = array( | $content = array( | ||||
| 'changeset' => $this->renderedChangeset, | 'changeset' => $this->getRenderedChangeset(), | ||||
| ); | ) + $this->getChangesetState(); | ||||
| if ($this->coverage) { | if ($this->coverage) { | ||||
| $content['coverage'] = $this->coverage; | $content['coverage'] = $this->coverage; | ||||
| } | } | ||||
| if ($this->undoTemplates) { | return $this->getProxy()->setContent($content); | ||||
| $content['undoTemplates'] = $this->undoTemplates; | |||||
| } | } | ||||
| return $this->getProxy()->setContent($content); | public function setChangesetState(array $state) { | ||||
| $this->changesetState = $state; | |||||
| return $this; | |||||
| } | |||||
| public function getChangesetState() { | |||||
| return $this->changesetState; | |||||
| } | } | ||||
| } | } | ||||