Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/request/DiffusionRequest.php
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | final public static function newFromDictionary(array $data) { | ||||
return $object; | return $object; | ||||
} | } | ||||
/** | /** | ||||
* Internal. | * Internal. | ||||
* | * | ||||
* @task new | * @task new | ||||
*/ | */ | ||||
final private function __construct() { | private function __construct() { | ||||
// <private> | // <private> | ||||
} | } | ||||
/** | /** | ||||
* Internal. Use @{method:newFromDictionary}, not this method. | * Internal. Use @{method:newFromDictionary}, not this method. | ||||
* | * | ||||
* @param string Repository identifier. | * @param string Repository identifier. | ||||
* @param PhabricatorUser Viewing user. | * @param PhabricatorUser Viewing user. | ||||
* @return DiffusionRequest New request object. | * @return DiffusionRequest New request object. | ||||
* @task new | * @task new | ||||
*/ | */ | ||||
final private static function newFromIdentifier( | private static function newFromIdentifier( | ||||
$identifier, | $identifier, | ||||
PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
$need_edit = false) { | $need_edit = false) { | ||||
$query = id(new PhabricatorRepositoryQuery()) | $query = id(new PhabricatorRepositoryQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIdentifiers(array($identifier)) | ->withIdentifiers(array($identifier)) | ||||
->needProfileImage(true) | ->needProfileImage(true) | ||||
Show All 19 Lines | /* -( Creating Requests )-------------------------------------------------- */ | ||||
/** | /** | ||||
* Internal. Use @{method:newFromDictionary}, not this method. | * Internal. Use @{method:newFromDictionary}, not this method. | ||||
* | * | ||||
* @param PhabricatorRepository Repository object. | * @param PhabricatorRepository Repository object. | ||||
* @return DiffusionRequest New request object. | * @return DiffusionRequest New request object. | ||||
* @task new | * @task new | ||||
*/ | */ | ||||
final private static function newFromRepository( | private static function newFromRepository( | ||||
PhabricatorRepository $repository) { | PhabricatorRepository $repository) { | ||||
$map = array( | $map = array( | ||||
PhabricatorRepositoryType::REPOSITORY_TYPE_GIT => 'DiffusionGitRequest', | PhabricatorRepositoryType::REPOSITORY_TYPE_GIT => 'DiffusionGitRequest', | ||||
PhabricatorRepositoryType::REPOSITORY_TYPE_SVN => 'DiffusionSvnRequest', | PhabricatorRepositoryType::REPOSITORY_TYPE_SVN => 'DiffusionSvnRequest', | ||||
PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL => | PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL => | ||||
'DiffusionMercurialRequest', | 'DiffusionMercurialRequest', | ||||
); | ); | ||||
Show All 14 Lines | /* -( Creating Requests )-------------------------------------------------- */ | ||||
/** | /** | ||||
* Internal. Use @{method:newFromDictionary}, not this method. | * Internal. Use @{method:newFromDictionary}, not this method. | ||||
* | * | ||||
* @param map Map of parsed data. | * @param map Map of parsed data. | ||||
* @return void | * @return void | ||||
* @task new | * @task new | ||||
*/ | */ | ||||
final private function initializeFromDictionary(array $data) { | private function initializeFromDictionary(array $data) { | ||||
$blob = idx($data, 'blob'); | $blob = idx($data, 'blob'); | ||||
if (strlen($blob)) { | if (strlen($blob)) { | ||||
$blob = self::parseRequestBlob($blob, $this->supportsBranches()); | $blob = self::parseRequestBlob($blob, $this->supportsBranches()); | ||||
$data = $blob + $data; | $data = $blob + $data; | ||||
} | } | ||||
$this->path = idx($data, 'path'); | $this->path = idx($data, 'path'); | ||||
$this->line = idx($data, 'line'); | $this->line = idx($data, 'line'); | ||||
▲ Show 20 Lines • Show All 482 Lines • Show Last 20 Lines |