function pre_exec_function() { if (! $definition = $this->_filter->filter_arg_value('definition') or ! is_array($definition)) { return; }
foreach ($definition as $arg_name => &$arg_definition) { // names the callback after the arg name $callback_name = "callback_$arg_name";
if (isset($arg_definition['filter']) and $arg_definition['filter'] == FILTER_CALLBACK and isset($arg_definition['options']) and ! $this->_function_params->param_exists($callback_name)) { // there is a callback and it has not been processed yet, adds the callback param $this->_function_params->set_param($callback_name, $arg_definition['options']); // updates the callback in case an object or a closuse is returned $arg_definition['options'] = $this->_filter->filter_callback($callback_name); $definition_has_changed = true; } }
if (! empty($definition_has_changed)) { $this->returned_params['definition'] = $definition; }