Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
1.1 kB · 44 lines
PHP
123456789101112131415161718192021222324252627282930313233343536373839404142434445<?php
abstract class PhabricatorSyntaxStyle extends Phobject {
abstract public function getStyleName(); abstract public function getStyleMap();
final public function getStyleOrder() { return (string)id(new PhutilSortVector()) ->addInt($this->isDefaultStyle() ? 0 : 1) ->addString($this->getStyleName()); }
final public function getSyntaxStyleKey() { return $this->getPhobjectClassConstant('STYLEKEY'); }
final public function isDefaultStyle() { return ($this->getSyntaxStyleKey() == 'default'); }
public static function getAllStyles() { return id(new PhutilClassMapQuery()) ->setAncestorClass(self::class) ->setUniqueMethod('getSyntaxStyleKey') ->setSortMethod('getStyleName') ->execute(); }
final public function getRemarkupStyleMap() { $map = array( 'rbw_r' => 'color: red', 'rbw_o' => 'color: orange', 'rbw_y' => 'color: yellow', 'rbw_g' => 'color: green', 'rbw_b' => 'color: blue', 'rbw_i' => 'color: indigo', 'rbw_v' => 'color: violet', );
return $map + $this->getStyleMap(); }
}