[关闭]
@Chiang 2020-01-14T05:12:09.000000Z 字数 4486 阅读 943

ReflectionClass 类

PHP-反射


简介

ReflectionClass 类报告了一个类的有关信息。

类摘要

  1. ReflectionClass implements Reflector {
  2. /* 常量 */
  3. const integer IS_IMPLICIT_ABSTRACT = 16 ;
  4. const integer IS_EXPLICIT_ABSTRACT = 32 ;
  5. const integer IS_FINAL = 64 ;
  6. /* 属性 */
  7. public $name ;
  8. /* 方法 */
  9. public __construct ( mixed $argument )
  10. public static export ( mixed $argument [, bool $return = false ] ) : string
  11. public getConstant ( string $name ) : mixed
  12. public getConstants ( void ) : array
  13. public getConstructor ( void ) : ReflectionMethod
  14. public getDefaultProperties ( void ) : array
  15. public getDocComment ( void ) : string
  16. public getEndLine ( void ) : int
  17. public getExtension ( void ) : ReflectionExtension
  18. public getExtensionName ( void ) : string
  19. public getFileName ( void ) : string
  20. public getInterfaceNames ( void ) : array
  21. public getInterfaces ( void ) : array
  22. public getMethod ( string $name ) : ReflectionMethod
  23. public getMethods ([ int $filter ] ) : array
  24. public getModifiers ( void ) : int
  25. public getName ( void ) : string
  26. public getNamespaceName ( void ) : string
  27. public getParentClass ( void ) : ReflectionClass
  28. public getProperties ([ int $filter ] ) : array
  29. public getProperty ( string $name ) : ReflectionProperty
  30. public getReflectionConstant ( string $name ) : ReflectionClassConstant
  31. public getReflectionConstants ( void ) : array
  32. public getShortName ( void ) : string
  33. public getStartLine ( void ) : int
  34. public getStaticProperties ( void ) : array
  35. public getStaticPropertyValue ( string $name [, mixed &$def_value ] ) : mixed
  36. public getTraitAliases ( void ) : array
  37. public getTraitNames ( void ) : array
  38. public getTraits ( void ) : array
  39. public hasConstant ( string $name ) : bool
  40. public hasMethod ( string $name ) : bool
  41. public hasProperty ( string $name ) : bool
  42. public implementsInterface ( string $interface ) : bool
  43. public inNamespace ( void ) : bool
  44. public isAbstract ( void ) : bool
  45. public isAnonymous ( void ) : bool
  46. public isCloneable ( void ) : bool
  47. public isFinal ( void ) : bool
  48. public isInstance ( object $object ) : bool
  49. public isInstantiable ( void ) : bool
  50. public isInterface ( void ) : bool
  51. public isInternal ( void ) : bool
  52. public isIterable ( void ) : bool
  53. public isIterateable ( void ) : bool
  54. public isSubclassOf ( string $class ) : bool
  55. public isTrait ( void ) : bool
  56. public isUserDefined ( void ) : bool
  57. public newInstance ( mixed $args [, mixed $... ] ) : object
  58. public newInstanceArgs ([ array $args ] ) : object
  59. public newInstanceWithoutConstructor ( void ) : object
  60. public setStaticPropertyValue ( string $name , string $value ) : void
  61. public __toString ( void ) : string
  62. }
  1. ReflectionClass::__construct — 初始化 ReflectionClass 类
  2. ReflectionClass::export — 导出一个类
  3. ReflectionClass::getConstant — 获取定义过的一个常量
  4. ReflectionClass::getConstants — 获取一组常量
  5. ReflectionClass::getConstructor — 获取类的构造函数
  6. ReflectionClass::getDefaultProperties — 获取默认属性
  7. ReflectionClass::getDocComment — 获取文档注释
  8. ReflectionClass::getEndLine — 获取最后一行的行数
  9. ReflectionClass::getExtension — 根据已定义的类获取所在扩展的 ReflectionExtension 对象
  10. ReflectionClass::getExtensionName — 获取定义的类所在的扩展的名称
  11. ReflectionClass::getFileName — 获取定义类的文件名
  12. ReflectionClass::getInterfaceNames — 获取接口(interface)名称
  13. ReflectionClass::getInterfaces — 获取接口
  14. ReflectionClass::getMethod — 获取一个类方法的 ReflectionMethod。
  15. ReflectionClass::getMethods — 获取方法的数组
  16. ReflectionClass::getModifiers — 获取类的修饰符
  17. ReflectionClass::getName — 获取类名
  18. ReflectionClass::getNamespaceName — 获取命名空间的名称
  19. ReflectionClass::getParentClass — 获取父类
  20. ReflectionClass::getProperties — 获取一组属性
  21. ReflectionClass::getProperty — 获取类的一个属性的 ReflectionProperty
  22. ReflectionClass::getReflectionConstant — Gets a ReflectionClassConstant for a `class's` constant
  23. ReflectionClass::getReflectionConstants — Gets class constants
  24. ReflectionClass::getShortName — 获取短名
  25. ReflectionClass::getStartLine — 获取起始行号
  26. ReflectionClass::getStaticProperties — 获取静态(static)属性
  27. ReflectionClass::getStaticPropertyValue — 获取静态(static)属性的值
  28. ReflectionClass::getTraitAliases — 返回 trait 别名的一个数组
  29. ReflectionClass::getTraitNames — 返回这个类所使用 traits 的名称的数组
  30. ReflectionClass::getTraits — 返回这个类所使用的 traits 数组
  31. ReflectionClass::hasConstant — 检查常量是否已经定义
  32. ReflectionClass::hasMethod — 检查方法是否已定义
  33. ReflectionClass::hasProperty — 检查属性是否已定义
  34. ReflectionClass::implementsInterface — 接口的实现
  35. ReflectionClass::inNamespace — 检查是否位于命名空间中
  36. ReflectionClass::isAbstract — 检查类是否是抽象类(abstract)
  37. ReflectionClass::isAnonymous — 检查类是否是匿名类
  38. ReflectionClass::isCloneable — 返回了一个类是否可复制
  39. ReflectionClass::isFinal — 检查类是否声明为 final
  40. ReflectionClass::isInstance — 检查类的实例
  41. ReflectionClass::isInstantiable — 检查类是否可实例化
  42. ReflectionClass::isInterface — 检查类是否是一个接口(interface)
  43. ReflectionClass::isInternal — 检查类是否由扩展或核心在内部定义
  44. ReflectionClass::isIterable — Check whether this class is iterable
  45. ReflectionClass::isIterateable — 检查是否可迭代(iterateable)
  46. ReflectionClass::isSubclassOf — 检查是否为一个子类
  47. ReflectionClass::isTrait — 返回了是否为一个 trait
  48. ReflectionClass::isUserDefined — 检查是否由用户定义的
  49. ReflectionClass::newInstance — 从指定的参数创建一个新的类实例
  50. ReflectionClass::newInstanceArgs — 从给出的参数创建一个新的类实例。
  51. ReflectionClass::newInstanceWithoutConstructor — 创建一个新的类实例而不调用它的构造函数
  52. ReflectionClass::setStaticPropertyValue — 设置静态属性的值
  53. ReflectionClass::__toString — 返回 ReflectionClass 对象字符串的表示形式。
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注