+++ /dev/null
-<?php\r
-/**\r
- * Error handling for phpDocumentor\r
- *\r
- * phpDocumentor :: automatic documentation generator\r
- * \r
- * PHP versions 4 and 5\r
- *\r
- * Copyright (c) 2001-2007 Gregory Beaver\r
- * \r
- * LICENSE:\r
- * \r
- * This library is free software; you can redistribute it\r
- * and/or modify it under the terms of the GNU Lesser General\r
- * Public License as published by the Free Software Foundation;\r
- * either version 2.1 of the License, or (at your option) any\r
- * later version.\r
- * \r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * Lesser General Public License for more details.\r
- * \r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- *\r
- * @category ToolsAndUtilities\r
- * @package phpDocumentor\r
- * @subpackage Errors\r
- * @author Greg Beaver <cellog@php.net>\r
- * @copyright 2001-2007 Gregory Beaver\r
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version CVS: $Id: Errors.inc,v 1.17 2007/12/13 02:58:25 ashnazg Exp $\r
- * @filesource\r
- * @link http://www.phpdoc.org\r
- * @link http://pear.php.net/PhpDocumentor\r
- * @see parserDocBlock, parserInclude, parserPage, parserClass\r
- * @see parserDefine, parserFunction, parserMethod, parserVar\r
- * @since 0.4\r
- * @todo CS cleanup - change package to PhpDocumentor\r
- */\r
-/**\r
- * warning triggered when inheritance could be from more than one class\r
- */\r
-define("PDERROR_MULTIPLE_PARENT", 1);\r
-/**\r
- * warning triggered when parent class doesn't exist\r
- */\r
-define("PDERROR_PARENT_NOT_FOUND", 2);\r
-/**\r
- * warning triggered when an {@inline tag} is not terminated\r
- * (no } before the * / ending the comment)\r
- */\r
-define("PDERROR_UNTERMINATED_INLINE_TAG", 3);\r
-/**\r
- * warning triggered when inheritance could be from more than one class\r
- */\r
-define("PDERROR_CLASS_EXISTS", 4);\r
-/**\r
- * warning triggered when inheritance could be from more than one class\r
- */\r
-define("PDERROR_INHERITANCE_CONFLICT", 5);\r
-/**\r
- * warning triggered when a converter is passed to \r
- * {@link phpDocumentor_IntermediateParser::addConverter()} that is not a class\r
- */\r
-define("PDERROR_CONVERTER_NOT_FOUND", 6);\r
-/**\r
- * warning triggered when a converter is passed to \r
- * {@link phpDocumentor_IntermediateParser::addConverter()} that is not a class\r
- */\r
-define("PDERROR_NO_CONVERTERS", 7);\r
-/**\r
- * warning triggered when the arguments to @access are neither public nor private\r
- */\r
-define("PDERROR_ACCESS_WRONG_PARAM", 8);\r
-/**\r
- * warning triggered when there are multiple @access tags in a docblock\r
- */\r
-define("PDERROR_MULTIPLE_ACCESS_TAGS", 9);\r
-/**\r
- * warning triggered when there are multiple @return tags in a docblock\r
- */\r
-define("PDERROR_MULTIPLE_RETURN_TAGS", 10);\r
-/**\r
- * warning triggered when there are multiple @var tags in a docblock\r
- */\r
-define("PDERROR_MULTIPLE_VAR_TAGS", 11);\r
-/**\r
- * warning triggered when there are multiple @package tags in a docblock\r
- */\r
-define("PDERROR_MULTIPLE_PACKAGE_TAGS", 12);\r
-/**\r
- * warning triggered when there are multiple @subpackage tags in a docblock\r
- */\r
-define("PDERROR_MULTIPLE_SUBPACKAGE_TAGS", 13);\r
-/**\r
- * warning triggered when the package or subpackage name is illegal\r
- */\r
-define("PDERROR_ILLEGAL_PACKAGENAME", 14);\r
-/**\r
- * warning triggered when there a @package tag is used in a function,\r
- * define, method, var or include\r
- */\r
-define("PDERROR_OVERRIDDEN_PACKAGE_TAGS", 15);\r
-/**\r
- * warning triggered when there a @subpackage tag is used in a function,\r
- * define, method, var or include\r
- */\r
-define("PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS", 16);\r
-/**\r
- * warning triggered when classes in the same package have the same name\r
- */\r
-define("PDERROR_CLASS_CONFLICT", 17);\r
-/**\r
- * warning triggered when classes in the same package have the same name\r
- */\r
-define("PDERROR_UNKNOWN_TAG", 18);\r
-/**\r
- * warning triggered when there are multiple @name tags in a docblock\r
- */\r
-define("PDERROR_MULTIPLE_NAME_TAGS", 19);\r
-/**\r
- * warning triggered when there are multiple @name tags in a docblock\r
- * @todo I think this description is a copy/paste that was never updated\r
- */\r
-define("PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE", 20);\r
-/**\r
- * warning triggered when there are multiple @name tags in a docblock\r
- * @todo I think this description is a copy/paste that was never updated\r
- */\r
-define("PDERROR_GLOBAL_NOT_FOUND", 21);\r
-/**\r
- * warning triggered when there are multiple @name tags in a docblock\r
- * @todo I think this description is a copy/paste that was never updated\r
- */\r
-define("PDERROR_MULTIPLE_GLOBAL_TAGS", 22);\r
-/**\r
- * warning triggered when there are multiple @name tags in a docblock\r
- * @todo I think this description is a copy/paste that was never updated\r
- */\r
-define("PDERROR_MALFORMED_GLOBAL_TAG", 23);\r
-/**\r
- * warning triggered when an @ignore tag is used in a DocBlock preceding\r
- * a method, variable, include, or global variable\r
- */\r
-define("PDERROR_IGNORE_TAG_IGNORED", 24);\r
-/**\r
- * warning triggered when a duplicate element is encountered that will be\r
- * ignored by the documentor\r
- */\r
-define("PDERROR_ELEMENT_IGNORED", 25);\r
-/**\r
- * warning triggered when an entire page is ignored because of @access private\r
- */\r
-define("PDERROR_PARSEPRIVATE", 26);\r
-/**\r
- * warning triggered when an entire page is ignored because of @access private\r
- * @todo I think this description is a copy/paste that was never updated\r
- */\r
-define("PDERROR_UNKNOWN_COMMANDLINE", 27);\r
-/**\r
- * warning triggered when an entire page is ignored because of @access private\r
- * @todo I think this description is a copy/paste that was never updated\r
- */\r
-define("PDERROR_NEED_WHITESPACE", 28);\r
-/**\r
- * warning triggered when an entire page is ignored because of @access private\r
- * @todo I think this description is a copy/paste that was never updated\r
- */\r
-define("PDERROR_CLASS_PARENT_NOT_FOUND", 29);\r
-/**\r
- * warning triggered when a getClassByPackage is called and can't find the class\r
- */\r
-define("PDERROR_CLASS_NOT_IN_PACKAGE", 30);\r
-/**\r
- * warning triggered when a { @source } inline tag is used in a docblock not\r
- * preceding a function\r
- */\r
-define("PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND", 31);\r
-/**\r
- * warning triggered when a docblock template is never turned off\r
- * with /**#@-* / (no space)\r
- */\r
-define("PDERROR_DB_TEMPLATE_UNTERMINATED", 32);\r
-/**\r
- * warning triggered when a docblock has an unmatched <ol> or <ul>\r
- */\r
-define("PDERROR_UNMATCHED_LIST_TAG", 33);\r
-/**\r
- * warning triggered when another tag is nested in <b> \r
- * (not allowed in phpDocumentor)\r
- */\r
-define("PDERROR_CANT_NEST_IN_B", 34);\r
-/**\r
- * warning triggered when a docbook tag is not properly matched\r
- */\r
-define("PDERROR_UNMATCHED_TUTORIAL_TAG", 35);\r
-/**\r
- * warning triggered when an inline tag is found inside an xml tag name\r
- * in a package page\r
- */\r
-define("PDERROR_CANT_HAVE_INLINE_IN_TAGNAME", 36);\r
-/**\r
- * warning triggered when a tutorial is referenced\r
- * via @tutorial/{ @tutorial} and is not found\r
- */\r
-define("PDERROR_TUTORIAL_NOT_FOUND", 37);\r
-/**\r
- * warning triggered when a tutorial lists itself as a child tutorial\r
- */\r
-define("PDERROR_TUTORIAL_IS_OWN_CHILD", 38);\r
-/**\r
- * warning triggered when a tutorial's child lists the parent tutorial\r
- * as a child tutorial\r
- */\r
-define("PDERROR_TUTORIAL_IS_OWN_GRANDPA", 39);\r
-/**\r
- * warning triggered when a tutorial's child in the .ini file doesn't exist in the\r
- * package and subpackage of the parent\r
- */\r
-define("PDERROR_CHILD_TUTORIAL_NOT_FOUND", 40);\r
-/**\r
- * warning triggered when a <pdffunction:funcname /> tag is used in the PDF\r
- * Converter and no funcname is present (<pdffunction: />)\r
- */\r
-define("PDERROR_PDFFUNCTION_NO_FUNC", 41);\r
-/**\r
- * warning triggered when a <pdffunction:funcname /> tag is used in the PDF\r
- * Converter and funcname is not a {@link Cezpdf} method\r
- */\r
-define("PDERROR_PDF_METHOD_DOESNT_EXIST", 42);\r
-/**\r
- * warning triggered when a <pdffunction:funcname arg=$tempvar/> tag \r
- * is used in the PDF\r
- * Converter and "tempvar" is not set from the return of a previous pdffunction tag\r
- */\r
-define("PDERROR_PDF_TEMPVAR_DOESNT_EXIST", 43);\r
-/**\r
- * warning triggered when a subsection's title is asked for, but the subsection\r
- * is not found\r
- */\r
-define("PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND", 44);\r
-/**\r
- * warning triggered when a subsection's title is asked for, but the subsection\r
- * is not found\r
- */\r
-define("PDERROR_UNTERMINATED_ATTRIB", 45);\r
-/**\r
- * warning triggered when no @package tag is used in a page-level\r
- * or class-level DocBlock\r
- */\r
-define("PDERROR_NO_PACKAGE_TAG", 46);\r
-/**\r
- * warning triggered when no @access private tag is used in a\r
- * global variable/method/var with _ as first char in name\r
- * and --pear was specified\r
- */\r
-define("PDERROR_PRIVATE_ASSUMED", 47);\r
-/**\r
- * warning triggered when an example's path from @example /path/to/example.php\r
- * is not found\r
- */\r
-define("PDERROR_EXAMPLE_NOT_FOUND", 48);\r
-/**\r
- * warning triggered when an example's path from @example /path/to/example.php\r
- * is not found\r
- */\r
-define("PDERROR_NO_CONVERTER_HANDLER", 49);\r
-/**\r
- * warning triggered when an example's path from @example /path/to/example.php\r
- * is not found\r
- */\r
-define("PDERROR_INLINETAG_IN_SEE", 50);\r
-/**\r
- * warning triggered when an id attribute in a tutorial docbook tag is not\r
- * an {@}id} inline tag\r
- */\r
-define("PDERROR_ID_MUST_BE_INLINE", 51);\r
-/**\r
- * warning triggered when an {@}internal}} tag is not closed\r
- */\r
-define("PDERROR_INTERNAL_NOT_CLOSED", 52);\r
-/**\r
- * warning triggered when an {@}source} tag is found in a short description\r
- */\r
-define("PDERROR_SOURCE_TAG_IGNORED", 53);\r
-/**\r
- * warning triggered when a child converter doesn't override \r
- * getFormattedClassTrees()\r
- */\r
-define("PDERROR_CONVERTER_OVR_GFCT", 54);\r
-/**\r
- * warning triggered when a package is already associated with a category, and\r
- * a new association is found\r
- */\r
-define("PDERROR_PACKAGECAT_SET", 55);\r
-/**\r
- * warning triggered when text in a docblock list is not contained in\r
- * an <<li>> opening tag\r
- */\r
-define("PDERROR_TEXT_OUTSIDE_LI", 56);\r
-/**\r
- * warning triggered when a DocBlock html tag is unclosed\r
- */\r
-define("PDERROR_UNCLOSED_TAG", 57);\r
-/**\r
- * warning triggered by @filesource, if PHP < 4.3.0\r
- */\r
-define("PDERROR_TAG_NOT_HANDLED", 58);\r
-/**\r
- * warning triggered by sourcecode="on", if PHP < 4.3.0\r
- */\r
-define("PDERROR_SOURCECODE_IGNORED", 59);\r
-/**\r
- * warning triggered by an empty tag\r
- */\r
-define("PDERROR_MALFORMED_TAG", 60);\r
-/**\r
- * warning triggered by more than 1 @category tag\r
- */\r
-define("PDERROR_MULTIPLE_CATEGORY_TAGS", 61);\r
-/**\r
- * warning triggered by {@}inheritdoc} in a non-inheritable situation\r
- */\r
-define("PDERROR_INHERITDOC_DONT_WORK_HERE", 62);\r
-/**\r
- * warning triggered by @example path/to/example with no title\r
- */\r
-define("PDERROR_EMPTY_EXAMPLE_TITLE", 63);\r
-/**\r
- * warning triggered by non-existent template directory\r
- */\r
-define("PDERROR_TEMPLATEDIR_DOESNT_EXIST", 64);\r
-/**\r
- * warning triggered by an unterminated entity in a tutorial\r
- */\r
-define("PDERROR_UNTERMINATED_ENTITY", 65);\r
-/**\r
- * warning triggered by an unterminated entity in a tutorial\r
- */\r
-define("PDERROR_BEAUTIFYING_FAILED", 66);\r
-/**\r
- * warning triggered by a function with no name\r
- *\r
- * <pre>\r
- * function ($params)\r
- * {\r
- * }\r
- * </pre>\r
- * triggers this error\r
- */\r
-define("PDERROR_FUNCTION_HAS_NONAME", 67);\r
-/**\r
- * warning triggered by a page-level docblock preceding a source element\r
- *\r
- * <code>\r
- * <?php\r
- * /**\r
- * * Page-level DocBlock\r
- * * @package pagepackage\r
- * *{@*}\r
- * include 'file.php';\r
- * </code>\r
- */\r
-define("PDERROR_DOCBLOCK_CONFLICT", 68);\r
-/**\r
- * warning triggered when a file does not contain a page-level docblock\r
- */\r
-define("PDERROR_NO_PAGE_LEVELDOCBLOCK", 69);\r
-/**\r
- * warning triggered when the first docblock in a file with a @package tag\r
- * precedes a class. In this case, the class gets the docblock.\r
- */\r
-define("PDERROR_DOCBLOCK_GOES_CLASS", 70);\r
-/**\r
- * warning triggered in tutorial parsing if there is a missing {@id} inline tag\r
- */\r
-define("PDERROR_NO_DOCBOOK_ID", 71);\r
-/**\r
- * warning triggered if someone brilliant tries "class X extends X {"\r
- */\r
-define("PDERROR_CANNOT_EXTEND_SELF", 72);\r
-/**\r
- * warning triggered by improper "@uses {@link blah}"\r
- */\r
-define("PDERROR_DUMB_USES", 73);\r
-/**\r
- * warning triggered if <<ul>> is nested inside <<ul>> and not <<li>>\r
- */\r
-define("PDERROR_UL_IN_UL", 74);\r
-/**\r
- * warning triggered if a command line option does not have a valid value passed in\r
- */\r
-define("PDERROR_INVALID_VALUES", 75);\r
-/**\r
- * warning triggered when {@}internal}} is nested inside another {@}internal}}\r
- */\r
-define("PDERROR_NESTED_INTERNAL", 76);\r
-/**\r
- * warning triggered when @todo is used on an include element\r
- */\r
-define("PDERROR_NOTODO_INCLUDE", 77);\r
-/**\r
- * warning triggered when a class or method hasn't got docblock\r
- */\r
-define("PDERROR_UNDOCUMENTED_ELEMENT", 78);\r
-/**\r
- * warning triggered when any of {@}property}}, {@}property-read}},\r
- * {@}property-write}}, or {@}method}} tag does not have name\r
- */\r
-define("PDERROR_MISSING_PROPERTY_TAG_NAME", 79);\r
-/**\r
- * warning triggered when the PHP version being used has dangerous bug/behavior\r
- */\r
-define("PDERROR_DANGEROUS_PHP_BUG_EXISTS", 80);\r
-/**\r
- * warning triggered when the alias value in an page-level docblock's @name tag\r
- * is the same value as the target filename is it supposed to alias\r
- */\r
-define("PDERROR_NAME_ALIAS_SAME_AS_TARGET", 81);\r
-/**\r
- * warning triggered when the a loop recursion tripwire has been tripped\r
- */\r
-define("PDERROR_LOOP_RECURSION_LIMIT_REACHED", 82);\r
-\r
-/**\r
- * Error messages for phpDocumentor parser warnings\r
- * @global array $GLOBALS['phpDocumentor_warning_descrip']\r
- * @name $phpDocumentor_warning_descrip\r
- */\r
-$GLOBALS['phpDocumentor_warning_descrip'] =\r
- array(\r
- PDERROR_MULTIPLE_PARENT => \r
- 'Class %s has multiple possible parents, package inheritance aborted'\r
- ,\r
- PDERROR_PARENT_NOT_FOUND => \r
- 'Class %s parent %s not found'\r
- ,\r
- PDERROR_INHERITANCE_CONFLICT => \r
- 'Class %s in file %s has multiple possible parents named %s. ' .\r
- 'Cannot resolve name conflict,' . "\n" . \r
- ' try ignoring a file that contains the conflicting parent class'\r
- ,\r
- PDERROR_UNKNOWN_TAG => \r
- 'Unknown tag "@%s" used'\r
- ,\r
- PDERROR_IGNORE_TAG_IGNORED => \r
- '@ignore tag used for %s element "%s" will be ignored'\r
- ,\r
- PDERROR_ELEMENT_IGNORED => \r
- "\n" . 'duplicate %s element "%s" in file %s will be ignored.' . "\n" .\r
- 'Use an @ignore tag on the original ' .\r
- 'if you want this case to be documented.'\r
- ,\r
- PDERROR_PARSEPRIVATE => \r
- "entire page %s ignored because of @access private." . "\n" . \r
- "Choose -pp to enable parsing of private elements"\r
- ,\r
- PDERROR_CLASS_PARENT_NOT_FOUND => \r
- "class %s in package %s parent not found in @see parent::%s"\r
- ,\r
- PDERROR_CLASS_NOT_IN_PACKAGE => \r
- "class %s was not found in package %s"\r
- ,\r
- PDERROR_DB_TEMPLATE_UNTERMINATED => \r
- 'docblock template never terminated with /**#@-*/'\r
- ,\r
- PDERROR_PDF_METHOD_DOESNT_EXIST => \r
- '<pdffunction:%s /> called, but pdf method "%s" doesn\'t exist'\r
- ,\r
- PDERROR_TUTORIAL_NOT_FOUND => \r
- "tutorial \"%s\" not found, does it exist?"\r
- ,\r
- PDERROR_CHILD_TUTORIAL_NOT_FOUND => \r
- 'child tutorial "%s" listed in %s not found ' . \r
- 'in parent package "%s" subpackage "%s"'\r
- ,\r
- PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND => \r
- 'tutorial %s subsection "%s" doesn\'t exist, ' .\r
- 'but its title was asked for'\r
- ,\r
- PDERROR_NO_PACKAGE_TAG => \r
- 'no @package tag was used in a DocBlock for %s %s'\r
- ,\r
- PDERROR_PRIVATE_ASSUMED => \r
- '%s "%s" is assumed to be @access private because its name ' .\r
- 'starts with _, but has no @access tag'\r
- ,\r
- PDERROR_EXAMPLE_NOT_FOUND => \r
- 'example file "%s" does not exist'\r
- ,\r
- PDERROR_SOURCE_TAG_IGNORED => \r
- '{@source} can only be used in the long description, ' .\r
- 'not in the short description: "%s"'\r
- ,\r
- PDERROR_PACKAGECAT_SET => \r
- 'package %s is already in category %s, ' .\r
- 'will now replace with category %s'\r
- ,\r
- PDERROR_SOURCECODE_IGNORED => \r
- 'sourcecode command-line option is ignored ' . \r
- 'when your PHP build has no tokenizer support'\r
- ,\r
- PDERROR_INHERITDOC_DONT_WORK_HERE => \r
- '{@inheritdoc} can only be used in the docblock of a child class'\r
- ,\r
- PDERROR_EMPTY_EXAMPLE_TITLE => \r
- 'Example file found at "%s" has no title, using "%s"'\r
- ,\r
- PDERROR_DOCBLOCK_CONFLICT => \r
- 'Page-level DocBlock precedes "%s %s", ' .\r
- 'use another DocBlock to document the source element'\r
- ,\r
- PDERROR_NO_PAGE_LEVELDOCBLOCK => \r
- 'File "%s" has no page-level DocBlock, ' .\r
- 'use @package in the first DocBlock to create one'\r
- ,\r
- PDERROR_DOCBLOCK_GOES_CLASS => \r
- 'DocBlock would be page-level, but precedes class "%s", ' .\r
- 'use another DocBlock to document the file'\r
- ,\r
- PDERROR_NO_DOCBOOK_ID => \r
- 'Tutorial section %s "%s" has no id="{@id subsection}" tag ' .\r
- '({@id} for refentry)'\r
- ,\r
- PDERROR_BEAUTIFYING_FAILED => \r
- 'Beautifying failed: %s'\r
- ,\r
- PDERROR_NOTODO_INCLUDE => \r
- '@todo on an include element is ignored (line %s, file %s)'\r
- ,\r
- PDERROR_UNDOCUMENTED_ELEMENT => \r
- '%s "%s" has no %s-level DocBlock.'\r
- ,\r
- PDERROR_MISSING_PROPERTY_TAG_NAME => \r
- '@%s magic tag does not have name, illegal. Ignoring tag "@%s %s %s"'\r
- ,\r
- PDERROR_NAME_ALIAS_SAME_AS_TARGET => \r
- '@name value is the same as the filename it is supposed to alias'\r
- );\r
-\r
-\r
-\r
-//********************************************************\r
-\r
-\r
-\r
-/**\r
- * Error messages for phpDocumentor parser errors\r
- * @global array $GLOBALS['phpDocumentor_error_descrip']\r
- * @name $phpDocumentor_error_descrip\r
- */\r
-$GLOBALS['phpDocumentor_error_descrip'] = \r
- array(\r
- PDERROR_UNTERMINATED_INLINE_TAG => \r
- 'Inline tag {@%s} in tag %s is unterminated, "%s"'\r
- ,\r
- PDERROR_CLASS_EXISTS => \r
- 'Class %s already exists in package "%s"'\r
- ,\r
- PDERROR_CONVERTER_NOT_FOUND => \r
- 'Converter %s specified by --output command-line option is not a class'\r
- ,\r
- PDERROR_NO_CONVERTERS => \r
- 'No Converters have been specified by --output command-line option'\r
- ,\r
- PDERROR_ACCESS_WRONG_PARAM => \r
- '@access was passed neither "public" nor "private." Was passed: "%s"'\r
- ,\r
- PDERROR_MULTIPLE_ACCESS_TAGS => \r
- 'DocBlock has multiple @access tags, illegal. ' .\r
- 'ignoring additional tag "@access %s"'\r
- ,\r
- PDERROR_MULTIPLE_RETURN_TAGS => \r
- 'DocBlock has multiple @return tags, illegal. ' .\r
- 'ignoring additional tag "@return %s %s"'\r
- ,\r
- PDERROR_MULTIPLE_VAR_TAGS => \r
- 'DocBlock has multiple @var tags, illegal. ' .\r
- 'ignoring additional tag "@var %s %s"'\r
- ,\r
- PDERROR_MULTIPLE_PACKAGE_TAGS => \r
- 'DocBlock has multiple @package tags, illegal. ' .\r
- 'ignoring additional tag "@package %s"'\r
- ,\r
- PDERROR_MULTIPLE_SUBPACKAGE_TAGS => \r
- 'DocBlock has multiple @subpackage tags, illegal. ' .\r
- 'ignoring additional tag "@subpackage %s"'\r
- ,\r
- PDERROR_ILLEGAL_PACKAGENAME => \r
- '@%s tag has illegal %s name "%s"'\r
- ,\r
- PDERROR_OVERRIDDEN_PACKAGE_TAGS => \r
- '%s %s\'s DocBlock has @package tag, illegal. ' .\r
- 'ignoring tag "@package %s"'\r
- ,\r
- PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS => \r
- '"%s" %s\'s DocBlock has @subpackage tags, illegal. ' .\r
- 'ignoring tag "@subpackage %s"'\r
- ,\r
- PDERROR_CLASS_CONFLICT => \r
- 'class "%s" has multiple declarations in package %s, ' .\r
- 'in file %s and file %s, documentation will have output errors!'\r
- ,\r
- PDERROR_MULTIPLE_NAME_TAGS => \r
- 'DocBlock has multiple @name tags, illegal. ' .\r
- 'ignoring additional tag "@name %s"'\r
- ,\r
- PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE => \r
- '-po (packageoutput) option deletes parent file "%s" containing class' .\r
- ' "%s."' . "\n" . ' Try using --defaultpackagename (-dn) %s to ' .\r
- 'include the parent file in the same package as the class'\r
- ,\r
- PDERROR_GLOBAL_NOT_FOUND => \r
- 'global variable %s specified in @global tag was never found'\r
- ,\r
- PDERROR_MULTIPLE_GLOBAL_TAGS => \r
- '@global define tag already used for global variable "%s", ' .\r
- 'ignoring @global %s'\r
- ,\r
- PDERROR_MALFORMED_GLOBAL_TAG => \r
- 'incorrect @global syntax. ' .\r
- 'Should be @global vartype $varname or @global vartype description'\r
- ,\r
- PDERROR_UNKNOWN_COMMANDLINE => \r
- 'Unknown command-line option "%s" encountered, use phpdoc -h for help'\r
- ,\r
- PDERROR_NEED_WHITESPACE => \r
- 'phpDocumentor programmer error - wordparser whitespace set to false ' .\r
- 'in handleDocBlock, notify developers. You should never see this error'\r
- ,\r
- PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND => \r
- '{@source} tag used in a docblock that isn\'t preceding a function'\r
- ,\r
- PDERROR_UNMATCHED_LIST_TAG => \r
- 'unmatched ol or ul tag in DocBlock, parsing will be incorrect'\r
- ,\r
- PDERROR_CANT_NEST_IN_B => \r
- 'Can\'t nest a code, pre, ul, or ol tag in a b tag in ' .\r
- 'phpDocumentor DocBlock (%s tag nested)'\r
- ,\r
- PDERROR_UNMATCHED_TUTORIAL_TAG => \r
- 'While parsing extended documentation, "%s" tag was matched ' .\r
- 'with "%s" endtag, missing endtag'."\ntag contents:\"%s\""\r
- ,\r
- PDERROR_CANT_HAVE_INLINE_IN_TAGNAME => \r
- 'Can\'t have an inline tag inside a package page XML tag!'\r
- ,\r
- PDERROR_TUTORIAL_IS_OWN_CHILD => \r
- 'Tutorial %s lists itself as its own child in %s, illegal'\r
- ,\r
- PDERROR_TUTORIAL_IS_OWN_GRANDPA => \r
- 'Tutorial %s\'s child %s lists %s as its child in %s, illegal'\r
- ,\r
- PDERROR_PDFFUNCTION_NO_FUNC => \r
- 'Invalid pdffunction syntax: "<pdffunction: />", ' .\r
- 'should be "<pdffunction:functionname [arg="value"...]/>"'\r
- ,\r
- PDERROR_PDF_TEMPVAR_DOESNT_EXIST => \r
- '<pdffunction:%s arg=%s /> called ' .\r
- 'but temporary variable "%s" doesn\'t exist'\r
- ,\r
- PDERROR_UNTERMINATED_ATTRIB => \r
- 'Tutorial tag %s attribute %s is unterminated, current value "%s"'\r
- ,\r
- PDERROR_NO_CONVERTER_HANDLER => \r
- 'Handler for element of type "%s" called, but %s is not a method of %s'\r
- ,\r
- PDERROR_INLINETAG_IN_SEE => \r
- 'Inline tags are not allowed in a @see tag'\r
- ,\r
- PDERROR_ID_MUST_BE_INLINE => \r
- '<%s id="%s"> must be <%s id="{@id %s}">'\r
- ,\r
- PDERROR_INTERNAL_NOT_CLOSED => \r
- '{@internal was never terminated with }}'\r
- ,\r
- PDERROR_CONVERTER_OVR_GFCT => \r
- 'Converter "%s" must override getFormattedClassTrees() but doesn\'t'\r
- ,\r
- PDERROR_TEXT_OUTSIDE_LI => \r
- 'Text cannot be outside of li tag in a DocBlock list, ' .\r
- 'parsing will be incorrect'\r
- ,\r
- PDERROR_UNCLOSED_TAG => \r
- 'Unclosed %s tag in DocBlock, parsing will be incorrect'\r
- ,\r
- PDERROR_TAG_NOT_HANDLED => \r
- '"%s" tag is not available in PHP built without tokenizer support, tag ignored'\r
- ,\r
- PDERROR_MALFORMED_TAG => \r
- '"%s" tag was used without any parameters, illegal'\r
- ,\r
- PDERROR_MULTIPLE_CATEGORY_TAGS => \r
- 'package has multiple @category tags, ignoring "@category %s"'\r
- ,\r
- PDERROR_TEMPLATEDIR_DOESNT_EXIST => \r
- 'template directory "%s" does not exist'\r
- ,\r
- PDERROR_UNTERMINATED_ENTITY => \r
- 'entity &%s is unterminated'\r
- ,\r
- PDERROR_FUNCTION_HAS_NONAME => \r
- 'function has no name (PHP error - test your file before parsing!)'\r
- ,\r
- PDERROR_CANNOT_EXTEND_SELF => \r
- 'class %s cannot extend itself - TEST YOUR CODE BEFORE PARSING'\r
- ,\r
- PDERROR_DUMB_USES => \r
- '@uses can only link to string data'\r
- ,\r
- PDERROR_UL_IN_UL => \r
- 'ul/ol tags cannot be directly nested inside ul/ol, nest inside li'\r
- ,\r
- PDERROR_INVALID_VALUES => \r
- 'command %s was passed "%s" but must be one of %s'\r
- ,\r
- PDERROR_NESTED_INTERNAL => \r
- '{@internal}} cannot be nested inside {@internal}}'\r
- ,\r
- PDERROR_DANGEROUS_PHP_BUG_EXISTS => \r
- 'Dangerous PHP Bug exists in PHP version %s that can be triggered ' .\r
- 'by this parse (see PHP Bug #%s and PEAR Bug #%s)'\r
- ,\r
- PDERROR_LOOP_RECURSION_LIMIT_REACHED => \r
- 'An internal loop in PhpDocumentor has reached its preset ' .\r
- 'recursion limit, preventing a possible infinite loop condition.'\r
- );\r
-\r
-/**\r
- * encapsulates warning information\r
- *\r
- * @category ToolsAndUtilities\r
- * @package phpDocumentor\r
- * @subpackage Errors\r
- * @author Greg Beaver <cellog@php.net>\r
- * @copyright 2001-2007 Gregory Beaver\r
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version Release: 1.4.1\r
- * @link http://www.phpdoc.org\r
- * @link http://pear.php.net/PhpDocumentor\r
- * @todo CS cleanup - change package to PhpDocumentor\r
- */\r
-class RecordWarning\r
-{\r
- /**\r
- * name of global variable that descriptors for this warning/error is kept\r
- * @var string\r
- */\r
- var $type = 'phpDocumentor_warning_descrip';\r
- /**\r
- * file this error occurred in\r
- * @var string\r
- */\r
- var $file = false;\r
- /**\r
- * line number of the file this error occurred in\r
- * @var integer\r
- */\r
- var $linenum;\r
- /**\r
- * error string\r
- * @var string\r
- */\r
- var $data;\r
- /**\r
- * error number\r
- * @see Errors.inc\r
- * @var string\r
- */\r
- var $num;\r
- /**\r
- * Constructor\r
- *\r
- * @param string $file filename this error occurred in ({@link $file})\r
- * @param integer $linenum line number this error occurred on ({@link $linenum})\r
- * @param integer $num Error number defined in {@link Errors.inc}\r
- * @param string $data... variable number of strings, up to 4, \r
- *\r
- * @todo CS Cleanup - do I need to add $data to the method signature?\r
- * to sprintf based on the error number\r
- */\r
- function RecordWarning($file, $linenum, $num)\r
- {\r
- $this->file = $file;\r
- $this->linenum = $linenum;\r
- $a = array('', '', '', '');\r
- if (func_num_args()>3) {\r
- for ($i=3;$i<func_num_args();$i++) {\r
- $a[$i - 3] = func_get_arg($i);\r
- }\r
- }\r
-\r
- $this->num = $num;\r
- $this->data = \r
- sprintf($GLOBALS[$this->type][$this->num], $a[0], $a[1], $a[2], $a[3]);\r
- $this->output();\r
- }\r
- \r
- /**\r
- * prints the warning\r
- *\r
- * @param string $string the warning to print\r
- *\r
- * @return void\r
- */\r
- function output($string = false)\r
- {\r
- if ($string) {\r
- if ($this->file) {\r
- return \r
- "WARNING in $this->file on line $this->linenum: $this->data\n";\r
- } else {\r
- return "WARNING: $this->data\n";\r
- }\r
- }\r
- if ($this->file) {\r
- phpDocumentor_out("WARNING in $this->file " .\r
- "on line $this->linenum: $this->data\n");\r
- } else {\r
- phpDocumentor_out("WARNING: $this->data\n");\r
- }\r
- flush();\r
- }\r
-}\r
-\r
-/**\r
- * encapsulates error information\r
- *\r
- * @category ToolsAndUtilities\r
- * @package phpDocumentor\r
- * @subpackage Errors\r
- * @author Greg Beaver <cellog@php.net>\r
- * @copyright 2001-2007 Gregory Beaver\r
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version Release: 1.4.1\r
- * @link http://www.phpdoc.org\r
- * @link http://pear.php.net/PhpDocumentor\r
- * @todo CS cleanup - change package to PhpDocumentor\r
- */\r
-class RecordError extends RecordWarning\r
-{\r
- /**\r
- * name of global variable that descriptors for this warning/error is kept\r
- * @var string\r
- */\r
- var $type = 'phpDocumentor_error_descrip';\r
-\r
- /**\r
- * prints the error\r
- *\r
- * @param string $string the error to print\r
- *\r
- * @return string\r
- */\r
- function output($string = false)\r
- {\r
- if ($string) {\r
- if ($this->file) {\r
- return \r
- "\n\tERROR in $this->file on line $this->linenum: $this->data\n"\r
- ;\r
- } else {\r
- return "\n\tERROR: $this->data\n";\r
- }\r
- }\r
- if ($this->file) {\r
- phpDocumentor_out("\n\tERROR in $this->file " .\r
- "on line $this->linenum: $this->data\n");\r
- } else {\r
- phpDocumentor_out("\n\tERROR: $this->data\n");\r
- }\r
- flush();\r
- }\r
-}\r
-\r
-/**\r
- * contains all the errors/warnings\r
- *\r
- * @category ToolsAndUtilities\r
- * @package phpDocumentor\r
- * @subpackage Errors\r
- * @author Greg Beaver <cellog@php.net>\r
- * @copyright 2001-2007 Gregory Beaver\r
- * @license http://www.opensource.org/licenses/lgpl-license.php LGPL\r
- * @version Release: 1.4.1\r
- * @link http://www.phpdoc.org\r
- * @link http://pear.php.net/PhpDocumentor\r
- * @todo CS cleanup - change package to PhpDocumentor\r
- * @see $errors, $warnings\r
- */\r
-class ErrorTracker\r
-{\r
- /**\r
- * array of {@link RecordError}s\r
- * @var array\r
- */\r
- var $errors = array();\r
- /**\r
- * array of {@link RecordWarning}s\r
- * @var array\r
- */\r
- var $warnings = array();\r
- /**\r
- * @var string\r
- */\r
- var $curfile = '';\r
- /**\r
- * @var integer\r
- */\r
- var $linenum = 0;\r
- \r
- /**\r
- * index in {@link $errors} of last error triggered\r
- * @var integer|false\r
- */\r
- var $lasterror = false;\r
- \r
- /**\r
- * index in {@link $warnings} of last warning triggered\r
- * @var integer|false\r
- */\r
- var $lastwarning = false;\r
- \r
- /**\r
- * This function subscribes to two events in the Parser \r
- * in order to keep track of line number information and file name.\r
- *\r
- * @param integer $num parser-passed event \r
- * (see {@link PHPDOCUMENTOR_EVENT_NEWLINENUM, \r
- * PHPDOCUMENTOR_EVENT_NEWFILE})\r
- * @param mixed $data either a line number if $num is \r
- * PHPDOCUMENTOR_EVENT_NEWLINENUM or a file name \r
- * if $num is PHPDOCUMENTOR_EVENT_NEWFILE\r
- *\r
- * @return void\r
- */\r
- function handleEvent($num,$data)\r
- {\r
- switch($num) {\r
- case PHPDOCUMENTOR_EVENT_NEWLINENUM :\r
- $this->linenum = $data;\r
- break;\r
-\r
- case PHPDOCUMENTOR_EVENT_NEWFILE :\r
- $this->linenum = 0;\r
- $this->curfile = $data;\r
- break;\r
-\r
- case 1000000635 : // debugging\r
- phpDocumentor_out($this->curfile . \r
- ' has ' . $this->linenum . ' lines' . "\n");\r
- flush();\r
- break;\r
- }\r
- }\r
-\r
- /**\r
- * add a new warning to the {@link $warnings} array\r
- *\r
- * @param integer $num error number from {@link Errors.inc}\r
- * @param string $data... up to 4 string parameters to sprintf()\r
- * into the error string for error number $num\r
- *\r
- * @return void\r
- * @todo CS Cleanup - do I need to add $data to the method signature?\r
- */\r
- function addWarning($num)\r
- {\r
- $a = array('', '', '', '');\r
- if (func_num_args()>1) {\r
- for ($i=1;$i<func_num_args();$i++) {\r
- $a[$i - 1] = func_get_arg($i);\r
- }\r
- }\r
- $this->warnings[] = new RecordWarning($this->curfile, \r
- $this->linenum, $num, $a[0], $a[1], $a[2], $a[3]);\r
- $this->lastwarning = count($this->warnings) - 1;\r
- }\r
-\r
- /**\r
- * add a new error to the {@link $errors} array\r
- *\r
- * @param integer $num error number from {@link Errors.inc}\r
- * @param string $data... up to 4 string parameters to sprintf()\r
- * into the error string for error number $num\r
- *\r
- * @return void\r
- * @todo CS Cleanup - do I need to add $data to the method signature?\r
- */\r
- function addError($num)\r
- {\r
- $a = array('', '', '', '');\r
- if (func_num_args()>1) {\r
- for ($i=1;$i<func_num_args();$i++) {\r
- $a[$i - 1] = func_get_arg($i);\r
- }\r
- }\r
- $this->errors[] = new RecordError($this->curfile,\r
- $this->linenum, $num, $a[0], $a[1], $a[2], $a[3]);\r
- $this->lasterror = count($this->errors) - 1;\r
- }\r
- \r
- /**\r
- * add a new error to the {@link $errors} array and returns the error string\r
- *\r
- * @param integer $num error number from {@link Errors.inc}\r
- * @param string $data... up to 4 string parameters to sprintf()\r
- * into the error string for error number $num\r
- *\r
- * @return void\r
- * @todo CS Cleanup - do I need to add $data to the method signature?\r
- */\r
- function addErrorReturn($num)\r
- {\r
- $a = array('', '', '', '');\r
- if (func_num_args()>1) {\r
- for ($i=1;$i<func_num_args();$i++) {\r
- $a[$i - 1] = func_get_arg($i);\r
- }\r
- }\r
- $this->errors[] = new RecordError($this->curfile,\r
- $this->linenum, $num, $a[0], $a[1], $a[2], $a[3], false);\r
- $this->lasterror = count($this->errors) - 1;\r
- }\r
- \r
- /**\r
- * Get sorted array of all warnings in parsing/conversion\r
- *\r
- * @return array\r
- */\r
- function &returnWarnings()\r
- {\r
- usort($this->warnings, array($this, "errorsort"));\r
- return $this->warnings;\r
- }\r
- \r
- /**\r
- * Get sorted array of all non-fatal errors in parsing/conversion\r
- *\r
- * @return array\r
- */\r
- function &returnErrors()\r
- {\r
- usort($this->errors, array($this, "errorsort"));\r
- return $this->errors;\r
- }\r
- \r
- /**\r
- * sort two errors\r
- *\r
- * @param RecordError|RecordWarning $a the first error/warning\r
- * @param RecordError|RecordWarning $b the second error/warning\r
- *\r
- * @return int\r
- * @access private\r
- */\r
- function errorsort($a, $b)\r
- {\r
- if (!$a->file) return -1;\r
- if (!$b->file) return 1;\r
- if ($a->file == $b->file) {\r
- if ($a->linenum == $b->linenum) return 0;\r
- if ($a->linenum < $b->linenum) return -1;\r
- return 1;\r
- }\r
- return strnatcasecmp($a->file, $b->file);\r
- }\r
- \r
- /**\r
- * Get the error message of the last error\r
- *\r
- * @return string\r
- */\r
- function returnLastError()\r
- {\r
- return $this->errors[$this->lasterror]->output(true);\r
- }\r
-\r
- /**\r
- * Get the warning message of the last warning\r
- *\r
- * @return string\r
- */\r
- function returnLastWarning()\r
- {\r
- return $this->warnings[$this->lastwarning]->output(true);\r
- }\r
-}\r
-\r
-/**\r
- * @global ErrorTracker $GLOBALS['phpDocumentor_errors']\r
- * @name $phpDocumentor_errors\r
- */\r
-$GLOBALS['phpDocumentor_errors'] = new ErrorTracker;\r
-\r
-/**\r
- * add an Error\r
- *\r
- * @param integer $num error number from {@link Errors.inc}\r
- * @param string $data... up to 4 string parameters to sprintf() \r
- * into the error string for error number $num\r
- *\r
- * @return void\r
- * @see ErrorTracker::addError()\r
- * @todo CS Cleanup - do I need to add $data to the method signature?\r
- */\r
-function addError($num)\r
-{\r
- global $phpDocumentor_errors;\r
- $a = array('', '', '', '');\r
- if (func_num_args()>1) {\r
- for ($i=1;$i<func_num_args();$i++) {\r
- $a[$i - 1] = func_get_arg($i);\r
- }\r
- }\r
- $phpDocumentor_errors->addError($num, $a[0], $a[1], $a[2], $a[3]);\r
-}\r
-\r
-/**\r
- * like {@link addError()} but exits parsing\r
- *\r
- * @param integer $num error number from {@link Errors.inc}\r
- * @param string $data... up to 4 string parameters to sprintf() \r
- * into the error string for error number $num\r
- *\r
- * @return void\r
- * @global ErrorTracker repository for all errors generated by phpDocumentor\r
- * @see ErrorTracker::addError()\r
- * @todo CS Cleanup - do I need to add $data to the method signature?\r
- */\r
-function addErrorDie($num)\r
-{\r
- global $phpDocumentor_errors;\r
- $a = array('', '', '', '');\r
- if (func_num_args()>1) {\r
- for ($i=1;$i<func_num_args();$i++) {\r
- $a[$i - 1] = func_get_arg($i);\r
- }\r
- }\r
- $phpDocumentor_errors->addErrorReturn($num, $a[0], $a[1], $a[2], $a[3]);\r
- echo $phpDocumentor_errors->returnLastError();\r
- die(1);\r
-}\r
-\r
-/**\r
- * add a Warning\r
- *\r
- * @param integer $num warning number from {@link Errors.inc}\r
- * @param string $data... up to 4 string parameters to sprintf() \r
- * into the error string for error number $num\r
- *\r
- * @return void\r
- * @global ErrorTracker repository for all errors generated by phpDocumentor\r
- * @see ErrorTracker::addWarning()\r
- * @todo CS Cleanup - do I need to add $data to the method signature?\r
- */\r
-function addWarning($num)\r
-{\r
- global $phpDocumentor_errors;\r
- $a = array('', '', '', '');\r
- if (func_num_args()>1) {\r
- for ($i=1;$i<func_num_args();$i++) {\r
- $a[$i - 1] = func_get_arg($i);\r
- }\r
- }\r
-\r
- $phpDocumentor_errors->addWarning($num, $a[0], $a[1], $a[2], $a[3]);\r
-}\r
-?>\r