Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98283524
ReleephSummaryFieldSpecification.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
Sat, Jan 11, 18:32
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Jan 13, 18:32 (2 d)
Engine
blob
Format
Raw Data
Handle
23549713
Attached To
rPH Phabricator
ReleephSummaryFieldSpecification.php
View Options
<?php
final
class
ReleephSummaryFieldSpecification
extends
ReleephFieldSpecification
{
const
MAX_SUMMARY_LENGTH
=
60
;
public
function
getName
()
{
return
'Summary'
;
}
public
function
getStorageKey
()
{
return
'summary'
;
}
private
$error
=
false
;
public
function
renderEditControl
(
AphrontRequest
$request
)
{
$summary
=
$request
->
getStr
(
'summary'
,
$this
->
getValue
());
return
id
(
new
AphrontFormTextControl
())
->
setLabel
(
'Summary'
)
->
setName
(
'summary'
)
->
setError
(
$this
->
error
)
->
setValue
(
$summary
)
->
setCaption
(
'Leave this blank to use the original commit title'
);
}
public
function
renderHelpForArcanist
()
{
$text
=
"A one-line title summarizing this request. "
.
"Leave blank to use the original commit title.
\n
"
;
return
phutil_console_wrap
(
$text
,
8
);
}
public
function
validate
(
$summary
)
{
if
(
$summary
&&
strlen
(
$summary
)
>
self
::
MAX_SUMMARY_LENGTH
)
{
$this
->
error
=
'Too long!'
;
throw
new
ReleephFieldParseException
(
$this
,
sprintf
(
'Please keep your summary to under %d characters.'
,
self
::
MAX_SUMMARY_LENGTH
));
}
}
}
Event Timeline
Log In to Comment