Source for file FunctionReflection.php

Documentation is available at FunctionReflection.php

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework
  5. 5:  *
  6. 6:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  7. 7:  * @license    http://nettephp.com/license  Nette license
  8. 8:  * @link       http://nettephp.com
  9. 9:  * @category   Nette
  10. 10:  * @package    Nette\Reflection
  11. 11:  */
  12. 12:  
  13. 13:  
  14. 14:  
  15. 15: /**
  16. 16:  * Reports information about a function.
  17. 17:  *
  18. 18:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  19. 19:  * @package    Nette\Reflection
  20. 20:  */
  21. 21: class FunctionReflection extends ReflectionFunction
  22. 22: {
  23. 23:  
  24. 24:     public function __toString()
  25. 25:     {
  26. 26:         return 'Function ' $this->getName('()';
  27. 27:     }
  28. 28:  
  29. 29:  
  30. 30:  
  31. 31:     /********************* Reflection layer ****************d*g**/
  32. 32:  
  33. 33:  
  34. 34:  
  35. 35:     /**
  36. 36:      * @return FunctionReflection 
  37. 37:      * @ignore internal
  38. 38:      */
  39. 39:     public static function import(ReflectionFunction $ref)
  40. 40:     {
  41. 41:         return new self($ref->getName());
  42. 42:     }
  43. 43:  
  44. 44:  
  45. 45:  
  46. 46:     /**
  47. 47:      * @return ExtensionReflection 
  48. 48:      */
  49. 49:     public function getExtension()
  50. 50:     {
  51. 51:         return ($ref parent::getExtension()) ExtensionReflection::import($refNULL;
  52. 52:     }
  53. 53:  
  54. 54:  
  55. 55:  
  56. 56:     public function getParameters()
  57. 57:     {
  58. 58:         return array_map(array('MethodParameterReflection''import')parent::getParameters());
  59. 59:     }
  60. 60:  
  61. 61:  
  62. 62:  
  63. 63:     /********************* Nette\Object behaviour ****************d*g**/
  64. 64:  
  65. 65:  
  66. 66:  
  67. 67:     /**
  68. 68:      * @return ClassReflection 
  69. 69:      */
  70. 70:     public function getReflection()
  71. 71:     {
  72. 72:         return new ClassReflection($this);
  73. 73:     }
  74. 74:  
  75. 75:  
  76. 76:  
  77. 77:     public function __call($name$args)
  78. 78:     {
  79. 79:         return ObjectMixin::call($this$name$args);
  80. 80:     }
  81. 81:  
  82. 82:  
  83. 83:  
  84. 84:     public function &__get($name)
  85. 85:     {
  86. 86:         return ObjectMixin::get($this$name);
  87. 87:     }
  88. 88:  
  89. 89:  
  90. 90:  
  91. 91:     public function __set($name$value)
  92. 92:     {
  93. 93:         return ObjectMixin::set($this$name$value);
  94. 94:     }
  95. 95:  
  96. 96:  
  97. 97:  
  98. 98:     public function __isset($name)
  99. 99:     {
  100. 100:         return ObjectMixin::has($this$name);
  101. 101:     }
  102. 102:  
  103. 103:  
  104. 104:  
  105. 105:     public function __unset($name)
  106. 106:     {
  107. 107:         throw new MemberAccessException("Cannot unset the property {$this->reflection->name}::\$$name.");
  108. 108:     }
  109. 109: