Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/request/DiffusionRequest.php
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | if (!$object) { | ||||
return null; | return null; | ||||
} | } | ||||
$object->initializeFromDictionary($data); | $object->initializeFromDictionary($data); | ||||
return $object; | return $object; | ||||
} | } | ||||
/** | |||||
* Create a new request from an Aphront request dictionary. This is an | |||||
* internal method that you generally should not call directly; instead, | |||||
* call @{method:newFromDictionary}. | |||||
* | |||||
* @param map Map of Aphront request data. | |||||
* @return DiffusionRequest New request object. | |||||
* @task new | |||||
*/ | |||||
final public static function newFromAphrontRequestDictionary( | |||||
array $data, | |||||
AphrontRequest $request) { | |||||
$identifier = phutil_unescape_uri_path_component(idx($data, 'callsign')); | |||||
$object = self::newFromIdentifier($identifier, $request->getUser()); | |||||
$use_branches = $object->supportsBranches(); | |||||
if (isset($data['dblob'])) { | |||||
$parsed = self::parseRequestBlob(idx($data, 'dblob'), $use_branches); | |||||
} else { | |||||
$parsed = array( | |||||
'commit' => idx($data, 'commit'), | |||||
'path' => idx($data, 'path'), | |||||
'line' => idx($data, 'line'), | |||||
'branch' => idx($data, 'branch'), | |||||
); | |||||
} | |||||
$object->setUser($request->getUser()); | |||||
$object->initializeFromDictionary($parsed); | |||||
$object->lint = $request->getStr('lint'); | |||||
return $object; | |||||
} | |||||
/** | /** | ||||
* Internal. | * Internal. | ||||
* | * | ||||
* @task new | * @task new | ||||
*/ | */ | ||||
final private function __construct() { | final private function __construct() { | ||||
// <private> | // <private> | ||||
} | } | ||||
▲ Show 20 Lines • Show All 570 Lines • Show Last 20 Lines |