Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2349182
ReleephSummaryFieldSpecification.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ReleephSummaryFieldSpecification.php
View Options
<?php
final
class
ReleephSummaryFieldSpecification
extends
ReleephFieldSpecification
{
const
MAX_SUMMARY_LENGTH
=
60
;
public
function
shouldAppearInPropertyView
()
{
return
false
;
}
public
function
getFieldKey
()
{
return
'summary'
;
}
public
function
getName
()
{
return
'Summary'
;
}
public
function
getStorageKey
()
{
return
'summary'
;
}
private
$error
=
false
;
public
function
renderEditControl
(
array
$handles
)
{
return
id
(
new
AphrontFormTextControl
())
->
setLabel
(
'Summary'
)
->
setName
(
'summary'
)
->
setError
(
$this
->
error
)
->
setValue
(
$this
->
getValue
())
->
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
));
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 11:25 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
411603
Default Alt Text
ReleephSummaryFieldSpecification.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment