本文整理汇总了PHP中Docs::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Docs::debug方法的具体用法?PHP Docs::debug怎么用?PHP Docs::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Docs
的用法示例。
在下文中一共展示了Docs::debug方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Loads a class and uses [reflection](http://php.net/reflection) to parse
* the class. Reads the class modifiers, constants and comment. Parses the
* comment to find the description and tags.
*
* @param string class name
* @return void
*/
public function __construct($class)
{
$this->class = new ReflectionClass($class);
if ($modifiers = $this->class->getModifiers()) {
$this->modifiers = '<small>' . implode(' ', Reflection::getModifierNames($modifiers)) . '</small> ';
}
if ($constants = $this->class->getConstants()) {
foreach ($constants as $name => $value) {
$this->constants[$name] = Docs::debug($value);
}
}
$parent = $this->class;
do {
if ($comment = $parent->getDocComment()) {
// Found a description for this class
break;
}
} while ($parent = $parent->getParentClass());
list($this->description, $this->tags) = Docs::parse($comment);
}
示例2: __construct
public function __construct($class, $property)
{
$property = new ReflectionProperty($class, $property);
list($description, $tags) = Docs::parse($property->getDocComment());
$this->description = $description;
if ($modifiers = $property->getModifiers()) {
$this->modifiers = '<small>' . implode(' ', Reflection::getModifierNames($modifiers)) . '</small> ';
}
if (isset($tags['var'])) {
if (preg_match('/^(\\S*)(?:\\s*(.+?))?$/', $tags['var'][0], $matches)) {
$this->type = $matches[1];
if (isset($matches[2])) {
$this->description = $matches[2];
}
}
}
$this->property = $property;
if ($property->isStatic()) {
$this->value = Docs::debug($property->getValue($class));
}
}