Packages

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

Classes

  • NAnnotation
  • NAnnotationsParser
  • NClassReflection
  • NExtensionReflection
  • NFunctionReflection
  • NMethodReflection
  • NParameterReflection
  • NPropertyReflection

Interfaces

  • IAnnotation
  • Overview
  • Package
  • 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:  * @package Nette\Reflection
 11:  */
 12: 
 13: 
 14: 
 15: /**
 16:  * Reports information about a method's parameter.
 17:  *
 18:  * @author     David Grudl
 19:  * @package Nette\Reflection
 20:  */
 21: class NParameterReflection extends ReflectionParameter
 22: {
 23:     /** @var mixed */
 24:     private $function;
 25: 
 26: 
 27:     public function __construct($function, $parameter)
 28:     {
 29:         parent::__construct($this->function = $function, $parameter);
 30:     }
 31: 
 32: 
 33: 
 34:     /**
 35:      * @return NClassReflection
 36:      */
 37:     public function getClass()
 38:     {
 39:         return ($ref = parent::getClass()) ? new NClassReflection($ref->getName()) : NULL;
 40:     }
 41: 
 42: 
 43: 
 44:     /**
 45:      * @return NClassReflection
 46:      */
 47:     public function getDeclaringClass()
 48:     {
 49:         return ($ref = parent::getDeclaringClass()) ? new NClassReflection($ref->getName()) : NULL;
 50:     }
 51: 
 52: 
 53: 
 54:     /**
 55:      * @return NMethodReflection | NFunctionReflection
 56:      */
 57:     public function getDeclaringFunction()
 58:     {
 59:         return is_array($this->function) ? new NMethodReflection($this->function[0], $this->function[1]) : new NFunctionReflection($this->function);
 60:     }
 61: 
 62: 
 63: 
 64:     /********************* NObject behaviour ****************d*g**/
 65: 
 66: 
 67: 
 68:     /**
 69:      * @return NClassReflection
 70:      */
 71:     public function getReflection()
 72:     {
 73:         return new NClassReflection($this);
 74:     }
 75: 
 76: 
 77: 
 78:     public function __call($name, $args)
 79:     {
 80:         return NObjectMixin::call($this, $name, $args);
 81:     }
 82: 
 83: 
 84: 
 85:     public function &__get($name)
 86:     {
 87:         return NObjectMixin::get($this, $name);
 88:     }
 89: 
 90: 
 91: 
 92:     public function __set($name, $value)
 93:     {
 94:         return NObjectMixin::set($this, $name, $value);
 95:     }
 96: 
 97: 
 98: 
 99:     public function __isset($name)
100:     {
101:         return NObjectMixin::has($this, $name);
102:     }
103: 
104: 
105: 
106:     public function __unset($name)
107:     {
108:         throw new MemberAccessException("Cannot unset the property {$this->reflection->name}::\$$name.");
109:     }
110: 
111: }
112: 
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0