Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistFlagWorkflow.php
| Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | EOTEXT | ||||
| private static function flagWasEdited($flag, $verb) { | private static function flagWasEdited($flag, $verb) { | ||||
| $color = idx(self::$colorMap, $flag['color'], 'cyan'); | $color = idx(self::$colorMap, $flag['color'], 'cyan'); | ||||
| $note = $flag['note']; | $note = $flag['note']; | ||||
| if ($note) { | if ($note) { | ||||
| // Make sure notes that are long or have line breaks in them or | // Make sure notes that are long or have line breaks in them or | ||||
| // whatever don't mess up the formatting. | // whatever don't mess up the formatting. | ||||
| $note = implode(' ', preg_split('/\s+/', $note)); | $note = implode(' ', preg_split('/\s+/', $note)); | ||||
| $note = ' ('.phutil_utf8_shorten($note, 40, '...').')'; | $note = ' ('. | ||||
| id(new PhutilUTF8StringTruncator()) | |||||
| ->setMaximumGlyphs(40) | |||||
| ->setTerminator('...') | |||||
| ->truncateString($note). | |||||
| ')'; | |||||
| } | } | ||||
| echo phutil_console_format( | echo phutil_console_format( | ||||
| "<fg:{$color}>%s</fg> flag%s $verb!\n", | "<fg:{$color}>%s</fg> flag%s $verb!\n", | ||||
| $flag['colorName'], | $flag['colorName'], | ||||
| $note); | $note); | ||||
| } | } | ||||
| public function run() { | public function run() { | ||||
| ▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines | |||||