當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Server_Reflection_Class類代碼示例

本文整理匯總了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);
         }
     }
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:33,代碼來源:Introspector.php

示例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());
 }
開發者ID:janaece,項目名稱:globalclassroom4_clean,代碼行數:13,代碼來源:Method.php

示例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());
 }
開發者ID:crodriguezn,項目名稱:crossfit-milagro,代碼行數:10,代碼來源:ClassTest.php


注:本文中的Zend_Server_Reflection_Class類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。