Namespaces

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

Classes

  • Annotation
  • AnnotationsParser
  • ClassType
  • Extension
  • GlobalFunction
  • Method
  • Parameter
  • Property

Interfaces

  • IAnnotation
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: 
  3: /**
  4:  * This file is part of the Nette Framework (http://nette.org)
  5:  *
  6:  * Copyright (c) 2004, 2011 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: 
 17: 
 18: 
 19: /**
 20:  * Reports information about a method's parameter.
 21:  *
 22:  * @author     David Grudl
 23:  */
 24: class Parameter extends \ReflectionParameter
 25: {
 26:     /** @var mixed */
 27:     private $function;
 28: 
 29: 
 30:     public function __construct($function, $parameter)
 31:     {
 32:         parent::__construct($this->function = $function, $parameter);
 33:     }
 34: 
 35: 
 36: 
 37:     /**
 38:      * @return ClassType
 39:      */
 40:     public function getClass()
 41:     {
 42:         return ($ref = parent::getClass()) ? new ClassType($ref->getName()) : NULL;
 43:     }
 44: 
 45: 
 46: 
 47:     /**
 48:      * @return string
 49:      */
 50:     public function getClassName()
 51:     {
 52:         return ($tmp = Nette\Utils\Strings::match($this, '#>\s+([a-z0-9_\\\\]+)#i')) ? $tmp[1] : NULL;
 53:     }
 54: 
 55: 
 56: 
 57:     /**
 58:      * @return ClassType
 59:      */
 60:     public function getDeclaringClass()
 61:     {
 62:         return ($ref = parent::getDeclaringClass()) ? new ClassType($ref->getName()) : NULL;
 63:     }
 64: 
 65: 
 66: 
 67:     /**
 68:      * @return Method | FunctionReflection
 69:      */
 70:     public function getDeclaringFunction()
 71:     {
 72:         return is_array($this->function)
 73:             ? new Method($this->function[0], $this->function[1])
 74:             : new GlobalFunction($this->function);
 75:     }
 76: 
 77: 
 78: 
 79:     /********************* Nette\Object behaviour ****************d*g**/
 80: 
 81: 
 82: 
 83:     /**
 84:      * @return ClassType
 85:      */
 86:     public static function getReflection()
 87:     {
 88:         return new ClassType(get_called_class());
 89:     }
 90: 
 91: 
 92: 
 93:     public function __call($name, $args)
 94:     {
 95:         return ObjectMixin::call($this, $name, $args);
 96:     }
 97: 
 98: 
 99: 
100:     public function &__get($name)
101:     {
102:         return ObjectMixin::get($this, $name);
103:     }
104: 
105: 
106: 
107:     public function __set($name, $value)
108:     {
109:         return ObjectMixin::set($this, $name, $value);
110:     }
111: 
112: 
113: 
114:     public function __isset($name)
115:     {
116:         return ObjectMixin::has($this, $name);
117:     }
118: 
119: 
120: 
121:     public function __unset($name)
122:     {
123:         ObjectMixin::remove($this, $name);
124:     }
125: 
126: }
127: 
Nette Framework 2.0beta1 API API documentation generated by ApiGen 2.3.0