Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Reflection.php
Go to the documentation of this file.
1 <?php
24 #require_once 'Zend/Server/Reflection/Function.php';
25 
29 #require_once 'Zend/Server/Reflection/Class.php';
30 
42 {
60  public static function reflectClass($class, $argv = false, $namespace = '')
61  {
62  if (is_object($class)) {
63  $reflection = new ReflectionObject($class);
65  $reflection = new ReflectionClass($class);
66  } else {
67  #require_once 'Zend/Server/Reflection/Exception.php';
68  throw new Zend_Server_Reflection_Exception('Invalid class or object passed to attachClass()');
69  }
70 
71  if ($argv && !is_array($argv)) {
72  #require_once 'Zend/Server/Reflection/Exception.php';
73  throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass');
74  }
75 
76  return new Zend_Server_Reflection_Class($reflection, $namespace, $argv);
77  }
78 
96  public static function reflectFunction($function, $argv = false, $namespace = '')
97  {
98  if (!is_string($function) || !function_exists($function)) {
99  #require_once 'Zend/Server/Reflection/Exception.php';
100  throw new Zend_Server_Reflection_Exception('Invalid function "' . $function . '" passed to reflectFunction');
101  }
102 
103 
104  if ($argv && !is_array($argv)) {
105  #require_once 'Zend/Server/Reflection/Exception.php';
106  throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass');
107  }
108 
109  return new Zend_Server_Reflection_Function(new ReflectionFunction($function), $namespace, $argv);
110  }
111 }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
static reflectFunction($function, $argv=false, $namespace='')
Definition: Reflection.php:96
$_option $_optionId $class
Definition: date.phtml:13
static reflectClass($class, $argv=false, $namespace='')
Definition: Reflection.php:60