ReflectionClass.hx 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. package php.reflection;
  23. import haxe.extern.Rest;
  24. @:native('ReflectionClass')
  25. extern class ReflectionClass implements Reflector {
  26. @:phpClassConst static final IS_IMPLICIT_ABSTRACT:Int;
  27. @:phpClassConst static final IS_EXPLICIT_ABSTRACT:Int;
  28. @:phpClassConst static final IS_FINAL:Int;
  29. static function export(argument:Dynamic, returnValue:Bool = false):String;
  30. var name:String;
  31. function new(argument:Dynamic):Void;
  32. function getConstant(name:String):Dynamic;
  33. function getConstants():NativeAssocArray<Dynamic>;
  34. function getConstructor():ReflectionMethod;
  35. function getDefaultProperties():NativeAssocArray<Dynamic>;
  36. function getDocComment():String;
  37. function getEndLine():Int;
  38. // function getExtension() : ReflectionExtension;
  39. function getExtensionName():String;
  40. function getFileName():String;
  41. function getInterfaceNames():NativeIndexedArray<String>;
  42. function getInterfaces():NativeIndexedArray<ReflectionClass>;
  43. function getMethod(name:String):ReflectionMethod;
  44. function getMethods(?filter:Int):NativeIndexedArray<ReflectionMethod>;
  45. function getModifiers():Int;
  46. function getName():String;
  47. function getNamespaceName():String;
  48. function getParentClass():Null<ReflectionClass>;
  49. function getProperties(?filter:Int):NativeIndexedArray<ReflectionProperty>;
  50. function getProperty(name:String):ReflectionProperty;
  51. function getShortName():String;
  52. function getStartLine():Int;
  53. function getStaticProperties():NativeAssocArray<Dynamic>;
  54. function getStaticPropertyValue(name:String, ?def_value:Ref<Dynamic>):Dynamic;
  55. function getTraitAliases():NativeAssocArray<String>;
  56. function getTraitNames():NativeIndexedArray<String>;
  57. function getTraits():NativeIndexedArray<ReflectionClass>;
  58. function hasConstant(name:String):Bool;
  59. function hasMethod(name:String):Bool;
  60. function hasProperty(name:String):Bool;
  61. function implementsInterface(interfaceName:String):Bool;
  62. function inNamespace():Bool;
  63. function isAbstract():Bool;
  64. function isAnonymous():Bool;
  65. function isCloneable():Bool;
  66. function isFinal():Bool;
  67. function isInstance(object:{}):Bool;
  68. function isInstantiable():Bool;
  69. function isInterface():Bool;
  70. function isInternal():Bool;
  71. function isIterateable():Bool;
  72. function isSubclassOf(className:String):Bool;
  73. function isTrait():Bool;
  74. function isUserDefined():Bool;
  75. function newInstance(args:Rest<Dynamic>):Dynamic;
  76. function newInstanceArgs(?args:NativeIndexedArray<Dynamic>):Dynamic;
  77. function newInstanceWithoutConstructor():Dynamic;
  78. function setStaticPropertyValue(name:String, value:String):Void;
  79. @:phpMagic function __toString():String;
  80. }