Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Server_Reflection_Class Class Reference

Public Member Functions

 __construct (ReflectionClass $reflection, $namespace=null, $argv=false)
 
 __call ($method, $args)
 
 __get ($key)
 
 __set ($key, $value)
 
 getMethods ()
 
 getNamespace ()
 
 setNamespace ($namespace)
 
 __wakeup ()
 

Protected Attributes

 $_config = array()
 
 $_methods = array()
 
 $_namespace = null
 
 $_reflection
 

Detailed Description

Definition at line 39 of file Class.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ReflectionClass  $reflection,
  $namespace = null,
  $argv = false 
)

Constructor

Create array of dispatchable methods, each a Zend_Server_Reflection_Method. Sets reflection object property.

Parameters
ReflectionClass$reflection
string$namespace
mixed$argv
Returns
void

Definition at line 77 of file Class.php.

78  {
79  $this->_reflection = $reflection;
80  $this->setNamespace($namespace);
81 
82  foreach ($reflection->getMethods() as $method) {
83  // Don't aggregate magic methods
84  if ('__' == substr($method->getName(), 0, 2)) {
85  continue;
86  }
87 
88  if ($method->isPublic()) {
89  // Get signatures and description
90  $this->_methods[] = new Zend_Server_Reflection_Method($this, $method, $this->getNamespace(), $argv);
91  }
92  }
93  }
setNamespace($namespace)
Definition: Class.php:171
$method
Definition: info.phtml:13

Member Function Documentation

◆ __call()

__call (   $method,
  $args 
)

Proxy reflection calls

Parameters
string$method
array$args
Returns
mixed

Definition at line 102 of file Class.php.

103  {
104  if (method_exists($this->_reflection, $method)) {
105  return call_user_func_array(array($this->_reflection, $method), $args);
106  }
107 
108  #require_once 'Zend/Server/Reflection/Exception.php';
109  throw new Zend_Server_Reflection_Exception('Invalid reflection method');
110  }
$method
Definition: info.phtml:13

◆ __get()

__get (   $key)

Retrieve configuration parameters

Values are retrieved by key from $_config. Returns null if no value found.

Parameters
string$key
Returns
mixed

Definition at line 121 of file Class.php.

122  {
123  if (isset($this->_config[$key])) {
124  return $this->_config[$key];
125  }
126 
127  return null;
128  }

◆ __set()

__set (   $key,
  $value 
)

Set configuration parameters

Values are stored by $key in $_config.

Parameters
string$key
mixed$value
Returns
void

Definition at line 139 of file Class.php.

140  {
141  $this->_config[$key] = $value;
142  }
$value
Definition: gender.phtml:16

◆ __wakeup()

__wakeup ( )

Wakeup from serialization

Reflection needs explicit instantiation to work correctly. Re-instantiate reflection object on wakeup.

Returns
void

Definition at line 194 of file Class.php.

195  {
196  $this->_reflection = new ReflectionClass($this->getName());
197  }

◆ getMethods()

getMethods ( )

Return array of dispatchable Zend_Server_Reflection_Methods.

@access public

Returns
array

Definition at line 150 of file Class.php.

151  {
152  return $this->_methods;
153  }

◆ getNamespace()

getNamespace ( )

Get namespace for this class

Returns
string

Definition at line 160 of file Class.php.

161  {
162  return $this->_namespace;
163  }

◆ setNamespace()

setNamespace (   $namespace)

Set namespace for this class

Parameters
string$namespace
Returns
void

Definition at line 171 of file Class.php.

172  {
173  if (empty($namespace)) {
174  $this->_namespace = '';
175  return;
176  }
177 
178  if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) {
179  #require_once 'Zend/Server/Reflection/Exception.php';
180  throw new Zend_Server_Reflection_Exception('Invalid namespace');
181  }
182 
183  $this->_namespace = $namespace;
184  }

Field Documentation

◆ $_config

$_config = array()
protected

Definition at line 46 of file Class.php.

◆ $_methods

$_methods = array()
protected

Definition at line 52 of file Class.php.

◆ $_namespace

$_namespace = null
protected

Definition at line 58 of file Class.php.

◆ $_reflection

$_reflection
protected

Definition at line 64 of file Class.php.


The documentation for this class was generated from the following file: