From a45d1336f48f6aff556cad62fc1e323cb45c8e31 Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 28 Feb 2020 12:01:34 +0100 Subject: [PATCH] :art: Change \ormStopWatch::ComputeGoal for IDE convencience, add phpdoc --- core/ormstopwatch.class.inc.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/ormstopwatch.class.inc.php b/core/ormstopwatch.class.inc.php index 109afaae8..3af604e2c 100644 --- a/core/ormstopwatch.class.inc.php +++ b/core/ormstopwatch.class.inc.php @@ -251,17 +251,27 @@ class ormStopWatch return $sRes; } + /** + * @param \DBObject $oObject + * @param \AttributeStopWatch $oAttDef + * + * @return float goal value (in second) + * @uses \iMetricComputer::ComputeMetric() + * @throws \CoreException + */ protected function ComputeGoal($oObject, $oAttDef) { $sMetricComputer = $oAttDef->Get('goal_computing'); + /** @var \iMetricComputer $oComputer */ $oComputer = new $sMetricComputer(); + $aCallSpec = array($oComputer, 'ComputeMetric'); if (!is_callable($aCallSpec)) { throw new CoreException("Unknown class/verb '$sMetricComputer/ComputeMetric'"); } - $iRet = call_user_func($aCallSpec, $oObject); - return $iRet; + + return $oComputer->ComputeMetric($oObject); } /**