Search code examples
phpcomments

What is mean by @file tag in dockblock


I am using phpCheckstyle phpcheckstyle for standardizing my code commenting. After validating file in warning it suggests "Doc block comments should include information about file(@file) for each PHP file" The warning resolves when adding @file tag -- I want to know what value should I assign to this tag (What it indicates).

And what is the difference between @file and @filesource

Thanks,


Solution

  • According to code standards @file is a Doc-Block comment (for each file) and is a description of what this file is intended for.

    For example, imagine your model file Users.php with all its methods, well, you can put in your file comment something like this:

    /**
     @file
       This file will store all model methods to recover/update/delete Users.php
     ....
    */
    

    @filesource, afaik, is similar to @example tag, you can take a look to pear documentation here