Perfectly solves the @ package warning and Error errors in the phpdoc export documentation,

Source: Internet
Author: User
Tags pear

Perfectly solves the @ package warning and Error errors in the phpdoc export documentation,

Today, I found a very depressing error when writing the Export Document for PHPDoc. Although this warning is not an important error, it is always quite uncomfortable. So I went to the Internet to find a lot of relevant information, but I was depressed that I did not know that the PHPDoc version I used was too new (version 1.4), or that many people did not encounter this problem, there is no relevant information to find. I just found some precautions for using @ package from the official PHPDocumentor network, and then I can only check it one by one, after reading one version and another, I finally solved the problem.

In addition, this solution can solve related error prompts such as @ package:

Problems:

1. no @ package tag was used in a DocBlock for XXXXXXXXXXX

2. XXXXXX has no page-level DocBlock, use @ package in the first DocBlock to create one

3. ERROR: XXXX can not have @ package tag .... (I forgot the specific prompt, which means that the @ package label cannot be used for the document here)

The main reason for the appeal problem is that the page-Level Document block annotation Parsing is incorrect.

Page-level document notes:

It must be the first document block comment in the file and has the @ package label.

If a PHP code or class declaration is followed by a fast annotation in this document, it must be separated by a document block annotation (that is, the code segment cannot be followed after the page-Level Document block annotation)

For example:

Case 1: Copy codeThe Code is as follows: /*** This is a page-Level Document block comment * @ package haha **/class test {} or above, the above 2 error message will appear. The solution to this case is: redeclare a document block comment for the classCopy codeThe Code is as follows: /*** This is a page-Level Document block comment * @ package haha *** // *** I am a test class */class test {}******* ****************************************Case 2: Copy codeThe Code is as follows: /*** This is a page-Level Document block annotation * // *** This is a page-Level Document block annotation * @ package haha **/class test {} will appear as above 1/2 of the problems. The solution is the same as the solution in Case 1 ****************************** *****************Case 3: Copy codeThe Code is as follows:/*** This is a page-Level Document block comment * @ package haha **/define ('yyyy', 'hahha '); as mentioned above, 3 Error occurs. The solution is as follows:Copy codeThe Code is as follows:/*** This is a page-Level Document block comment * @ package haha * // *** I am a constant */define ('yyyy ', 'hahha ');

If the document block is correct, no errors related to @ package will occur.

Note:

1. Note that no comments of the/***/type are parsed by PHPDoc. In addition, the comments that do not start with * in front of the comments in/***/will not be parsed.

2. If a tag is declared but no required tag options are provided, an Error message will be sent. For example, there is no variable after @ var and no return type after @ return, errors will occur. The solution is to complete the configuration or remove it if it does not exist.

In addition, you can run a command file in the command line mode to automatically execute the Doc file generation:

@ Rem: automatically export the PHPDoc file in command line format @ Rem: author: xiao x_824@sina.com @ echo off @ echo ********************************* **************************************** * ***** @ echo: @ echo: You need to install the php‑entor of the command line. The installation method is to install pear install php‑entor with pear. @ echo 1. option: set the format of the exported document. The command line format supports four formats: the default format is @ echo ### 1. HTML: frames: default @ echo ### 2. HTML: Smarty: default @ echo ### 3], CHM: default @ echo ### 4], PDF: defa Ult: default @ echo 2, dir: directory of the file to be exported, @ echo 3, outputDir: directory of the exported file @ echo 4, title: the title of the exported document @ echo ********************************* **************************************** * ***** @ set option = HTML: frames: default @ set dir = D: \ PHPAPP \ test @ set outputDir = D: \ PHPAPP \ doc @ set title = PHPWindDoc @ phpdoc-d % dir %-o % option %-ti % title %-t % outputDir % @ echo welcome! Exported successfully @ pause

Note:This command requires the phpjavasentor package under the command line to be installed using pear.

Proceed!

The above is a perfect solution to the Error of @ package warning and Error in the phpdoc export document. It is all the content that I have shared with you. I hope you can provide a reference and support for the customer's house.

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.