3 final class ReleephSummaryFieldSpecification
4 extends ReleephFieldSpecification
{
6 const MAX_SUMMARY_LENGTH
= 60;
8 public function shouldAppearInPropertyView() {
12 public function getFieldKey() {
16 public function getName() {
17 return pht('Summary');
20 public function getStorageKey() {
24 private $error = false;
26 public function renderEditControl(array $handles) {
27 return id(new AphrontFormTextControl())
28 ->setLabel(pht('Summary'))
30 ->setError($this->error
)
31 ->setValue($this->getValue())
32 ->setCaption(pht('Leave this blank to use the original commit title'));
35 public function renderHelpForArcanist() {
37 'A one-line title summarizing this request. '.
38 'Leave blank to use the original commit title.')."\n";
39 return phutil_console_wrap($text, 8);
42 public function validate($summary) {
43 if ($summary && strlen($summary) > self
::MAX_SUMMARY_LENGTH
) {
44 $this->error
= pht('Too long!');
45 throw new ReleephFieldParseException(
48 'Please keep your summary to under %d characters.',
49 self
::MAX_SUMMARY_LENGTH
));