🎨 Change \ormStopWatch::ComputeGoal for IDE convencience, add phpdoc

This commit is contained in:
Pierre Goiffon
2020-02-28 12:01:34 +01:00
parent 5a287fabba
commit a45d1336f4

View File

@@ -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);
}
/**