1: <?php
  2: 
  3:   4:   5:   6:   7:   8:   9:  10: 
 11: 
 12: namespace Nette\Reflection;
 13: 
 14: use Nette,
 15:     Nette\ObjectMixin,
 16:     Nette\Annotations;
 17: 
 18: 
 19: 
 20:  21:  22:  23:  24: 
 25: class ExtensionReflection extends \ReflectionExtension
 26: {
 27: 
 28:     public function __toString()
 29:     {
 30:         return 'Extension ' . $this->getName();
 31:     }
 32: 
 33: 
 34: 
 35:     
 36: 
 37: 
 38: 
 39:     public function getClasses()
 40:     {
 41:         $res = array();
 42:         foreach (parent::getClassNames() as $val) {
 43:             $res[$val] = new ClassReflection($val);
 44:         }
 45:         return $res;
 46:     }
 47: 
 48: 
 49: 
 50:     public function getFunctions()
 51:     {
 52:         foreach ($res = parent::getFunctions() as $key => $val) {
 53:             $res[$key] = new FunctionReflection($key);
 54:         }
 55:         return $res;
 56:     }
 57: 
 58: 
 59: 
 60:     
 61: 
 62: 
 63: 
 64:      65:  66: 
 67:     public static function getReflection()
 68:     {
 69:         return new Nette\Reflection\ClassReflection(get_called_class());
 70:     }
 71: 
 72: 
 73: 
 74:     public function __call($name, $args)
 75:     {
 76:         return ObjectMixin::call($this, $name, $args);
 77:     }
 78: 
 79: 
 80: 
 81:     public function &__get($name)
 82:     {
 83:         return ObjectMixin::get($this, $name);
 84:     }
 85: 
 86: 
 87: 
 88:     public function __set($name, $value)
 89:     {
 90:         return ObjectMixin::set($this, $name, $value);
 91:     }
 92: 
 93: 
 94: 
 95:     public function __isset($name)
 96:     {
 97:         return ObjectMixin::has($this, $name);
 98:     }
 99: 
100: 
101: 
102:     public function __unset($name)
103:     {
104:         throw new \MemberAccessException("Cannot unset the property {$this->reflection->name}::\$$name.");
105:     }
106: 
107: }
108: