Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • None
  • PHP

Classes

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

Interfaces

  • IAnnotation
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: 
  3: /**
  4:  * This file is part of the Nette Framework (http://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:  * @property-read NClassReflection $class
 20:  * @property-read string $className
 21:  * @property-read NClassReflection $declaringClass
 22:  * @property-read NMethodReflection $declaringFunction
 23:  * @property-read string $name
 24:  * @property-read bool $passedByReference
 25:  * @property-read bool $array
 26:  * @property-read int $position
 27:  * @property-read bool $optional
 28:  * @property-read bool $defaultValueAvailable
 29:  * @property-read mixed $defaultValue
 30:  * @package Nette\Reflection
 31:  */
 32: class NParameterReflection extends ReflectionParameter
 33: {
 34:     /** @var mixed */
 35:     private $function;
 36: 
 37: 
 38:     public function __construct($function, $parameter)
 39:     {
 40:         parent::__construct($this->function = $function, $parameter);
 41:     }
 42: 
 43: 
 44: 
 45:     /**
 46:      * @return NClassReflection
 47:      */
 48:     public function getClass()
 49:     {
 50:         return ($ref = parent::getClass()) ? new NClassReflection($ref->getName()) : NULL;
 51:     }
 52: 
 53: 
 54: 
 55:     /**
 56:      * @return string
 57:      */
 58:     public function getClassName()
 59:     {
 60:         return ($tmp = NStrings::match($this, '#>\s+([a-z0-9_\\\\]+)#i')) ? $tmp[1] : NULL;
 61:     }
 62: 
 63: 
 64: 
 65:     /**
 66:      * @return NClassReflection
 67:      */
 68:     public function getDeclaringClass()
 69:     {
 70:         return ($ref = parent::getDeclaringClass()) ? new NClassReflection($ref->getName()) : NULL;
 71:     }
 72: 
 73: 
 74: 
 75:     /**
 76:      * @return NMethodReflection | FunctionReflection
 77:      */
 78:     public function getDeclaringFunction()
 79:     {
 80:         return is_array($this->function)
 81:             ? new NMethodReflection($this->function[0], $this->function[1])
 82:             : new NFunctionReflection($this->function);
 83:     }
 84: 
 85: 
 86: 
 87:     public function __toString()
 88:     {
 89:         return 'Parameter $' . parent::getName() . ' in ' . $this->getDeclaringFunction();
 90:     }
 91: 
 92: 
 93: 
 94:     /********************* NObject behaviour ****************d*g**/
 95: 
 96: 
 97: 
 98:     /**
 99:      * @return NClassReflection
100:      */
101:     public function getReflection()
102:     {
103:         return new NClassReflection($this);
104:     }
105: 
106: 
107: 
108:     public function __call($name, $args)
109:     {
110:         return NObjectMixin::call($this, $name, $args);
111:     }
112: 
113: 
114: 
115:     public function &__get($name)
116:     {
117:         return NObjectMixin::get($this, $name);
118:     }
119: 
120: 
121: 
122:     public function __set($name, $value)
123:     {
124:         return NObjectMixin::set($this, $name, $value);
125:     }
126: 
127: 
128: 
129:     public function __isset($name)
130:     {
131:         return NObjectMixin::has($this, $name);
132:     }
133: 
134: 
135: 
136:     public function __unset($name)
137:     {
138:         NObjectMixin::remove($this, $name);
139:     }
140: 
141: }
142: 
Nette Framework 2.0.0 (for PHP 5.2, prefixed) API API documentation generated by ApiGen 2.7.0