开发者

In PhpDocumentor, is there a way to specify a default version number?

开发者 https://www.devze.com 2022-12-21 14:40 出处:网络
All the files in 开发者_高级运维the code base I am documenting will always use the same version \"string\" Is there a way I can specific in a single place for the PhpDocumentor to use the same version

All the files in 开发者_高级运维the code base I am documenting will always use the same version "string" Is there a way I can specific in a single place for the PhpDocumentor to use the same version for all files, regardless if it is specified or not (should auto-inherit)

...and what other tags would this be useful for off the top of your head?

Edit:

Anything that could get around parent-child relations? Something like a .ini or configuration file for reading in the version, author, copyright?


I am not aware PHPDocumentor allows anything like this.

Also, having the same version on all files seems wrong usage to me. The version annotation gives the version for a specific file. If you was to fix a bug in Class A, why would the version of Class B change?

As for inserting the same annotations across multiple documents, I suggest to look into your IDEs templating feature. Usually, you can configure snippets like this and insert them with keyboard shortcuts or when creating new files.

Another option would be to set and replace annotations values when creating the documentation through a deploy script, like Phing or Ant or through a pre-commit hook in your code repository.


EDIT Going through the phpdocumentor manual again, I found this:

The {@inheritdoc} inline tag is used in the DocBlocks of classes, methods and class variables of child classes. phpDocumentor will automatically inherit the @author tag, @version tag, and @copyright tag from a parent class. In addition, if there is no documentation comment present, it will inherit the parent's documentation.

Note that if the {@inheritdoc} inline tag is not present, and a child class is undocumented, the child class will still attempt to inherit documentation from the parent class as is. {@inheritdoc} allows flexibility of where to put documentation from the parent class in a child class's documentation.

It's not exactly what you are looking for, but it's a similar direction.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号