Nirpendra Patel Nirpendra Patel - 7 months ago 10
PHP Question

Best way to write contributions header in php and all available tags like @author

enter image description here

I am working on a GitHub project https://github.com/qzoke/isbn-converter
I want to create a nice contribution header. So here are my questions :


  1. All the variables or whatever like @author available.



few that i know are:

@author
@license
@version
@package
@subpackage



  1. Best way to showcase values like



few use

@author www.website.com


few use

@author name<email>


and some just

@author name.



  1. How and what should be name for package and sub package. subpackage is confusing , no idea if i should use file name in subpackage or same package name.

  2. Is it ok to write description, keyword, contribution by in there.

  3. What's the best way to reference license, just name (like GNU GPL v3.0) or name+weblink or link to local copy or copy of whole license text.

  4. And which files should have such a header , just index.php , or header.php or every other.

  5. And what to include in html commenting , if any.


Answer

According to the https://phpdoc.org/ documentation there is a number of tags recognised by the phpDocumentor listed at https://phpdoc.org/docs/latest/index.html.

Example source https://phpdoc.org/docs/latest/references/phpdoc/tags/author.html

Syntax: @author [name] [<email address>]

The @author tag can be used to indicate who has created Structural Elements or has made significant modifications to them. This tag MAY also contain an e-mail address. If an e-mail address is provided it MUST follow the author’s name and be contained in chevrons, or angle brackets, and MUST adhere to the syntax defined in section 3.4.1 of RFC5322.

All your points can be answered using the documentation of PHPDoc.

Few more PHPDoc Tags are :

@abstract
@access
@author
@copyright
@deprecated
@deprec
@example
@exception
@global
@ignore
@internal
@license
@link
@name
@magic
@package
@param
@return
@see
@since
@static
@staticvar
@subpackage
@throws
@todo
@var
@version

You can find more in https://en.wikipedia.org/wiki/PHPDoc