本文整理匯總了PHP中ReflectionMethod::getExtensionName方法的典型用法代碼示例。如果您正苦於以下問題:PHP ReflectionMethod::getExtensionName方法的具體用法?PHP ReflectionMethod::getExtensionName怎麽用?PHP ReflectionMethod::getExtensionName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ReflectionMethod
的用法示例。
在下文中一共展示了ReflectionMethod::getExtensionName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getExtensionName
/**
* Returns false or the name of the extension the method belongs to
*
* @return string|boolean False or the name of the extension
*/
public function getExtensionName()
{
if ($this->reflectionSource instanceof ReflectionMethod) {
return $this->reflectionSource->getExtensionName();
} else {
return parent::getExtensionName();
}
}
示例2: array
* will help Emacs organize the snippets into sub-menus, making it
* easier for the user to navigate once he starts creating a large
* number of snippets with this program. PHP groups many functions
* into 'extensions', so we use the extension name for the group name.
* Thus a function like json_encode() will get the directive '#group:
* json'. If $function actually represents a method then we also try
* to add the name of the class to the group, creating a sub-group
* using that class name.
*
* However, not all functions and methods belong to an extension. For
* methods we still use the class name for the group in the absence of
* an extension name. But for functions we omit the '#group'
* directive if there is no extension name.
*/
$group_name_pieces = array();
if ($function->getExtensionName()) {
$group_name_pieces[] = $function->getExtensionName();
}
if ($function instanceof ReflectionMethod) {
$class_name = $function->getDeclaringClass()->getName();
/* If the class name belongs to a namespace then we create
* further sub-groups to reflect that.
*/
str_replace("\\", ".", $class_name);
$group_name_pieces[] = $class_name;
}
if (count($group_name_pieces) > 0) {
$snippet_directives[] = sprintf("#group: %s", implode(".", $group_name_pieces));
}
/* We assume the name of the function is already in the buffer and
* that Emacs will append any output to that. So we create an array