/** * @see IParamDefinition::format * * @since 0.5 * * @param $param IParam * @param $definitions array of IParamDefinition * @param $params array of IParam */ public function format(IParam $param, array &$definitions, array $params) { if ($this->isList()) { $values = $param->getValue(); foreach ($values as &$value) { $value = $this->formatValue($value, $param, $definitions, $params); } $param->setValue($values); $this->formatList($param, $definitions, $params); } else { $param->setValue($this->formatValue($param->getValue(), $param, $definitions, $params)); } }
/** * @see IParamDefinition::format * * @since 1.0 * @deprecated * * @param IParam $param * @param IParamDefinition[] $definitions * @param IParam[] $params */ public function format(IParam $param, array &$definitions, array $params) { if ($this->isList()) { $values = $param->getValue(); foreach ($values as &$value) { $value = $this->formatValue($value, $param, $definitions, $params); } $param->setValue($values); $this->formatList($param, $definitions, $params); } else { $param->setValue($this->formatValue($param->getValue(), $param, $definitions, $params)); } // deprecated, deriving classes should not add array-definitions to the list $definitions = self::getCleanDefinitions($definitions); if (array_key_exists('post-format', $this->options)) { $param->setValue(call_user_func($this->options['post-format'], $param->getValue())); } }