Source for file ExtensionReflection.php

Documentation is available at ExtensionReflection.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 extension.
  17. 17:  *
  18. 18:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  19. 19:  * @package    Nette\Reflection
  20. 20:  */
  21. 21: class ExtensionReflection extends ReflectionExtension
  22. 22: {
  23. 23:  
  24. 24:     public function __toString()
  25. 25:     {
  26. 26:         return 'Extension ' $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 ExtensionReflection 
  37. 37:      * @ignore internal
  38. 38:      */
  39. 39:     public static function import(ReflectionExtension $ref)
  40. 40:     {
  41. 41:         return new self($ref->getName());
  42. 42:     }
  43. 43:  
  44. 44:  
  45. 45:  
  46. 46:     public function getClasses()
  47. 47:     {
  48. 48:         return array_map(array('ClassReflection''import')parent::getClasses());
  49. 49:     }
  50. 50:  
  51. 51:  
  52. 52:  
  53. 53:     public function getFunctions()
  54. 54:     {
  55. 55:         return array_map(array('FunctionReflection''import')parent::getFunctions());
  56. 56:     }
  57. 57:  
  58. 58:  
  59. 59:  
  60. 60:     /********************* Nette\Object behaviour ****************d*g**/
  61. 61:  
  62. 62:  
  63. 63:  
  64. 64:     /**
  65. 65:      * @return ClassReflection 
  66. 66:      */
  67. 67:     public function getReflection()
  68. 68:     {
  69. 69:         return new ClassReflection($this);
  70. 70:     }
  71. 71:  
  72. 72:  
  73. 73:  
  74. 74:     public function __call($name$args)
  75. 75:     {
  76. 76:         return ObjectMixin::call($this$name$args);
  77. 77:     }
  78. 78:  
  79. 79:  
  80. 80:  
  81. 81:     public function &__get($name)
  82. 82:     {
  83. 83:         return ObjectMixin::get($this$name);
  84. 84:     }
  85. 85:  
  86. 86:  
  87. 87:  
  88. 88:     public function __set($name$value)
  89. 89:     {
  90. 90:         return ObjectMixin::set($this$name$value);
  91. 91:     }
  92. 92:  
  93. 93:  
  94. 94:  
  95. 95:     public function __isset($name)
  96. 96:     {
  97. 97:         return ObjectMixin::has($this$name);
  98. 98:     }
  99. 99:  
  100. 100:  
  101. 101:  
  102. 102:     public function __unset($name)
  103. 103:     {
  104. 104:         throw new MemberAccessException("Cannot unset the property {$this->reflection->name}::\$$name.");
  105. 105:     }
  106. 106: