Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/fact/chart/PhabricatorShiftChartFunction.php
12256 views
1
<?php
2
3
final class PhabricatorShiftChartFunction
4
extends PhabricatorPureChartFunction {
5
6
const FUNCTIONKEY = 'shift';
7
8
protected function newArguments() {
9
return array(
10
$this->newArgument()
11
->setName('shift')
12
->setType('number'),
13
);
14
}
15
16
public function evaluateFunction(array $xv) {
17
$shift = $this->getArgument('shift');
18
19
$yv = array();
20
21
foreach ($xv as $x) {
22
$yv[] = $x + $shift;
23
}
24
25
return $yv;
26
}
27
28
}
29
30