Changeset View
Changeset View
Standalone View
Standalone View
src/applications/fact/chart/PhabricatorChartFunction.php
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if (!$this->functionLabel) { | ||||
->setName(pht('Unlabeled Function')) | ->setName(pht('Unlabeled Function')) | ||||
->setColor('rgba(255, 0, 0, 1)') | ->setColor('rgba(255, 0, 0, 1)') | ||||
->setFillColor('rgba(255, 0, 0, 0.15)'); | ->setFillColor('rgba(255, 0, 0, 0.15)'); | ||||
} | } | ||||
return $this->functionLabel; | return $this->functionLabel; | ||||
} | } | ||||
final public function getKey() { | |||||
return $this->getFunctionLabel()->getKey(); | |||||
} | |||||
final public static function newFromDictionary(array $map) { | final public static function newFromDictionary(array $map) { | ||||
PhutilTypeSpec::checkMap( | PhutilTypeSpec::checkMap( | ||||
$map, | $map, | ||||
array( | array( | ||||
'function' => 'string', | 'function' => 'string', | ||||
'arguments' => 'list<wild>', | 'arguments' => 'list<wild>', | ||||
)); | )); | ||||
Show All 10 Lines | final public static function newFromDictionary(array $map) { | ||||
} | } | ||||
$function = id(clone $functions[$function_name]) | $function = id(clone $functions[$function_name]) | ||||
->setArguments($map['arguments']); | ->setArguments($map['arguments']); | ||||
return $function; | return $function; | ||||
} | } | ||||
public function toDictionary() { | |||||
return array( | |||||
'function' => $this->getFunctionKey(), | |||||
'arguments' => $this->getArgumentParser()->getRawArguments(), | |||||
); | |||||
} | |||||
public function getSubfunctions() { | public function getSubfunctions() { | ||||
$result = array(); | $result = array(); | ||||
$result[] = $this; | $result[] = $this; | ||||
foreach ($this->getFunctionArguments() as $argument) { | foreach ($this->getFunctionArguments() as $argument) { | ||||
foreach ($argument->getSubfunctions() as $subfunction) { | foreach ($argument->getSubfunctions() as $subfunction) { | ||||
$result[] = $subfunction; | $result[] = $subfunction; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |