本文整理汇总了PHP中Reflector::getParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP Reflector::getParameters方法的具体用法?PHP Reflector::getParameters怎么用?PHP Reflector::getParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reflector
的用法示例。
在下文中一共展示了Reflector::getParameters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHash
/**
* Returns the hash.
*
* @return string
*/
public function getHash()
{
// Never remove the database from the identifier
// Most SQL queries do not include the target database
$identifier = $this->reflector->getDatabase() . $this->reflector->getSql() . serialize($this->reflector->getParameters());
return md5($identifier);
}
示例2: _getParameters
protected function _getParameters(Reflector $method)
{
$return = array();
foreach ($method->getParameters() as $param) {
$line = array();
$line['name'] = $param->__toString();
if ($param->isOptional()) {
$line['default'] = $param->getDefaultValue();
}
$return[] = $line;
}
return $return;
}
示例3: reflectParams
protected function reflectParams(Reflector $ref, SimpleXMLElement $element)
{
$paramsEl = $element->addChild('params');
foreach ($ref->getParameters() as $i => $refParam) {
$param = $paramsEl->addChild('param');
// passed by reference
if ($refParam->isPassedByReference()) {
$param['passedByReference'] = '1';
}
// name
$param->name = $refParam->getName();
// type
if ($refClass = $refParam->getClass()) {
$param->type = $refClass->getName();
} elseif ($refParam->isArray()) {
$param->type = 'array';
}
// value
if ($refParam->isOptional()) {
$param->value = $this->varExport($refParam->getDefaultValue());
}
}
}
示例4: create_markup_to_parameter_section
function create_markup_to_parameter_section(Reflector $obj, $content)
{
/* {{{ */
$param_name = ($obj instanceof ReflectionMethod ? 'METHOD' : 'FUNCTION') . '_PARAMETERS';
/* {PARAMETERS} */
if ($obj->getNumberOfParameters()) {
$ident = get_ident_size($param_name, $content);
$parameters = $obj->getParameters();
$content = preg_replace('/\\{' . $param_name . '\\}/', create_markup_to_params($parameters, $ident), $content);
/* {PARAMETERS_DESCRIPTION} */
if ($ident = get_ident_size('PARAMETERS_DESCRIPTION', $content)) {
$count = 1;
$markup = "<variablelist>" . PHP_EOL;
foreach ($parameters as $param) {
$markup .= str_repeat(' ', $ident + 1) . "<varlistentry>" . PHP_EOL;
$markup .= str_repeat(' ', $ident + 2) . '<term><parameter>' . ($param->getName() ? $param->getName() : 'param' . $count) . "</parameter></term>" . PHP_EOL;
$markup .= str_repeat(' ', $ident + 2) . "<listitem>" . PHP_EOL;
$markup .= str_repeat(' ', $ident + 3) . "<para>" . PHP_EOL;
$markup .= str_repeat(' ', $ident + 4) . PHP_EOL;
$markup .= str_repeat(' ', $ident + 3) . "</para>" . PHP_EOL;
$markup .= str_repeat(' ', $ident + 2) . "</listitem>" . PHP_EOL;
$markup .= str_repeat(' ', $ident + 1) . "</varlistentry>" . PHP_EOL;
$count++;
}
$markup .= str_repeat(' ', $ident) . "</variablelist>";
$content = preg_replace('/\\{PARAMETERS_DESCRIPTION\\}/', $markup, $content, 1);
}
} else {
$content = preg_replace('/\\{' . $param_name . '\\}/', '<void />', $content, 1);
$content = preg_replace('/\\{PARAMETERS_DESCRIPTION\\}/', '&no.function.parameters;', $content, 1);
}
return $content;
}