PageRenderTime 631ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/src/application/libraries/Zend/Server/Reflection/Method.php

https://bitbucket.org/masnug/grc276-blog-laravel
PHP | 110 lines | 32 code | 12 blank | 66 comment | 2 complexity | 72ebee6b6ac04cbbdfe2555d9c2c57a1 MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Server
  17. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  18. * @license http://framework.zend.com/license/new-bsd New BSD License
  19. */
  20. /**
  21. * Zend_Server_Reflection_Function_Abstract
  22. */
  23. require_once 'Zend/Server/Reflection/Function/Abstract.php';
  24. /**
  25. * Method Reflection
  26. *
  27. * @uses Zend_Server_Reflection_Function_Abstract
  28. * @category Zend
  29. * @package Zend_Server
  30. * @subpackage Reflection
  31. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. * @version $Id: Method.php 23775 2011-03-01 17:25:24Z ralph $
  34. */
  35. class Zend_Server_Reflection_Method extends Zend_Server_Reflection_Function_Abstract
  36. {
  37. /**
  38. * Parent class name
  39. * @var string
  40. */
  41. protected $_class;
  42. /**
  43. * Parent class reflection
  44. * @var Zend_Server_Reflection_Class
  45. */
  46. protected $_classReflection;
  47. /**
  48. * Constructor
  49. *
  50. * @param Zend_Server_Reflection_Class $class
  51. * @param ReflectionMethod $r
  52. * @param string $namespace
  53. * @param array $argv
  54. * @return void
  55. */
  56. public function __construct(Zend_Server_Reflection_Class $class, ReflectionMethod $r, $namespace = null, $argv = array())
  57. {
  58. $this->_classReflection = $class;
  59. $this->_reflection = $r;
  60. $classNamespace = $class->getNamespace();
  61. // Determine namespace
  62. if (!empty($namespace)) {
  63. $this->setNamespace($namespace);
  64. } elseif (!empty($classNamespace)) {
  65. $this->setNamespace($classNamespace);
  66. }
  67. // Determine arguments
  68. if (is_array($argv)) {
  69. $this->_argv = $argv;
  70. }
  71. // If method call, need to store some info on the class
  72. $this->_class = $class->getName();
  73. // Perform some introspection
  74. $this->_reflect();
  75. }
  76. /**
  77. * Return the reflection for the class that defines this method
  78. *
  79. * @return Zend_Server_Reflection_Class
  80. */
  81. public function getDeclaringClass()
  82. {
  83. return $this->_classReflection;
  84. }
  85. /**
  86. * Wakeup from serialization
  87. *
  88. * Reflection needs explicit instantiation to work correctly. Re-instantiate
  89. * reflection object on wakeup.
  90. *
  91. * @return void
  92. */
  93. public function __wakeup()
  94. {
  95. $this->_classReflection = new Zend_Server_Reflection_Class(new ReflectionClass($this->_class), $this->getNamespace(), $this->getInvokeArguments());
  96. $this->_reflection = new ReflectionMethod($this->_classReflection->getName(), $this->getName());
  97. }
  98. }