本文整理汇总了PHP中Reflector::getMethods方法的典型用法代码示例。如果您正苦于以下问题:PHP Reflector::getMethods方法的具体用法?PHP Reflector::getMethods怎么用?PHP Reflector::getMethods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reflector
的用法示例。
在下文中一共展示了Reflector::getMethods方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMethods
/**
* Get defined methods for the given class or object Reflector.
*
* @param boolean $showAll Include private and protected methods.
* @param \Reflector $reflector
*
* @return array
*/
protected function getMethods($showAll, \Reflector $reflector)
{
$methods = array();
foreach ($reflector->getMethods() as $name => $method) {
if ($showAll || $method->isPublic()) {
$methods[$method->getName()] = $method;
}
}
// TODO: this should be natcasesort
ksort($methods);
return $methods;
}
示例2: getMethods
/**
* Get defined methods for the given class or object Reflector.
*
* @param bool $showAll Include private and protected methods.
* @param \Reflector $reflector
*
* @return array
*/
protected function getMethods($showAll, \Reflector $reflector)
{
$methods = array();
foreach ($reflector->getMethods() as $name => $method) {
if ($showAll || $method->isPublic()) {
$methods[$method->getName()] = $method;
}
}
// Removed task from comment. SPV
ksort($methods);
return $methods;
}