Simplification modification code zend framework prise en compte que des @var
This commit is contained in:
parent
f0c6467974
commit
8439457a88
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user