@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
1<?php
2
3final class PhabricatorConstantChartFunction
4 extends PhabricatorPureChartFunction {
5
6 const FUNCTIONKEY = 'constant';
7
8 protected function newArguments() {
9 return array(
10 $this->newArgument()
11 ->setName('n')
12 ->setType('number'),
13 );
14 }
15
16 public function evaluateFunction(array $xv) {
17 $n = $this->getArgument('n');
18
19 $yv = array();
20
21 foreach ($xv as $x) {
22 $yv[] = $n;
23 }
24
25 return $yv;
26 }
27
28}