} final public static function newFromAphrontRequestDictionary(array $data) { $vcs = null; $repository = null; $callsign = idx($data, 'callsign'); if ($callsign) { $repository = id(new PhabricatorRepository())->loadOneWhere( 'callsign = %s', $callsign); if (!$repository) { throw new Exception("No such repository '{$callsign}'."); } $vcs = $repository->getVersionControlSystem(); } switch ($vcs) { case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: $class = 'DiffusionGitRequest'; break; default: $class = 'DiffusionRequest'; break; } $object = new $class(); $object->callsign = $callsign; $object->repository = $repository; $object->line = idx($data, 'line'); $object->commit = idx($data, 'commit'); $object->path = idx($data, 'path'); $object->initializeFromAphrontRequestDictionary(); return $object; } protected function initializeFromAphrontRequestDictionary() { } protected function parsePath($path) { $this->path = $path; } public function getRepository() { return $this->repository; } public function getCallsign() { return $this->callsign; } public function getPath() { return $this->path; } public function getLine() { return $this->line; } public function getCommit() { return $this->commit; } public function getBranch() { return $this->branch; } final public function getRawCommit() { return $this->commit; } public function getCommitURIComponent($commit) { return $commit; } public function getBranchURIComponent($branch) { return $branch; } }