From 8439457a8880d0324085d701c730ee945f09e35e Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 28 Sep 2010 16:40:45 +0000 Subject: [PATCH] Simplification modification code zend framework prise en compte que des @var --- .../Soap/Wsdl/Strategy/DefaultComplexType.php | 37 ++----------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/library/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php b/library/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php index b6d6f39f..8f66a38e 100644 --- a/library/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php +++ b/library/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php @@ -78,43 +78,12 @@ class Zend_Soap_Wsdl_Strategy_DefaultComplexType extends Zend_Soap_Wsdl_Strategy */ $comment = ''; $docBlock = preg_replace('/\n/', '', $property->getDocComment() ); - if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+/m', $docBlock, $docBlockMatches)) { + if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+\s+(?:\*|@)/m', $docBlock, $docBlockMatches)) { $comment.= preg_replace( - array('/\r/', '/\t\s\*/', '/@ref\s+[^\s]+/'), - array('', '', ''), $docBlockMatches[1] + array('/\r/', '/\t\s\*/'), + array('', ''), $docBlockMatches[1] ); } - if (preg_match('/@var\s+[^\s]+\s+(.+)\*\//m', $docBlock, $docBlockMatches)) { - $comment.= preg_replace( - array('/\r/', '/\t\s\*/', '/@ref\s+[^\s]+/'), - array('', '', ''), $docBlockMatches[1] - ); - } - - /** - * Traitement des références - * @ref fichier:titre:nom_du_fichier - * => http://vhost/ref/fichier/ - * @ref mysql:titre:db.table(col1,col2,....) - * => http://vhost/ref/table/ - */ - if (preg_match_all('/@ref\s+(fichier|mysql):([^\s]+):([^\s]+)/m', $property->getDocComment(), $refMatches, PREG_SET_ORDER)){ - $host = $_SERVER['SERVER_NAME']; - $urlFichier = '/ref/fichier/'; - $urlMysql = '/ref/table/'; - $comment.= 'Référence(s) : '; - foreach ($refMatches as $ref){ - switch ($ref[0]){ - case 'fichier': - $comment.= $ref[1].'('.$host.$urlFichier.'?q='.$ref[2].')'; - break; - case 'mysql': - $comment.= $ref[1].'('.$host.$urlMysql.'?q='.base64_encode($ref[2]).')'; - break; - } - $comment.= ', '; - } - } /** * Ajout des éléments de documentation au WSDL