Page MenuHomePhorge

D25906.1741706257.diff
No OneTemporary

D25906.1741706257.diff

diff --git a/src/applications/fact/chart/PhabricatorChartDataQuery.php b/src/applications/fact/chart/PhabricatorChartDataQuery.php
--- a/src/applications/fact/chart/PhabricatorChartDataQuery.php
+++ b/src/applications/fact/chart/PhabricatorChartDataQuery.php
@@ -7,6 +7,9 @@
private $minimumValue;
private $maximumValue;
+ /**
+ * @param int $minimum_value Epoch timestamp of the first input data
+ */
public function setMinimumValue($minimum_value) {
$this->minimumValue = $minimum_value;
return $this;
@@ -16,6 +19,9 @@
return $this->minimumValue;
}
+ /**
+ * @param int $maximum_value Epoch timestamp of the last input data
+ */
public function setMaximumValue($maximum_value) {
$this->maximumValue = $maximum_value;
return $this;
@@ -25,6 +31,10 @@
return $this->maximumValue;
}
+ /**
+ * @param int $limit Maximum amount of data points to handle. If there are
+ * more data points, some in-between data will be ignored.
+ */
public function setLimit($limit) {
$this->limit = $limit;
return $this;
@@ -34,6 +44,13 @@
return $this->limit;
}
+ /**
+ * Filter input data: Remove values lower resp. higher than the minimum
+ * resp. maximum values; remove some data if amount of data above the limit.
+ *
+ * @param array<int> $xv Epoch timestamps of unfitlered input data
+ * @return array<int> Epoch timestamps of fitlered input data
+ */
public function selectInputValues(array $xv) {
$result = array();
diff --git a/src/applications/fact/chart/PhabricatorChartDataset.php b/src/applications/fact/chart/PhabricatorChartDataset.php
--- a/src/applications/fact/chart/PhabricatorChartDataset.php
+++ b/src/applications/fact/chart/PhabricatorChartDataset.php
@@ -13,6 +13,9 @@
return $this->functions;
}
+ /**
+ * @param array<PhabricatorComposeChartFunction> $functions
+ */
final public function setFunctions(array $functions) {
assert_instances_of($functions, 'PhabricatorComposeChartFunction');
@@ -67,7 +70,10 @@
abstract protected function newChartDisplayData(
PhabricatorChartDataQuery $data_query);
-
+ /**
+ * @param PhabricatorChartDataQuery $data_query
+ * @return PhabricatorChartDisplayData
+ */
final public function getTabularDisplayData(
PhabricatorChartDataQuery $data_query) {
$results = array();
diff --git a/src/applications/fact/chart/PhabricatorChartFunction.php b/src/applications/fact/chart/PhabricatorChartFunction.php
--- a/src/applications/fact/chart/PhabricatorChartFunction.php
+++ b/src/applications/fact/chart/PhabricatorChartFunction.php
@@ -10,6 +10,12 @@
return $this->getPhobjectClassConstant('FUNCTIONKEY', 32);
}
+ /**
+ * Get all available PhabricatorChartFunction subclasses
+ *
+ * @return array<PhabricatorChartFunction> All Phabricator*ChartFunction
+ * classes which implement getFunctionKey()
+ */
final public static function getAllFunctions() {
return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
@@ -127,6 +133,11 @@
return $results;
}
+ /**
+ * Return arrays of x,y data points for a two-dimensional chart
+ * @param PhabricatorChartDataQuery $query
+ * @return array<array<int,int>> x => epoch value; y => incremental number
+ */
public function newDatapoints(PhabricatorChartDataQuery $query) {
$xv = $this->newInputValues($query);
diff --git a/src/applications/fact/chart/PhabricatorChartStackedAreaDataset.php b/src/applications/fact/chart/PhabricatorChartStackedAreaDataset.php
--- a/src/applications/fact/chart/PhabricatorChartStackedAreaDataset.php
+++ b/src/applications/fact/chart/PhabricatorChartStackedAreaDataset.php
@@ -7,6 +7,12 @@
private $stacks;
+ /**
+ * @param array<array> $stacks One or more arrays with
+ * PhabricatorChartFunctionLabel names of each PhabricatorChartFunction,
+ * grouped by stacking
+ * (e.g. [["created","reopened","moved-in"],["closed","moved-out"]])
+ */
public function setStacks(array $stacks) {
$this->stacks = $stacks;
return $this;
@@ -16,6 +22,10 @@
return $this->stacks;
}
+ /**
+ * @param PhabricatorChartDataQuery $data_query
+ * @return PhabricatorChartDisplayData
+ */
protected function newChartDisplayData(
PhabricatorChartDataQuery $data_query) {
@@ -211,6 +221,10 @@
return $must_define;
}
+ /**
+ * @param PhabricatorChartDataQuery $data_query
+ * @param array<PhabricatorChartFunction> $functions
+ */
private function getFunctionDatapoints(
PhabricatorChartDataQuery $data_query,
array $functions) {
@@ -231,6 +245,14 @@
return $points;
}
+ /**
+ * @param PhabricatorChartDataQuery $data_query
+ * @param array<string<epoch<string:int,string:int>>> $point_lists The key is
+ * the stack (the PhabricatorChartFunctionLabel name of the
+ * PhabricatorChartFunction (e.g. "created" or "moved-in")) and its value
+ * is an array of keys which are date epochs and their values are another
+ * array of x:date epoch and y:incremental integer pairs.
+ */
private function getGeometry(
PhabricatorChartDataQuery $data_query,
array $point_lists) {
diff --git a/src/applications/fact/engine/PhabricatorChartEngine.php b/src/applications/fact/engine/PhabricatorChartEngine.php
--- a/src/applications/fact/engine/PhabricatorChartEngine.php
+++ b/src/applications/fact/engine/PhabricatorChartEngine.php
@@ -45,6 +45,10 @@
return clone id($engine_map[$engine_key]);
}
+ /**
+ * Load all available chart engines.
+ * @return list<PhabricatorChartEngine> All available chart engines.
+ */
final public static function getAllChartEngines() {
return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
diff --git a/src/applications/fact/engine/PhabricatorChartRenderingEngine.php b/src/applications/fact/engine/PhabricatorChartRenderingEngine.php
--- a/src/applications/fact/engine/PhabricatorChartRenderingEngine.php
+++ b/src/applications/fact/engine/PhabricatorChartRenderingEngine.php
@@ -25,6 +25,11 @@
return $this->chart;
}
+ /**
+ * Load the chart by its key
+ * @param string $chart_key 12-character string identifier of chart to load
+ * @return PhabricatorFactChart
+ */
public function loadChart($chart_key) {
$chart = id(new PhabricatorFactChart())->loadOneWhere(
'chartKey = %s',
@@ -37,12 +42,20 @@
return $chart;
}
+ /**
+ * Get the relative URI of the chart
+ * @param string $chart_key 12-character string identifier of chart to load
+ * @return string Relative URI of the chart, e.g. "fact/chart/a1b2c3d4e5f6/"
+ */
public static function getChartURI($chart_key) {
return id(new PhabricatorFactChart())
->setChartKey($chart_key)
->getURI();
}
+ /**
+ * @return PhabricatorFactChart
+ */
public function getStoredChart() {
if (!$this->storedChart) {
$chart = $this->getChart();
@@ -84,6 +97,9 @@
return $this->storedChart;
}
+ /**
+ * @return PhutilSafeHTML
+ */
public function newChartView() {
$chart = $this->getStoredChart();
$chart_key = $chart->getChartKey();
diff --git a/src/applications/fact/engine/PhabricatorFactEngine.php b/src/applications/fact/engine/PhabricatorFactEngine.php
--- a/src/applications/fact/engine/PhabricatorFactEngine.php
+++ b/src/applications/fact/engine/PhabricatorFactEngine.php
@@ -11,11 +11,20 @@
->execute();
}
+ /**
+ * @return array All types of facts known by this FactEngine
+ */
abstract public function newFacts();
+ /**
+ * @return bool
+ */
abstract public function supportsDatapointsForObject(
PhabricatorLiskDAO $object);
+ /**
+ * Add new datapoints (due to a transaction) about an object
+ */
abstract public function newDatapointsForObject(PhabricatorLiskDAO $object);
final protected function getFact($key) {
diff --git a/src/applications/fact/engine/PhabricatorManiphestTaskFactEngine.php b/src/applications/fact/engine/PhabricatorManiphestTaskFactEngine.php
--- a/src/applications/fact/engine/PhabricatorManiphestTaskFactEngine.php
+++ b/src/applications/fact/engine/PhabricatorManiphestTaskFactEngine.php
@@ -3,6 +3,9 @@
final class PhabricatorManiphestTaskFactEngine
extends PhabricatorTransactionFactEngine {
+ /**
+ * @return array<PhabricatorCountFact> All known task related facts
+ */
public function newFacts() {
return array(
id(new PhabricatorCountFact())
diff --git a/src/applications/fact/storage/PhabricatorFactIntDatapoint.php b/src/applications/fact/storage/PhabricatorFactIntDatapoint.php
--- a/src/applications/fact/storage/PhabricatorFactIntDatapoint.php
+++ b/src/applications/fact/storage/PhabricatorFactIntDatapoint.php
@@ -49,6 +49,9 @@
return $this->objectPHID;
}
+ /**
+ * @param string $dimension_phid
+ */
public function setDimensionPHID($dimension_phid) {
$this->dimensionPHID = $dimension_phid;
return $this;
diff --git a/src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php b/src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php
--- a/src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php
+++ b/src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php
@@ -5,6 +5,9 @@
const CHARTENGINEKEY = 'project.burndown';
+ /**
+ * @param array<PhabricatorProject> $projects
+ */
public function setProjects(array $projects) {
assert_instances_of($projects, 'PhabricatorProject');
$project_phids = mpull($projects, 'getPHID');
@@ -97,6 +100,11 @@
$chart->attachDatasets($datasets);
}
+ /**
+ * @param string $fact_key The key of the new fact sum
+ * (e.g. "tasks.open-count.assign.project")
+ * @param array<string> Project PHIDs
+ */
private function newFactSum($fact_key, array $phids) {
$result = array();
$result[] = 'sum';

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 11, 15:17 (20 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1251170
Default Alt Text
D25906.1741706257.diff (9 KB)

Event Timeline