Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F110144995
DifferentialParseCommitMessageConduitAPIMethod.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
Thu, Apr 24, 22:06
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Apr 26, 22:06 (2 d)
Engine
blob
Format
Raw Data
Handle
25757686
Attached To
rPH Phabricator
DifferentialParseCommitMessageConduitAPIMethod.php
View Options
<?php
final
class
DifferentialParseCommitMessageConduitAPIMethod
extends
DifferentialConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'differential.parsecommitmessage'
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Parse commit messages for Differential fields.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'corpus'
=>
'required string'
,
'partial'
=>
'optional bool'
,
);
}
protected
function
defineReturnType
()
{
return
'nonempty dict'
;
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$parser
=
DifferentialCommitMessageParser
::
newStandardParser
(
$viewer
);
$is_partial
=
$request
->
getValue
(
'partial'
);
if
(
$is_partial
)
{
$parser
->
setRaiseMissingFieldErrors
(
false
);
}
$corpus
=
$request
->
getValue
(
'corpus'
);
$field_map
=
$parser
->
parseFields
(
$corpus
);
$errors
=
$parser
->
getErrors
();
$xactions
=
$parser
->
getTransactions
();
$revision_id_value
=
idx
(
$field_map
,
DifferentialRevisionIDCommitMessageField
::
FIELDKEY
);
$revision_id_valid_domain
=
PhabricatorEnv
::
getProductionURI
(
''
);
return
array
(
'errors'
=>
$errors
,
'fields'
=>
$field_map
,
'revisionIDFieldInfo'
=>
array
(
'value'
=>
$revision_id_value
,
'validDomain'
=>
$revision_id_valid_domain
,
),
'transactions'
=>
$xactions
,
);
}
}
Event Timeline
Log In to Comment