diff --git a/core/ormstopwatch.class.inc.php b/core/ormstopwatch.class.inc.php index 109afaae8c..3af604e2cc 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); } /**