Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97862723
ConduitAPI_differential_createrawdiff_Method.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 21:59
Size
1 KB
Mime Type
text/x-php
Expires
Wed, Jan 8, 21:59 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23422224
Attached To
rPH Phabricator
ConduitAPI_differential_createrawdiff_Method.php
View Options
<?php
/**
* @group conduit
*/
final
class
ConduitAPI_differential_createrawdiff_Method
extends
ConduitAPI_differential_Method
{
public
function
getMethodDescription
()
{
return
"Create a new Differential diff from a raw diff source."
;
}
public
function
defineParamTypes
()
{
return
array
(
'diff'
=>
'required string'
,
);
}
public
function
defineReturnType
()
{
return
'nonempty dict'
;
}
public
function
defineErrorTypes
()
{
return
array
(
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$raw_diff
=
$request
->
getValue
(
'diff'
);
$parser
=
new
ArcanistDiffParser
();
$changes
=
$parser
->
parseDiff
(
$raw_diff
);
$diff
=
DifferentialDiff
::
newFromRawChanges
(
$changes
);
$diff
->
setLintStatus
(
DifferentialLintStatus
::
LINT_SKIP
);
$diff
->
setUnitStatus
(
DifferentialUnitStatus
::
UNIT_SKIP
);
$diff
->
setAuthorPHID
(
$request
->
getUser
()->
getPHID
());
$diff
->
setCreationMethod
(
'web'
);
$diff
->
save
();
return
$this
->
buildDiffInfoDictionary
(
$diff
);
}
}
Event Timeline
Log In to Comment