Path: blob/master/src/applications/differential/field/DifferentialTitleCommitMessageField.php
12256 views
<?php12final class DifferentialTitleCommitMessageField3extends DifferentialCommitMessageField {45const FIELDKEY = 'title';67public function getFieldName() {8return pht('Title');9}1011public function getFieldOrder() {12return 1000;13}1415public static function getDefaultTitle() {16return pht('<<Replace this line with your revision title>');17}1819public function parseFieldValue($value) {20if ($value === self::getDefaultTitle()) {21$this->raiseParseException(22pht(23'Replace the default title line with a human-readable revision '.24'title which describes the changes you are making.'));25}2627return parent::parseFieldValue($value);28}2930public function validateFieldValue($value) {31if (!strlen($value)) {32$this->raiseValidationException(33pht(34'You must provide a revision title in the first line '.35'of your commit message.'));36}37}3839public function readFieldValueFromObject(DifferentialRevision $revision) {40$value = $revision->getTitle();4142if (!strlen($value)) {43return self::getDefaultTitle();44}4546return $value;47}4849public function getFieldTransactions($value) {50return array(51array(52'type' => DifferentialRevisionTitleTransaction::EDITKEY,53'value' => $value,54),55);56}5758}596061