Path: blob/master/src/infrastructure/syntax/PhabricatorSyntaxStyle.php
12241 views
<?php12abstract class PhabricatorSyntaxStyle extends Phobject {34abstract public function getStyleName();5abstract public function getStyleMap();67final public function getStyleOrder() {8return (string)id(new PhutilSortVector())9->addInt($this->isDefaultStyle() ? 0 : 1)10->addString($this->getStyleName());11}1213final public function getSyntaxStyleKey() {14return $this->getPhobjectClassConstant('STYLEKEY');15}1617final public function isDefaultStyle() {18return ($this->getSyntaxStyleKey() == 'default');19}2021public static function getAllStyles() {22return id(new PhutilClassMapQuery())23->setAncestorClass(__CLASS__)24->setUniqueMethod('getSyntaxStyleKey')25->setSortMethod('getStyleName')26->execute();27}2829final public function getRemarkupStyleMap() {30$map = array(31'rbw_r' => 'color: red',32'rbw_o' => 'color: orange',33'rbw_y' => 'color: yellow',34'rbw_g' => 'color: green',35'rbw_b' => 'color: blue',36'rbw_i' => 'color: indigo',37'rbw_v' => 'color: violet',38);3940return $map + $this->getStyleMap();41}4243}444546