function measure($message, callable $callback) { startMeasure($message); $result = $callback(); stopMeasure($message); return $result; }
/** * @param $order * * @return array */ private function getVariablesFromOrder($order) { $variables = []; foreach ($order as $order => $blocks) { foreach ($blocks as $block => $actions) { foreach ($actions as $action) { startMeasure('Getting output: ' . $action->getClass() . ' ' . $action->getMethod() . ' ' . $block . ' ' . $order); $variables[$block][] = $action->getHtml(); stopMeasure('Getting output: ' . $action->getClass() . ' ' . $action->getMethod() . ' ' . $block . ' ' . $order); } } } return $variables; }