Perfect solution Phpdoc @package warning and error errors in the export document, _php tutorial

Source: Internet
Author: User
Tags pear

Perfect solution to Phpdoc @package warning and error errors in the exported document,


Today in the writing of Phpdoc export documents to find a very depressing mistake, although this warning is not an important mistake, but it is always very uncomfortable to look at. So go online to find a lot of relevant information, but depressed is not know is I use Phpdoc version newness (1.4 version), or say a lot of people have not encountered this problem, anyway, there is no related to this information found, just found some from the Phpdocumentor official network poured out about @ The use of the package to note, and then only a single check, read a version of another version, I finally solved.

and found that the solution can solve the @package and other related error prompts:

Problems that arise:

1, no @package tag is used in a docblock for xxxxxxxxxxx

2, XXXXXX have no page-level docblock, use @package in the first docblock to create one

3, error:xxxx can not have @package tag .... (The specific hint I forgot, the big question means that this document cannot use the @package tag)

The main reason for the appeal problem is: page-level document block Comment parsing error

Page-level document comments:

Must be the first document block comment in the file and have a @package label

If the document is immediately followed by a snippet of PHP code or class declaration, it must be separated by a document block comment (that is, the page-level document block comment cannot immediately follow the code snippet)

such as the situation:

copy The code code as follows:/**  * This is a page-level document block comment * @package haha * * * * */  class Test {  }  Copy code The code is as follows:/**  * This is a page-level document block Comment  * @package haha * */  /**  * I am the test class */  class Test {  }  case Two: copy the Code code as follows:/**  * This is a page-level document block Comment */  /**  * This is a page-level document block Comment  * @package haha * */  class Test {  }  There will be 1/2 of the above problems. The solution is also the same   as the case one solution copy the Code code as follows:/**  * This is a page-level document block Comment  * @package haha *  * /define (' yyyy ', ' hahha ');  Copy the Code code as follows:/**  * This is a page-level document block Comment  * @package haha *  //** * I am constant *  /define (' yyyy ', ' Hahha ');  

If the document block is correct, there will be no @package related errors.

Note:

1. Note that any comments that are not/** */type will not be parsed by Phpdoc. Also, the comment lines that are not preceded by a * in/** * * are not parsed.

2, if the label is declared but does not give the relevant label required option will send out an error message, such as there is no variable after @var, @return there is no return type, there will be error errors. The solution is to add integrity, or remove it if it doesn't.

In addition, a command-line command file execution is provided that automates doc document generation:

@Rem: Command line format Auto Export Phpdoc document @Rem: Author: Sara x_824@sina.com @echo off @echo *********************************************** @echo Auto-Export Document usage instructions: @echo need to install the command line phpdocumentor, installed pear install with pear Phpdocumentor can @echo 1, option: Format the exported document, the command line format supports four formats: The default is the first format @echo # # #1 ", HTML:frames:default @echo # # #2", HTML: Smarty:default @echo # # #3 ", CHM:default:default @echo # # #4", PDF:default:default @echo 2, dir: The directory where the exported document needs to be executed, @echo 3, OutputDir: Exported document holds directory @echo 4, title: the caption of the exported document @echo *****************************************************************  @set option=html:frames:default @set dir=d:\phpapp\test @set outputdir=d:\phpapp\doc @set title= Phpwinddoc  

Note: This command requires the installation of the Phpdocumentor package under the command line, installed in pear.

This is my wish!

The above this perfect solution Phpdoc export document @package Warning and error is the small part to share all the content of everyone, I hope to give you a reference, but also hope that we have a lot of support to help guests home.

http://www.bkjia.com/PHPjc/1127862.html www.bkjia.com true http://www.bkjia.com/PHPjc/1127862.html techarticle The perfect solution to Phpdoc export document @package warning and error errors, today in writing Phpdoc export document found a very depressing error, although this warning is not heavy ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.