cvs: doc-editor / error_type.php /php ToolsError.php

From: Date: Sun, 19 Apr 2009 13:10:10 +0000
Subject: cvs: doc-editor / error_type.php /php ToolsError.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3800@lists.php.net to get a copy of this message
yannick Sun Apr 19 13:10:10 2009 UTC Modified files: /doc-editor/php ToolsError.php /doc-editor error_type.php Log: - Add 3 new check : nbCommandTags, nbEmphasisTags, nbVarnameTags http://cvs.php.net/viewvc.cgi/doc-editor/php/ToolsError.php?r1=1.1&r2=1.2&diff_format=u Index: doc-editor/php/ToolsError.php diff -u doc-editor/php/ToolsError.php:1.1 doc-editor/php/ToolsError.php:1.2 --- doc-editor/php/ToolsError.php:1.1 Fri Apr 17 20:56:01 2009 +++ doc-editor/php/ToolsError.php Sun Apr 19 13:10:10 2009 @@ -320,11 +320,14 @@ $this->methodsynopsis(); $this->nbCdataTags(); $this->nbChapterTag(); + $this->nbCommandTag(); $this->nbElInTable(); + $this->nbEmphasisTag(); $this->nbLiteralTag(); $this->nbMemberInSeeAlso(); $this->nbNoteTag(); $this->nbParaTag(); + $this->nbVarnameTag(); $this->spaceOrPeriodRefpurposeTags(); } @@ -1287,6 +1290,99 @@ } /** + * Check Nb <varname> tags + * Add an entry into the error's stack if an error is found + * + */ + function nbVarnameTag() + { + + $reg = '/<varname>/s'; + + $en_varname = 0; + $match = array(); + if (preg_match_all($reg, $this->en_content, $match)) { + $en_varname = count($match[0]); + } + + $lang_varname = 0; + $match = array(); + if (preg_match_all($reg, $this->lang_content, $match)) { + $lang_varname = count($match[0]); + } + + if ($en_varname != $lang_varname ) { + $this->addError(array( + "value_en" => $en_varname, + "value_lang" => $lang_varname, + "type" => "nbVarnameTags" + )); + } + } + + /** + * Check Nb <emphasis> tags + * Add an entry into the error's stack if an error is found + * + */ + function nbEmphasisTag() + { + + $reg = '/<emphasis>/s'; + + $en_emphasis = 0; + $match = array(); + if (preg_match_all($reg, $this->en_content, $match)) { + $en_emphasis = count($match[0]); + } + + $lang_emphasis = 0; + $match = array(); + if (preg_match_all($reg, $this->lang_content, $match)) { + $lang_emphasis = count($match[0]); + } + + if ($en_emphasis != $lang_emphasis ) { + $this->addError(array( + "value_en" => $en_emphasis, + "value_lang" => $lang_emphasis, + "type" => "nbEmphasisTags" + )); + } + } + + /** + * Check Nb <command> tags + * Add an entry into the error's stack if an error is found + * + */ + function nbCommandTag() + { + + $reg = '/<command>/s'; + + $en_command = 0; + $match = array(); + if (preg_match_all($reg, $this->en_content, $match)) { + $en_command = count($match[0]); + } + + $lang_command = 0; + $match = array(); + if (preg_match_all($reg, $this->lang_content, $match)) { + $lang_command = count($match[0]); + } + + if ($en_command != $lang_command ) { + $this->addError(array( + "value_en" => $en_command, + "value_lang" => $lang_command, + "type" => "nbCommandTags" + )); + } + } + + /** * Check Nb <literal> tags * Add an entry into the error's stack if an error is found * http://cvs.php.net/viewvc.cgi/doc-editor/error_type.php?r1=1.4&r2=1.5&diff_format=u Index: doc-editor/error_type.php diff -u doc-editor/error_type.php:1.4 doc-editor/error_type.php:1.5 --- doc-editor/error_type.php:1.4 Fri Apr 17 20:56:01 2009 +++ doc-editor/error_type.php Sun Apr 19 13:10:10 2009 @@ -120,11 +120,18 @@ $error['nbChapterTags']['head'] = 'Chapter tags'; $error['nbChapterTags']['desc'] = 'Throw if the number of <b>chapter</b> tags is different from english version.'; - - $error['nbEntryTags']['head'] = 'Entry tags'; $error['nbEntryTags']['desc'] = 'Throw if the number of <b>entry</b> tags is different from english version.'; +$error['nbCommandTags']['head'] = 'Command tags'; +$error['nbCommandTags']['desc'] = 'Throw if the number of <b>command</b> tags is different from english version.'; + +$error['nbEmphasisTags']['head'] = 'Entry tags'; +$error['nbEmphasisTags']['desc'] = 'Throw if the number of <b>emphasis</b> tags is different from english version.'; + +$error['nbVarnameTags']['head'] = 'Entry tags'; +$error['nbVarnameTags']['desc'] = 'Throw if the number of <b>varname</b> tags is different from english version.'; + $error['errorFieldsynopsisInitializer']['head'] = 'Fieldsynopsis tags'; $error['errorFieldsynopsisInitializer']['desc'] = 'Throw if the value of the <b>initializer</b> tags is different from english version.'; $error['errorFieldsynopsisModifier']['head'] = 'Fieldsynopsis tags';

« previous php.doc.cvs (#3800) next »