Simplification modification code zend framework prise en compte que des @var

This commit is contained in:
Michael RICOIS 2010-09-28 16:40:45 +00:00
parent f0c6467974
commit 8439457a88

View File

@ -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