Exemple #1
0
 /**
  * Get a Service information for a Method
  *
  * @param  ReflectionMethod $method The method to get the Service Information
  * @return WsdlMethod  The Service Information object
  */
 private function getWsdlMethod(ReflectionMethod $method)
 {
     $doc = $method->getDocComment();
     $wsdlMethod = new WsdlMethod();
     $wsdlMethod->setName($method->getName());
     $wsdlMethod->setDesc(DocBlockParser::getDescription($doc));
     $params = DocBlockParser::getTagInfo($doc);
     for ($i = 0, $c = count($params); $i < $c; $i++) {
         foreach ($params[$i] as $tag => $param) {
             switch ($tag) {
                 case "@param":
                     if (isset($param['type']) && isset($param['name'])) {
                         $wsdlMethod->addParameter($param['type'], $param['name'], $param['desc']);
                     }
                     break;
                 case "@return":
                     $wsdlMethod->setReturn($param['type'], $param['desc']);
                 default:
                     break;
             }
         }
     }
     return $wsdlMethod;
 }
Exemple #2
0
 /**
  * Get a Service information for a Method
  *
  * @param  ReflectionMethod $method The method to get the Service Information
  * @return WsdlMethod  The Service Information object
  */
 private function getWsdlMethod(ReflectionMethod $method)
 {
     $doc = $method->getDocComment();
     $wsdlMethod = new WsdlMethod();
     $wsdlMethod->setName($method->getName());
     $wsdlMethod->setDesc(DocBlockParser::getDescription($doc));
     $params = DocBlockParser::getTagInfo($doc);
     for ($i = 0, $c = count($params); $i < $c; $i++) {
         foreach ($params[$i] as $tag => $param) {
             switch ($tag) {
                 case "@param":
                     if (isset($param['type']) && isset($param['name'])) {
                         $wsdlMethod->addParameter($param['type'], $param['name'], $param['desc']);
                     }
                     break;
                 case "@return":
                     $wsdlMethod->setReturn($param['type'], $param['desc']);
                     break;
                 case "@internal":
                     if (trim(strtolower($param['usage'])) == 'soapheader') {
                         $wsdlMethod->setIsHeader(true);
                     }
                     if (substr(trim(strtolower($param['usage'])), 0, 13) == 'soaprequires ') {
                         $wsdlMethod->setRequiredHeaders(explode(' ', substr(trim($param['usage']), 13)));
                     }
                     break;
                 default:
                     break;
             }
         }
     }
     return $wsdlMethod;
 }