Zhamao Framework 3.2.4
A high-performance chatbot + web framework
载入中...
搜索中...
未找到
ReflectionUtil类 参考

静态 Public 成员函数

static getParameterClassName (\ReflectionParameter $parameter)
 
static variableToString (mixed $var)
 
static isNonStaticMethod (callable|array|string $callback)
 
static getCallReflector (callable|string $callback)
 
static getMethod (string $class, string $method)
 

成员函数说明

◆ getCallReflector()

static getCallReflector ( callable|string  $callback)
static

获取传入的回调的反射实例

如果传入的是类方法,则会返回 ReflectionMethod 实例 否则将返回 ReflectionFunction 实例

可传入实现了 __invoke 的类

参数
callable | string$callback回调
异常

ReflectionException

◆ getMethod()

static getMethod ( string  $class,
string  $method 
)
static

获取传入的类方法,并确保其可访问

请不要滥用此方法!!!

参数
string$class类名
string$method方法名
异常

ReflectionException

◆ getParameterClassName()

static getParameterClassName ( \ReflectionParameter  $parameter)
static

获取参数的类名(如有)

参数
\ReflectionParameter$parameter参数
返回
null|string 类名,如果参数不是类,返回 null

◆ isNonStaticMethod()

static isNonStaticMethod ( callable|array|string  $callback)
static

判断传入的回调是否为任意类的非静态方法

参数
callable | string$callback回调
异常

ReflectionException

◆ variableToString()

static variableToString ( mixed  $var)
static

将传入变量转换为字符串


该类的文档由以下文件生成: