Namespaces

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • Annotation
  • AnnotationsParser
  • ClassReflection
  • ExtensionReflection
  • FunctionReflection
  • MethodReflection
  • ParameterReflection
  • PropertyReflection

Interfaces

  • IAnnotation
  • Overview
  • Namespace
  • Class
  • Tree
  • Other releases
  1: <?php
  2: 
  3: /**
  4:  * This file is part of the Nette Framework (https://nette.org)
  5:  *
  6:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
  7:  *
  8:  * For the full copyright and license information, please view
  9:  * the file license.txt that was distributed with this source code.
 10:  */
 11: 
 12: namespace Nette\Reflection;
 13: 
 14: use Nette,
 15:     Nette\ObjectMixin,
 16:     Nette\Annotations;
 17: 
 18: 
 19: 
 20: /**
 21:  * Reports information about a method's parameter.
 22:  *
 23:  * @author     David Grudl
 24:  */
 25: class ParameterReflection extends \ReflectionParameter
 26: {
 27:     /** @var mixed */
 28:     private $function;
 29: 
 30: 
 31:     public function __construct($function, $parameter)
 32:     {
 33:         parent::__construct($this->function = $function, $parameter);
 34:     }
 35: 
 36: 
 37: 
 38:     /**
 39:      * @return Nette\Reflection\ClassReflection
 40:      */
 41:     public function getClass()
 42:     {
 43:         return ($ref = parent::getClass()) ? new ClassReflection($ref->getName()) : NULL;
 44:     }
 45: 
 46: 
 47: 
 48:     /**
 49:      * @return Nette\Reflection\ClassReflection
 50:      */
 51:     public function getDeclaringClass()
 52:     {
 53:         return ($ref = parent::getDeclaringClass()) ? new ClassReflection($ref->getName()) : NULL;
 54:     }
 55: 
 56: 
 57: 
 58:     /**
 59:      * @return Nette\Reflection\MethodReflection | Nette\Reflection\FunctionReflection
 60:      */
 61:     public function getDeclaringFunction()
 62:     {
 63:         return is_array($this->function) ? new MethodReflection($this->function[0], $this->function[1]) : new FunctionReflection($this->function);
 64:     }
 65: 
 66: 
 67: 
 68:     /********************* Nette\Object behaviour ****************d*g**/
 69: 
 70: 
 71: 
 72:     /**
 73:      * @return Nette\Reflection\ClassReflection
 74:      */
 75:     public static function getReflection()
 76:     {
 77:         return new Nette\Reflection\ClassReflection(get_called_class());
 78:     }
 79: 
 80: 
 81: 
 82:     public function __call($name, $args)
 83:     {
 84:         return ObjectMixin::call($this, $name, $args);
 85:     }
 86: 
 87: 
 88: 
 89:     public function &__get($name)
 90:     {
 91:         return ObjectMixin::get($this, $name);
 92:     }
 93: 
 94: 
 95: 
 96:     public function __set($name, $value)
 97:     {
 98:         return ObjectMixin::set($this, $name, $value);
 99:     }
100: 
101: 
102: 
103:     public function __isset($name)
104:     {
105:         return ObjectMixin::has($this, $name);
106:     }
107: 
108: 
109: 
110:     public function __unset($name)
111:     {
112:         throw new \MemberAccessException("Cannot unset the property {$this->reflection->name}::\$$name.");
113:     }
114: 
115: }
116: 
Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0