本文整理汇总了PHP中Zend_Server_Reflection_Class类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Server_Reflection_Class类的具体用法?PHP Zend_Server_Reflection_Class怎么用?PHP Zend_Server_Reflection_Class使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Server_Reflection_Class类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addService
/**
* Build XML service description from reflection class
*
* @param Zend_Server_Reflection_Class $refclass
* @param DOMElement $target target XML element
* @return void
*/
protected function _addService(Zend_Server_Reflection_Class $refclass, DOMElement $target)
{
foreach ($refclass->getMethods() as $method) {
if (!$method->isPublic() || $method->isConstructor() || '__' == substr($method->name, 0, 2)) {
continue;
}
foreach ($method->getPrototypes() as $proto) {
$op = $this->_xml->createElement('operation');
$op->setAttribute('name', $method->getName());
$rettype = $this->_registerType($proto->getReturnType());
$op->setAttribute('returnType', $rettype);
foreach ($proto->getParameters() as $param) {
$arg = $this->_xml->createElement('argument');
$arg->setAttribute('name', $param->getName());
$type = $param->getType();
if ($type == 'mixed' && ($pclass = $param->getClass())) {
$type = $pclass->getName();
}
$ptype = $this->_registerType($type);
$arg->setAttribute('type', $ptype);
$op->appendChild($arg);
}
$target->appendChild($op);
}
}
}
示例2: __wakeup
/**
* Wakeup from serialization
*
* Reflection needs explicit instantiation to work correctly. Re-instantiate
* reflection object on wakeup.
*
* @return void
*/
public function __wakeup()
{
$this->_classReflection = new Zend_Server_Reflection_Class(new ReflectionClass($this->_class), $this->getNamespace(), $this->getInvokeArguments());
$this->_reflection = new ReflectionMethod($this->_classReflection->getName(), $this->getName());
}
示例3: testGetNamespace
/**
* namespace test
*/
public function testGetNamespace()
{
$r = new Zend_Server_Reflection_Class(new ReflectionClass('Zend_Server_Reflection'));
$this->assertEquals('', $r->getNamespace());
$r->setNamespace('namespace');
$this->assertEquals('namespace', $r->getNamespace());
}