From 0f82c7c2d9e0a9d0e1e03fdfb9e5a83e831150fb Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 4 Feb 2011 10:20:14 +0000 Subject: [PATCH] Ajout affichage minLength, maxLength --- library/Web/WebClassDoc.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/library/Web/WebClassDoc.php b/library/Web/WebClassDoc.php index e5dd2453..6bded347 100644 --- a/library/Web/WebClassDoc.php +++ b/library/Web/WebClassDoc.php @@ -108,6 +108,33 @@ class WebClassDoc ); } + /** + * Traitement des @xsd (Provisoire) + * Définition des longueurs dans la documentation + * @xsd minLength=[\d]+ => (Longueur min = [\d]+) + * @xsd maxLength=[\d]+ => (Longueur max = [\d]+) + * @xsd enumeration=element,element + */ + if (preg_match_all('/@xsd\s+(minLength|maxLength)=([\d]+)\s+(?:\*|@)/m', $property->getDocComment(), $resMatches, PREG_SET_ORDER)){ + $comment.= '('; + $parcourCpt = 0; + foreach ($resMatches as $res ) { + switch ($res[1]){ + case 'minLength': + $comment.= 'Longueur min = '.$res[2]; + break; + case 'maxLength': + $comment.= 'Longueur max = '.$res[2]; + break; + } + $parcourCpt++; + if ($parcourCpt>0 && $parcourCpt