Changeset View
Changeset View
Standalone View
Standalone View
src/applications/fact/chart/PhabricatorXChartFunction.php
<?php | <?php | ||||
final class PhabricatorXChartFunction | final class PhabricatorXChartFunction | ||||
extends PhabricatorChartFunction { | extends PhabricatorChartFunction { | ||||
const FUNCTIONKEY = 'x'; | const FUNCTIONKEY = 'x'; | ||||
protected function newArguments(array $arguments) { | protected function newArguments() { | ||||
if (count($arguments) !== 0) { | return array(); | ||||
amckinley: Just for the sake of code coverage, have you tried making any functions accept more than one… | |||||
throw new Exception( | |||||
pht( | |||||
'Chart function "x()" expects zero arguments, got %s.', | |||||
count($arguments))); | |||||
} | |||||
} | } | ||||
public function getDatapoints(PhabricatorChartDataQuery $query) { | public function getDatapoints(PhabricatorChartDataQuery $query) { | ||||
$x_min = $query->getMinimumValue(); | $x_min = $query->getMinimumValue(); | ||||
$x_max = $query->getMaximumValue(); | $x_max = $query->getMaximumValue(); | ||||
$limit = $query->getLimit(); | $limit = $query->getLimit(); | ||||
$points = array(); | $points = array(); | ||||
Show All 16 Lines |
Just for the sake of code coverage, have you tried making any functions accept more than one argument? There's a lot of fancy looping/iterating in this diff that I don't think is getting put through its paces by the existing 0/1-argument functions.