phpDocumentor page-level docBlock in html included file

早过忘川 提交于 2019-12-10 11:29:40

问题


I'm using the tool from phpdoc.org and i'm stuck when I have a PHP file such as header.inc.php with only HTML inside.

<?php
    /**
    * Header content
    *
    * @author  My name
    *
    * @since 1.0.0
    */
?>
<!DOCTYPE html>
<html lang="fr" class="no-js"> 
    <head>
...

I get an error in my phpdoc "No page-level DocBlock was found in file...". I googled it but I didnt find any user with my case.

How to fix that error? Any tips are welcome.

Thank's!

Regards


回答1:


I just ran across this posting and though it's older, I thought I would add my two cents. While sylouuu is correct about placing a namespace directly after the your intended page-level DocBlock, I believe that it is now required to place the '@package' tag in the DocBlock. There is some caution here when dealing with logical versus hierarchical 'packages'. This behavior is basically dependent upon which version of PHPDocumentor you are using.

From: http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_elements.pkg.html "In phpDocumentor version 1.2.2, a Page-level DocBlock is the first DocBlock in a file if it contains a @package tag."

And at https://github.com/phpDocumentor/phpDocumentor2/issues/910 it can be read that as recently as a month ago, the issue of page-level DocBlocks in files with no PHP code/nodes is still being worked. Thus, as sylouuu stated about adding a namespace, once you do this, you have an documentable element and your problem should be resolved. Additionally, since most likely no documentation for the page will be created without having a node present, this allows your html-only file to have its documentation created.

Hope it helps! dw




回答2:


Ok anwser found: https://github.com/phpDocumentor/phpDocumentor2/issues/695

TL;DR: At the moment, it's not fixed, just ignore theses warnings.



来源:https://stackoverflow.com/questions/13622548/phpdocumentor-page-level-docblock-in-html-included-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!