Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Server / Reflection / ReflectionMethod.php
blob31e09a3a753c3ebfecc4a20ca8d6f75adcc2a635
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Server\Reflection;
12 /**
13 * Method Reflection
15 class ReflectionMethod extends AbstractFunction
17 /**
18 * Parent class name
19 * @var string
21 protected $class;
23 /**
24 * Parent class reflection
25 * @var ReflectionClass
27 protected $classReflection;
29 /**
30 * Constructor
32 * @param ReflectionClass $class
33 * @param \ReflectionMethod $r
34 * @param string $namespace
35 * @param array $argv
37 public function __construct(ReflectionClass $class, \ReflectionMethod $r, $namespace = null, $argv = array())
39 $this->classReflection = $class;
40 $this->reflection = $r;
42 $classNamespace = $class->getNamespace();
44 // Determine namespace
45 if (!empty($namespace)) {
46 $this->setNamespace($namespace);
47 } elseif (!empty($classNamespace)) {
48 $this->setNamespace($classNamespace);
51 // Determine arguments
52 if (is_array($argv)) {
53 $this->argv = $argv;
56 // If method call, need to store some info on the class
57 $this->class = $class->getName();
59 // Perform some introspection
60 $this->reflect();
63 /**
64 * Return the reflection for the class that defines this method
66 * @return \Zend\Server\Reflection\ReflectionClass
68 public function getDeclaringClass()
70 return $this->classReflection;
73 /**
74 * Wakeup from serialization
76 * Reflection needs explicit instantiation to work correctly. Re-instantiate
77 * reflection object on wakeup.
79 * @return void
81 public function __wakeup()
83 $this->classReflection = new ReflectionClass(new \ReflectionClass($this->class), $this->getNamespace(), $this->getInvokeArguments());
84 $this->reflection = new \ReflectionMethod($this->classReflection->getName(), $this->getName());